Age recognition model training method and device, equipment and storage medium

By obtaining the first age of an object in a sample image and its neighboring ages, calculating the probability distribution information, and training an age recognition model to focus on age correlation, the problem of user-entered birth date deviation and interference from complex scenes is solved, thus improving the accuracy and robustness of age recognition.

CN121095640APending Publication Date: 2025-12-09CHINA UNITED NETWORK COMM GRP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511186902.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-22
Publication Date
2025-12-09

AI Technical Summary

Technical Problem

In existing technologies, the birth dates entered by users are inaccurate, resulting in low accuracy of age recognition. Furthermore, age recognition models fail to effectively consider the ambiguity of age features and interference from factors such as lighting, occlusion, and makeup, leading to low recognition accuracy.

Method used

By obtaining the first age of an object in a sample image and its multiple adjacent second ages, age ranges and parameters are determined, probability distribution information is calculated, the distribution width and standard deviation of age ranges are adjusted, and an age recognition model is trained to focus on the correlation between ages. Convolutional layers and fusion feature extraction are used to improve the model's age recognition capability.

Benefits of technology

It improves the ability of the age recognition model to distinguish between similar ages and enhances the model's robustness and continuous recognition capability in complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121095640A_ABST
    Figure CN121095640A_ABST
Patent Text Reader

Abstract

The invention provides an age recognition model training method and device, equipment and a storage medium, and relates to the technical field of computers. The method comprises the following steps: acquiring a sample image, a first age corresponding to an object in the sample image, and a plurality of second ages adjacent to the first age; determining an age group corresponding to the first age and a first parameter corresponding to the age group; determining a second parameter according to the age group and the first parameter; determining first probability distribution information corresponding to the sample image according to the first age, the plurality of second ages and a second parameter; according to the first probability distribution information and the sample image, the age identification model is trained, and the detection precision of the age identification model on the age of the object in the image is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an age recognition model training method, apparatus, device, and storage medium. Background Technology

[0002] In recent years, age recognition of users has been applied in many scenarios. For example, users can record a video that displays their age to increase entertainment value.

[0003] Currently, a user's age can be determined by querying authorized user data. For example, by obtaining the birth date entered by an authorized user. However, in this method, the birth date entered by the user may be inaccurate, resulting in low accuracy in age recognition. Summary of the Invention

[0004] This application provides an age recognition model training method, apparatus, device, and storage medium to improve the accuracy of age recognition models in detecting the age of objects in images.

[0005] Firstly, this application provides a method for training an age recognition model, the method comprising:

[0006] Obtain a sample image, the first age corresponding to the object in the sample image, and multiple second ages adjacent to the first age;

[0007] Determine the age range corresponding to the first age and the first parameter corresponding to the age range. The first parameter is used to adjust the distribution width of the age range.

[0008] Based on the age group and the first parameter, the second parameter is determined. The second parameter is used to control the standard deviation of the distribution width of the age group.

[0009] Based on the first age, multiple second ages, and second parameters, a first probability distribution information corresponding to the sample image is determined. The first probability distribution information is used to indicate the probability that the object's age is each of the second ages and the probability that the object's age is the first age.

[0010] The age recognition model is trained based on the first probability distribution information and sample images.

[0011] In one possible implementation, the age recognition model includes a first convolutional layer and a second convolutional layer; training the age recognition model based on a first probability distribution and sample images includes:

[0012] Obtain the first image feature of the sample image;

[0013] The first image features are obtained by convolving the first image features with the first convolutional layer;

[0014] The third image feature is obtained by convolving the first image feature with the second convolutional layer.

[0015] The age recognition model is trained based on the first image features, the second image features, the third image features, and the first probability distribution information.

[0016] In one possible implementation, the age recognition model is trained based on first image features, second image features, third image features, and first probability distribution information, including:

[0017] The first image features, the second image features, and the third image features are fused to obtain the fused features;

[0018] Based on the fusion characteristics, determine the second probability distribution information;

[0019] The age recognition model is trained based on the first probability distribution information and the second probability distribution information.

[0020] In one possible implementation, the second convolutional layer includes a first sub-convolutional layer and a second sub-convolutional layer; the third image features are obtained by convolutional processing of the first image features using the second convolutional layer, including:

[0021] The first image features are processed by the first sub-convolutional layer to obtain the fourth image features;

[0022] The fourth image features are processed by the second sub-convolutional layer to obtain the fifth image features;

[0023] The fourth and fifth image features are fused to obtain the third image feature.

[0024] In one possible implementation, determining the first probability distribution information corresponding to the sample image based on a first age, multiple second ages, and a second parameter includes:

[0025] Based on the first age and the second parameter, determine the probability distribution function corresponding to the age information;

[0026] The first probability distribution information is determined based on the probability distribution function and multiple second ages.

[0027] In one possible implementation, determining the first probability distribution information based on a probability distribution function and multiple second ages includes:

[0028] Determine the age difference between each second age and the first age, and a third parameter. The third parameter is used to control the range of multiple second ages.

[0029] Based on multiple age differences, determine multiple weights corresponding to multiple second ages;

[0030] The first probability distribution information is determined based on multiple weights, multiple age differences, a third parameter, multiple second ages, and a probability distribution function.

[0031] In one possible implementation, after training the age recognition model, the method further includes:

[0032] Obtain the first image, which includes the target object;

[0033] The first image is processed according to the age recognition model to obtain the probability distribution information corresponding to the first image;

[0034] The age of the target object is determined based on the probability distribution information corresponding to the first image.

[0035] Secondly, this application provides an age recognition model training device, comprising: an acquisition module, a first determination module, a second determination module, a third determination module, and a training module, wherein:

[0036] The acquisition module is used to acquire a sample image, the first age corresponding to the object in the sample image, and multiple second ages adjacent to the first age;

[0037] The first determining module is used to determine the age range corresponding to the first age and the first parameter corresponding to the age range. The first parameter is used to adjust the distribution width of the age range.

[0038] The second determining module is used to determine the second parameter based on the age group and the first parameter. The second parameter is used to control the standard deviation of the distribution width of the age group.

[0039] The third determining module is used to determine the first probability distribution information corresponding to the sample image based on the first age, multiple second ages, and second parameters. The first probability distribution information is used to indicate the probability that the age of the object is each of the second ages.

[0040] The training module is used to train the age recognition model based on the first probability distribution information and sample images.

[0041] In one possible implementation, the training module is specifically used for:

[0042] Obtain the first image feature of the sample image;

[0043] The first image features are obtained by convolving the first image features with the first convolutional layer;

[0044] The third image feature is obtained by convolving the first image feature with the second convolutional layer.

[0045] The age recognition model is trained based on the first image features, the second image features, the third image features, and the first probability distribution information.

[0046] In one possible implementation, the training module is further configured to:

[0047] The first image features, the second image features, and the third image features are fused to obtain the fused features;

[0048] Based on the fusion characteristics, determine the second probability distribution information;

[0049] The age recognition model is trained based on the first probability distribution information and the second probability distribution information.

[0050] In one possible implementation, the training module is further configured to:

[0051] The first image features are processed by the first sub-convolutional layer to obtain the fourth image features;

[0052] The fourth image features are processed by the second sub-convolutional layer to obtain the fifth image features;

[0053] The fourth and fifth image features are fused to obtain the third image feature.

[0054] In one possible implementation, the third determining module is specifically used for:

[0055] Based on the first age and the second parameter, determine the probability distribution function corresponding to the age information;

[0056] The first probability distribution information is determined based on the probability distribution function and multiple second ages.

[0057] In one possible implementation, the third determining module is further configured to:

[0058] Determine the age difference between each second age and the first age, and a third parameter. The third parameter is used to control the range of multiple second ages.

[0059] Based on multiple age differences, determine multiple weights corresponding to multiple second ages;

[0060] The first probability distribution information is determined based on multiple weights, multiple age differences, a third parameter, multiple second ages, and a probability distribution function.

[0061] In one possible implementation, the age recognition model training device further includes: a fourth determining module, the fourth determining module being used for:

[0062] Obtain the first image, which includes the target object;

[0063] The first image is processed according to the age recognition model to obtain the probability distribution information corresponding to the first image;

[0064] The age of the target object is determined based on the probability distribution information corresponding to the first image.

[0065] Thirdly, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to execute the age recognition model training method as described in the first aspect above and any one of the first aspects.

[0066] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the age recognition model training method as described in the first aspect above and any of the first aspects.

[0067] This application provides a method, apparatus, device, and storage medium for training an age recognition model. The method involves acquiring a sample image, a first age corresponding to an object in the sample image, and multiple second ages adjacent to the first age; determining an age segment corresponding to the first age and a first parameter corresponding to the age segment; determining a second parameter based on the age segment and the first parameter; determining a first probability distribution information corresponding to the sample image based on the first age, the multiple second ages, and the second parameter; and training the age recognition model based on the first probability distribution information and the sample image. In this method, training the age recognition model using the first probability distribution information allows the model to fully consider the probabilities corresponding to each age during the learning process. This enables the model to learn not only the features of the first age but also the correlation features between the first age and its multiple adjacent second ages. By considering the correlation between ages adjacent to the first age, the model can better capture the continuity of age during training and inference, thereby improving its ability to distinguish between similar ages and ultimately enhancing the accuracy of age detection for objects in images. Attached Figure Description

[0068] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0069] Figure 1 A flowchart illustrating an age recognition model training method provided in an embodiment of this application;

[0070] Figure 2 A flowchart illustrating another age recognition model training method provided in this application embodiment;

[0071] Figure 3 A schematic diagram of the network structure of an age recognition model provided in an embodiment of this application;

[0072] Figure 4 A schematic diagram of the network structure of another age recognition model provided in this application embodiment;

[0073] Figure 5 A flowchart illustrating the method for determining the first probability distribution information provided in an embodiment of this application;

[0074] Figure 6 A flowchart illustrating a method for determining the age of a face based on an age recognition model, provided in an embodiment of this application;

[0075] Figure 7 This is a schematic diagram of the structure of an age recognition model training device provided in an embodiment of this application;

[0076] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.

[0077] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation

[0078] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0079] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with relevant laws, regulations and standards, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0080] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0081] In recent years, age recognition methods have been widely used in many scenarios, such as public transportation safety management. In related technologies, electronic devices can perform face detection on captured images to obtain facial images, and then determine the age of the person in the facial image using an age recognition model.

[0082] The age recognition model is obtained through pre-training. During the training process, the electronic device aims to minimize the absolute error between the predicted age and the actual age, without considering the ambiguity of the age features themselves (such as the feature information of a 29-year-old being very different from that of a 30-year-old). As a result, the age recognition model is easily affected by lighting, occlusion, makeup, and noise, which may cause slight distortion or loss of features in the facial image, resulting in low accuracy of age recognition.

[0083] To address the aforementioned issues, this application provides an age recognition method. This method involves acquiring a sample image, a first age (real age) corresponding to an object (face) in the sample image, and multiple second ages adjacent to the first age; determining the age range corresponding to the first age and a first parameter corresponding to the age range; determining a second parameter based on the age range and the first parameter; determining a first probability distribution information (the probability that the object's age is each of the second ages and the probability that the object's age is the first age) based on the first age, the multiple second ages, and the second parameter; and training an age recognition model based on the first probability distribution information and the sample image. In this method, training the age recognition model using the first probability distribution information allows the model to fully consider the probabilities corresponding to each age during the learning process. This enables the model to learn not only the features of the first age but also the correlation features between the first age and its multiple adjacent second ages. By considering the correlation between ages adjacent to the first age, the model can better capture the continuity of age during training and inference, thereby improving its ability to distinguish between similar ages and ultimately enhancing the accuracy of age detection for objects in images.

[0084] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0085] Figure 1 This is a flowchart illustrating an age recognition model training method provided in an embodiment of this application. Please refer to [link / reference]. Figure 1 As shown, the method may include the following steps:

[0086] S101. Obtain a sample image, the first age corresponding to the object in the sample image, and multiple second ages adjacent to the first age.

[0087] The execution subject of this application embodiment can be an electronic device or an age recognition model training device installed in an electronic device. The age recognition model training device can be implemented by software or by a combination of software and hardware.

[0088] In one possible implementation, the sample images can be images from a public dataset used to train the age recognition model. Public datasets include, for example, the Asian Face Age Dataset (AFAD) and UTKFACE. The sample images can also be pre-collected face images of different sizes, face images in different complex scenes, and face images that are prone to false detection by the age recognition model.

[0089] In one possible implementation, the electronic device can preprocess the sample image, such as performing image flipping, rotation, cropping, translation, affine transformation, and tone adjustment on the sample image; the electronic device can also perform data augmentation processing on the sample image, such as performing mosaic enhancement, random erase, hide and seek, and drop block on the sample image.

[0090] In one possible implementation, the object is a face in a sample image, the first age is the age corresponding to the face in the sample image, and the number of second ages can be preset.

[0091] For example, if the first age is 10 years old, the multiple second ages can be 8 years old, 9 years old, 11 years old, 12 years old, etc.

[0092] S102. Determine the age range corresponding to the first age and the first parameter corresponding to the age range. The first parameter is used to adjust the distribution width of the age range.

[0093] In one possible implementation, the electronic device can divide age into different age groups; for example, the electronic device can recognize [0, A...]. max In the case of an age range, the electronic device can divide that age range into N age groups, where the boundaries of each age group can be b0, b1, ..., b NWhere b0 = 0 and b1 = A max / N、……、b N =A max Electronic devices can transmit argmax(b) i The value ≤a) is determined as the age range corresponding to the first age, and this age range satisfies b. i The largest value of i ≤ a. The argmax function is used to return the value of i that satisfies b. i The largest value of i less than or equal to a, A max A is the maximum age that electronic devices can recognize. max For example, it could be 70 or 100, etc.

[0094] In one possible implementation, a Gaussian distribution centered on the first age exists around the first age.

[0095] In one possible implementation, the first parameter is related to the severity of physiological changes. The more severe the physiological changes, the larger the first parameter. The first parameter follows a uniform distribution in the interval (0.5, 1.5). In this embodiment, the first parameter is neither 0 nor too large. If the first parameter is not 0, the correlation between the ages adjacent to the first age can be avoided. If the first parameter is not too large, the distribution width can be avoided to avoid age ambiguity.

[0096] The degree of physiological change refers to the extent to which facial features (such as skin texture, wrinkle distribution, and facial contours) change significantly with age at different stages. For example, adolescents experience rapid changes in facial bone development and skin condition, representing a stage of more dramatic physiological changes; while the facial features of the elderly are relatively stable, and physiological changes are more gradual.

[0097] In one possible implementation, the electronic device has a first parameter pre-set for each age group, and the electronic device can obtain the first parameter according to the age group.

[0098] S103. Based on the age group and the first parameter, determine the second parameter, which is used to control the standard deviation of the distribution width of the age group.

[0099] In one possible implementation, the electronic device can determine the second parameter by multiplying the first parameter by half the length of the age range, which can be expressed as:

[0100]

[0101] Where s represents the age group corresponding to the first age, b s+1 -b s a represents the length of an age range. s This indicates the first parameter.

[0102] S104. Based on the first age, multiple second ages, and second parameters, determine the first probability distribution information corresponding to the sample image. The first probability distribution information is used to indicate the probability that the object's age is each of the second ages and the probability that the object's age is the first age.

[0103] In one possible implementation, the format of the first probability distribution information can be a key-value pair of "age value - probability value". For example, when the first age is 10 years old and multiple second ages are 8, 9, 11 and 12 years old, the first probability distribution information can be: 8 years old - 0.06, 9 years old - 0.11, 10 years old - 0.7, 11 years old - 0.09, 12 years old - 0.04.

[0104] S105. Train the age recognition model based on the first probability distribution information and sample images.

[0105] In one possible implementation, the electronic device can input the first probability distribution information and sample images into the age recognition model, and obtain the probability distribution information predicted by the age recognition model through forward propagation. The electronic device can calculate the value of the loss function (e.g., cross-entropy function) based on the predicted probability distribution information and the first probability distribution information. Then, the electronic device can obtain the gradient of each parameter in the age recognition model through backpropagation based on the value of the loss function, and use an optimizer to update each parameter along the direction of gradient descent (i.e., the direction in which the value of the loss function is minimized). The electronic device can train the age recognition model through multiple rounds of iteration. When a preset termination condition is met (e.g., the number of iterations reaches the maximum number of iterations, or the value of the loss function does not decrease for a consecutive preset number of rounds), the training is terminated and the values ​​of each parameter in the final age recognition model are determined.

[0106] The optimizer can be an adaptive moment estimation optimizer (Adam), a stochastic gradient descent optimizer (SGD), or a momentum optimizer, etc.

[0107] In this embodiment, the electronic device can acquire a sample image, a first age corresponding to an object in the sample image, and multiple second ages adjacent to the first age; determine the age segment corresponding to the first age and a first parameter corresponding to the age segment; determine a second parameter based on the age segment and the first parameter; determine a first probability distribution information corresponding to the sample image based on the first age, multiple second ages, and the second parameter; and train an age recognition model based on the first probability distribution information and the sample image. In the above method, training the age recognition model using the first probability distribution information allows the model to fully consider the probability corresponding to each age during the learning process. This enables the age recognition model to learn not only the features of the first age but also the correlation features between the first age and its multiple adjacent second ages, taking into account the correlation between the ages adjacent to the first age. This allows the age recognition model to better capture the continuity of age during training and inference, thereby improving its ability to distinguish between similar ages and ultimately enhancing the accuracy of age detection for objects in images.

[0108] Based on any of the above embodiments, the following, in conjunction with Figure 2 A method for training an age recognition model based on the first probability distribution information and sample images. Figure 1 S105 in the embodiments will be described in detail.

[0109] Figure 2 For a detailed flowchart illustrating another age recognition model training method provided in this application embodiment, please refer to [link / reference]. Figure 2 The method may include:

[0110] S201. Obtain the first image feature of the sample image.

[0111] In one possible implementation, the electronic device can obtain the first image features of the sample image through convolutional layers and / or segmentation, etc.

[0112] S202. Perform convolution processing on the first image features according to the first convolution layer to obtain the second image features.

[0113] In some embodiments, the age recognition model includes a first convolutional layer and a second convolutional layer.

[0114] In one possible implementation, the first convolutional layer may include one or more convolutions, meaning that the electronic device may sequentially perform one or more convolutional processes on the first image features to obtain the second image features.

[0115] S203. Perform convolution processing on the first image features according to the second convolution layer to obtain the third image features.

[0116] In some embodiments, the second convolutional layer includes a first sub-convolutional layer and a second sub-convolutional layer.

[0117] In some embodiments, the electronic device may process the first image features according to the first sub-convolutional layer to obtain the fourth image features; the electronic device may also process the fourth image features according to the second sub-convolutional layer to obtain the fifth image features; the electronic device may then fuse the fourth image features and the fifth image features to obtain the third image features.

[0118] In one possible implementation, the first sub-convolutional layer may include convolution and / or wavelet pooling, etc., and the second convolutional layer may include convolution, wavelet pooling, depthwise convolution, pointwise convolution, and / or fully connected layers, etc.

[0119] In one possible implementation, the electronic device can obtain the third image feature by multiplying the fourth and fifth image features.

[0120] S204. Train the age recognition model based on the first image features, the second image features, the third image features, and the first probability distribution information.

[0121] In some embodiments, the electronic device can fuse the first image features, the second image features, and the third image features to obtain fused features; the electronic device can determine the second probability distribution information based on the fused features; and then the electronic device can train the age recognition model based on the first probability distribution information and the second probability distribution information.

[0122] In one possible implementation, the second probability distribution information can be understood as Figure 1 The predicted probability distribution information in the embodiment, and the specific implementation method for the electronic device to train the age recognition model based on the first probability distribution information and the second probability distribution information, can be found in [reference needed]. Figure 1 S105 in the embodiment will not be described in detail here.

[0123] In one possible implementation, the electronic device can obtain fused features by stitching together the first image features, the second image features, and the third image features.

[0124] Next, combined Figure 3 and Figure 4 Examples are given to illustrate the network structure of two age recognition models.

[0125] For example, Figure 3 Let's take as an example a first convolutional layer consisting of three convolutions, a first sub-convolutional layer consisting of one convolution, and a second sub-convolutional layer consisting of convolution, depthwise convolution, pointwise convolution, and two fully connected layers. Figure 3 This is a schematic diagram of the network structure of an age recognition model provided in an embodiment of this application, such as... Figure 3 As shown, the electronic device obtains the first image feature through convolution and / or segmentation. Then, the first image feature is processed through three branches. One branch performs feature extraction through three convolutions to obtain the second image feature; another branch does not perform any processing; the third branch includes two sub-branches. One sub-branch performs feature extraction through one convolution to obtain the fourth image feature, and the other sub-branch performs processing through convolution, depthwise convolution, pointwise convolution, and two fully connected layers to obtain the fifth image feature. Then, the fourth image feature and the fifth image feature are multiplied to obtain the third image feature. Finally, the electronic device concatenates the second image feature, the first image feature, and the third image feature to obtain the fused feature.

[0126] For example, Figure 4 Let's take the example of a first convolutional layer consisting of three convolutions, a first sub-convolutional layer consisting of wavelet pooling, and a second sub-convolutional layer consisting of wavelet pooling, depthwise convolution, and pointwise convolution. Figure 4 A schematic diagram of the network structure of another age recognition model provided in the embodiments of this application is shown below. Figure 4 As shown, the electronic device obtains the first image feature through convolution and / or segmentation. Then, the first image feature is processed through three branches. One branch performs feature extraction through three ordinary convolutions to obtain the second image feature; another branch does not perform any processing; the third branch includes two sub-branches. One sub-branch performs feature extraction through wavelet pooling to obtain the fourth image feature, and the other sub-branch performs wavelet pooling, depthwise convolution, and pointwise convolution to obtain the fifth image feature. Then, the fourth image feature and the fifth image feature are multiplied to obtain the third image feature. Finally, the electronic device concatenates the second image feature, the first image feature, and the third image feature to obtain the fused feature.

[0127] In this embodiment, depthwise convolution, pointwise convolution, and two fully connected layers constitute a channel attention mechanism. This mechanism can acquire attention weights, which can be multiplied with the image features of the corresponding channels. This allows the age recognition model to focus on channel information that is more critical to age recognition (such as facial wrinkles, skin color, and other age-related feature channels) when extracting features, thereby improving the utilization rate and recognition accuracy of effective features. In addition, it can also suppress interference from irrelevant or secondary channels when extracting features, enabling the age recognition model to better cope with complex scenarios such as noise, environmental interference, and occlusion, thereby improving the robustness of the age recognition model.

[0128] In this embodiment of the application, feature extraction is performed by depthwise convolution and pointwise convolution, which can reduce computational costs and retain more feature details, thereby improving the accuracy of age recognition model in identifying age and its adaptability to complex scenarios.

[0129] In this embodiment, feature extraction using wavelet pooling can decompose the first image features into different frequency components. This multi-scale feature decoupling can reduce the dimensionality of the first image features and reduce the loss of details in the pooling process. It can capture age-related fine-grained features, thereby enabling the age recognition model to effectively extract key image features related to age in complex scenes (such as changes in lighting, partial occlusion, etc.), thus improving the robustness and fine-grained recognition capability of the age recognition model in complex scenes.

[0130] Based on any of the above embodiments, the following, in conjunction with Figure 5 Method for determining the first probability distribution information corresponding to the sample image ( Figure 1 S104 in the embodiments will be described in detail.

[0131] For example, Figure 5 For a detailed flowchart illustrating the method for determining the first probability distribution information provided in this application embodiment, please refer to [link / reference needed]. Figure 5 The method may include:

[0132] S501. Determine the probability distribution function corresponding to the age information based on the first age and the second parameter.

[0133] In one possible implementation, the probability distribution function corresponding to the age information determined by the electronic device can be expressed as:

[0134]

[0135] Where σ is the second parameter, a is the first age, x can be multiple second ages, and exp is an exponential function.

[0136] S502. Determine the first probability distribution information based on the probability distribution function and multiple second ages.

[0137] In some embodiments, the electronic device may determine the age difference between each second age and the first age and a third parameter; determine multiple weights corresponding to multiple second ages based on multiple age differences; and determine first probability distribution information based on multiple weights, multiple age differences, the third parameter, multiple second ages, and a probability distribution function.

[0138] In one possible implementation, the age difference between each second age and the first age can be expressed as:

[0139] d=xa

[0140] Where x is the second age and a is the first age.

[0141] In one possible implementation, the third parameter is used to control the range of multiple second ages. The third parameter can be preset. For example, if the first age is 10 years old and the third parameter is 3, then the number of multiple second ages can be 6 (2x3). The multiple second ages can be 7 years old, 8 years old, 9 years old, 11 years old, 12 years old, and 13 years old.

[0142] In one possible implementation, the weights corresponding to the multiple second ages determined by the electronic device can be represented as:

[0143] w(d) = r d

[0144] Where r is the attenuation coefficient, and the value range of r is (0,1).

[0145] In one possible implementation, the electronic device can determine the first probability distribution information based on the probability distribution function P(x; a) and multiple second ages.

[0146] In another possible implementation, the electronic device can update the probability distribution function based on multiple weights, multiple age differences, and a third parameter, and then determine the first probability distribution information based on the probability distribution function and multiple second ages.

[0147] The updated probability distribution function determined by the electronic device can be expressed as:

[0148]

[0149] Where z is the third parameter, and |d| is the absolute value of d.

[0150] The age range is [0, A]. max Furthermore, considering the correlation among all ages as an example, the electronic device's determination of the first probability distribution information based on the probability distribution function and multiple second ages can be expressed as follows:

[0151]

[0152] In this embodiment, by obtaining the Gaussian distribution around the first age, the probabilities corresponding to different second ages are obtained, enabling the age recognition model to learn a smoother and more generalizable decision boundary, thereby enhancing the generalization ability and robustness of the age recognition model. In addition, by assigning different weights to different ages, the correlation between adjacent ages is taken into account, enabling the age recognition model to better capture the continuity of age during learning, thereby improving the ability of the age recognition model to distinguish between similar ages and improving the accuracy of age recognition.

[0153] Based on any of the above embodiments, after training the age recognition model, the electronic device can detect the age of a face in a face image using the age recognition model. Below, in conjunction with... Figure 6 This paper provides a detailed explanation of the method for determining the age of a face based on an age recognition model.

[0154] Figure 6 A flowchart illustrating a method for determining the age of a face based on an age recognition model, provided in this application embodiment, can be found here. Figure 6 The method may include:

[0155] S601. Obtain the first image, which includes the target object.

[0156] The target object can be a human face.

[0157] In one possible implementation, the electronic device can receive images sent by other electronic devices. After receiving the image, the electronic device can use a detection algorithm (e.g., the YOLO (You Only Look Once) algorithm) to perform face recognition on the image to obtain the region where the face image is located, and crop the image of that region as a new image, and use this new image as the first image.

[0158] In another possible implementation, the electronic device can receive video stream data sent by other electronic devices. After receiving the video stream data, the electronic device can perform decoding, contrast enhancement, shot segmentation, brightness adjustment, and storage on the video stream data. The video stream data sent by other electronic devices can be acquired by those devices through a camera.

[0159] During the process of other electronic devices sending video stream data to other electronic devices, the other electronic devices can perform preprocessing such as compression and encoding conversion on the video stream data to improve the efficiency of sending video stream data and the efficiency of receiving and storing video stream data.

[0160] After receiving the video stream data, the electronic device can also detect the differences between consecutive frames in the video stream data through methods such as inter-frame difference technology, single Gaussian model, Gaussian mixture model or visual background extractor (ViBE).

[0161] If the current frame is detected to contain a moving object compared to the previous frame or several previous frames, a face recognition algorithm is used to obtain the region where the face image is located. This region is then cropped into a new image, which is used as the first image. Steps S602-S603 are then executed. If the current frame is detected to not contain a moving object compared to the previous frame or several previous frames, step S601 is executed. It's important to understand that step S601 is executed if no face is detected during face recognition of the current frame.

[0162] Based on this, since the algorithm for detecting differences between consecutive frames in video stream data is simple, has low computational complexity, consumes few resources, and has a fast processing speed, and only performs age recognition when a dynamic object is detected in the current frame, it can effectively reduce computing resources, improve processing speed, and enable the operating system to run efficiently.

[0163] S602. Process the first image according to the age recognition model to obtain the probability distribution information corresponding to the first image.

[0164] In one possible implementation, the electronic device can input the first image into the age recognition model to obtain the probability distribution information corresponding to the first image. The probability distribution information corresponding to the first image includes multiple ages predicted by the age recognition model and the probability corresponding to each age.

[0165] S603. Determine the age of the target object based on the probability distribution information corresponding to the first image.

[0166] In one possible implementation, the electronic device can determine the age of the target object as the age corresponding to the maximum probability.

[0167] In the embodiments of this application, during the process of age recognition of the first image by the electronic device, computing resources can be dynamically adjusted to handle large amounts of data and complex tasks. It can provide strong data storage, processing and analysis capabilities to process image and video data. It can provide automated tools and platforms to simplify the deployment and updating process of age recognition models and reduce operating costs to avoid maintaining expensive hardware and software.

[0168] Figure 7 This is a schematic diagram of the structure of an age recognition model training device provided in an embodiment of this application. Please refer to... Figure 7 The age recognition model training device 70 includes: an acquisition module 71, a first determination module 72, a second determination module 73, a third determination module 74, and a training module 75, wherein:

[0169] The acquisition module 71 is used to acquire a sample image, a first age corresponding to an object in the sample image, and multiple second ages adjacent to the first age;

[0170] The first determining module 72 is used to determine the age range corresponding to the first age and the first parameter corresponding to the age range. The first parameter is used to adjust the distribution width of the age range.

[0171] The second determining module 73 is used to determine the second parameter based on the age group and the first parameter. The second parameter is used to control the standard deviation of the distribution width of the age group.

[0172] The third determining module 74 is used to determine the first probability distribution information corresponding to the sample image based on the first age, multiple second ages and second parameters. The first probability distribution information is used to indicate the probability that the age of the object is each of the second ages.

[0173] Training module 75 is used to train the age recognition model based on the first probability distribution information and sample images.

[0174] The age recognition model training device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0175] In one possible implementation, the training module 75 is specifically used for:

[0176] Obtain the first image feature of the sample image;

[0177] The first image features are obtained by convolving the first image features with the first convolutional layer;

[0178] The third image feature is obtained by convolving the first image feature with the second convolutional layer.

[0179] The age recognition model is trained based on the first image features, the second image features, the third image features, and the first probability distribution information.

[0180] In one possible implementation, the training module 75 is further configured to:

[0181] The first image features, the second image features, and the third image features are fused to obtain the fused features;

[0182] Based on the fusion characteristics, determine the second probability distribution information;

[0183] The age recognition model is trained based on the first probability distribution information and the second probability distribution information.

[0184] In one possible implementation, the training module 75 is further configured to:

[0185] The first image features are processed by the first sub-convolutional layer to obtain the fourth image features;

[0186] The fourth image features are processed by the second sub-convolutional layer to obtain the fifth image features;

[0187] The fourth and fifth image features are fused to obtain the third image feature.

[0188] In one possible implementation, the third determining module 74 is specifically used for:

[0189] Based on the first age and the second parameter, determine the probability distribution function corresponding to the age information;

[0190] The first probability distribution information is determined based on the probability distribution function and multiple second ages.

[0191] In one possible implementation, the third determining module 74 is further configured to:

[0192] Determine the age difference between each second age and the first age, and a third parameter. The third parameter is used to control the range of multiple second ages.

[0193] Based on multiple age differences, determine multiple weights corresponding to multiple second ages;

[0194] The first probability distribution information is determined based on multiple weights, multiple age differences, a third parameter, multiple second ages, and a probability distribution function.

[0195] In one possible implementation, the age recognition model training device 70 further includes: a fourth determining module 76, the fourth determining module 76 being used for:

[0196] Obtain the first image, which includes the target object;

[0197] The first image is processed according to the age recognition model to obtain the probability distribution information corresponding to the first image;

[0198] The age of the target object is determined based on the probability distribution information corresponding to the first image.

[0199] The age recognition model training device provided in this application embodiment can execute the technical solution shown in the above method embodiment. Its implementation principle and beneficial effects are similar, and will not be described again here.

[0200] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Figure 8 As shown, the electronic device 80 may include: a transceiver 81, a processor 82, and a memory 83.

[0201] Processor 82 executes computer execution instructions stored in memory, causing processor 82 to perform the scheme in the above embodiments. Processor 82 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0202] The memory 83 is connected to the processor 82 via the system bus and completes communication between them. The memory 83 is used to store computer program instructions.

[0203] Transceiver 81 can be used to obtain the task to be run and its configuration information.

[0204] The system bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. For ease of representation, only one thick line is used in the diagram, but this does not indicate that there is only one bus or one type of bus. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0205] The electronic device provided in this application embodiment can be any device with on-device computing capabilities. For example, the electronic device can be a server, computer, or other such device, and this application embodiment does not limit this.

[0206] This application also provides a chip for executing instructions, which is used to execute the technical solution of the age recognition model training method in the above embodiments.

[0207] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the age recognition model training method described in the above embodiments.

[0208] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0209] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0210] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0211] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0212] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as execution by a hardware processor, or execution by a combination of hardware and software modules within the processor.

[0213] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0214] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.

[0215] The aforementioned storage medium can be implemented from any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0216] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0217] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for training an age recognition model, characterized in that, The method includes: Obtain a sample image, a first age corresponding to an object in the sample image, and a plurality of second ages adjacent to the first age; Determine the age range corresponding to the first age and the first parameter corresponding to the age range, wherein the first parameter is used to adjust the distribution width of the age range; Based on the age group and the first parameter, a second parameter is determined, which is used to control the standard deviation of the distribution width of the age group; Based on the first age, the plurality of second ages, and the second parameter, a first probability distribution information corresponding to the sample image is determined. The first probability distribution information is used to indicate the probability that the object's age is each of the second ages and the probability that the object's age is the first age. The age recognition model is trained based on the first probability distribution information and the sample image.

2. The method according to claim 1, characterized in that, The age recognition model includes a first convolutional layer and a second convolutional layer; training the age recognition model based on the first probability distribution information and the sample image includes: Obtain the first image feature of the sample image; The first image features are convolved using the first convolutional layer to obtain the second image features; The first image features are convolved using the second convolutional layer to obtain the third image features; The age recognition model is trained based on the first image features, the second image features, the third image features, and the first probability distribution information.

3. The method according to claim 2, characterized in that, The step of training the age recognition model based on the first image features, the second image features, the third image features, and the first probability distribution information includes: The first image feature, the second image feature, and the third image feature are fused to obtain the fused feature; Based on the fusion features, determine the second probability distribution information; The age recognition model is trained based on the first probability distribution information and the second probability distribution information.

4. The method according to claim 2, characterized in that, The second convolutional layer includes a first sub-convolutional layer and a second sub-convolutional layer; the step of performing convolution processing on the first image features according to the second convolutional layer to obtain the third image features includes: The first image features are processed by the first sub-convolutional layer to obtain the fourth image features; The fourth image feature is processed by the second sub-convolutional layer to obtain the fifth image feature; The fourth image feature and the fifth image feature are fused together to obtain the third image feature.

5. The method according to any one of claims 1-4, characterized in that, The step of determining the first probability distribution information corresponding to the sample image based on the first age, the plurality of second ages, and the second parameter includes: Based on the first age and the second parameter, determine the probability distribution function corresponding to the age information; The first probability distribution information is determined based on the probability distribution function and the plurality of second ages.

6. The method according to claim 5, characterized in that, The step of determining the first probability distribution information based on the probability distribution function and the plurality of second ages includes: Determine the age difference between each second age and the first age, and a third parameter, wherein the third parameter is used to control the range of multiple second ages; Based on multiple age differences, determine multiple weights corresponding to the multiple second ages; The first probability distribution information is determined based on the multiple weights, the multiple age differences, the third parameter, the multiple second ages, and the probability distribution function.

7. The method according to any one of claims 1-4, characterized in that, After training the age recognition model, the method further includes: Acquire a first image, the first image including the target object; The first image is processed according to the age recognition model to obtain the probability distribution information corresponding to the first image; The age of the target object is determined based on the probability distribution information corresponding to the first image.

8. An age recognition model training device, characterized in that, include: The module comprises an acquisition module, a first determination module, a second determination module, a third determination module, and a training module, wherein: The acquisition module is used to acquire a sample image, a first age corresponding to an object in the sample image, and a plurality of second ages adjacent to the first age; The first determining module is used to determine the age range corresponding to the first age and the first parameter corresponding to the age range, wherein the first parameter is used to adjust the distribution width of the age range; The second determining module is used to determine a second parameter based on the age group and the first parameter, wherein the second parameter is used to control the standard deviation of the distribution width of the age group; The third determining module is used to determine the first probability distribution information corresponding to the sample image based on the first age, the plurality of second ages and the second parameter, wherein the first probability distribution information is used to indicate the probability that the object's age is each of the second ages; The training module is used to train the age recognition model based on the first probability distribution information and the sample image.

9. An electronic device, comprising: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the age recognition model training method as described in any one of claims 1 to 7.