Multi-scale feature fusion face age estimation method guided by auxiliary attributes
By combining a multi-scale feature extraction and enhancement module with an adaptive weighting module, this method solves the problems of fine-grained feature capture and cross-domain robustness in face age estimation, achieving higher accuracy and stability in age prediction, and is applicable to medical diagnosis, public safety, and intelligent services.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-27
AI Technical Summary
Existing facial age estimation methods struggle to accurately capture fine-grained aging features such as skin texture and wrinkles. Single-scale feature extraction cannot effectively balance global semantic information with local details. In multi-task joint learning, auxiliary attributes exhibit significant heterogeneity across different age ranges, resulting in limited model prediction accuracy and poor robustness in cross-domain scenarios.
A multi-scale feature extraction module is used to obtain features at different levels. Combined with a feature enhancement module, deformable convolution and channel attention are used to focus on fine-grained features. The sub-age estimation branch combining gender and population attributes and an adaptive weight module dynamically adapt to the influence of auxiliary attributes. A progressive fusion strategy and a multi-dimensional joint loss function are used to optimize the model.
It improves the accuracy of age estimation and the stability of the model in complex cross-domain scenarios, making it suitable for practical applications such as medical diagnosis, public safety, and intelligent services.
Smart Images

Figure CN121747170A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to a multi-scale feature fusion facial age estimation method guided by auxiliary attributes. Background Technology
[0002] As a core research direction in the field of computer vision, facial age estimation has been deeply integrated into key areas such as medical diagnosis, public safety, and intelligent services. Its prediction accuracy and robustness directly determine the reliability of related applications, such as assisting in the formulation of personalized medical plans, realizing cross-age identity verification, and optimizing personalized service recommendations. Therefore, continuously improving the performance of age estimation models has important practical application value.
[0003] Current methods for facial age estimation mainly fall into two categories: one is independent regression or classification methods, which establish a direct mapping between facial images and age labels through end-to-end modeling, relying on general backbone networks such as ResNet and VGG to extract features. Some methods treat age as a probability distribution or use local texture features for prediction. The other is multi-task joint learning methods, which combine age estimation with the prediction of auxiliary attributes such as gender and race by sharing low-level features, thereby improving estimation performance by leveraging the correlation between attributes and age. Meanwhile, to address the problem of insufficient feature discrimination, some studies have attempted to optimize feature extraction through local feature enhancement and fixed receptive field convolution, but these are mostly designed for general facial representations or specific needs.
[0004] However, existing methods still have significant drawbacks: general backbone networks struggle to accurately capture fine-grained aging features such as skin texture and wrinkles; single-scale feature extraction cannot effectively balance global semantic information with local details; in multi-task joint learning, the influence of auxiliary attributes on aging representation varies significantly across different age ranges; fixed weight allocation can easily introduce noise in attribute-independent regions or weaken key constraints in attribute-sensitive regions; and the fixed receptive field of traditional convolution leads to insufficient attention to local aging details. These problems collectively result in limited model prediction accuracy and poor robustness in cross-domain scenarios, which urgently require targeted solutions. Summary of the Invention
[0005] To address the problems existing in the background art, one aspect of the present invention provides an auxiliary attribute-guided multi-scale feature fusion face age estimation method, comprising:
[0006] S1: Obtain the original face image dataset and preprocess it; the original face image dataset includes: original face images, age labels corresponding to the original face images, and attribute labels corresponding to the original face images; the attribute labels include gender labels and population labels;
[0007] S2: Input the original face image into the multi-scale feature extraction module to extract features and obtain multi-scale features;
[0008] S3: Enhance the features at each scale separately through the feature enhancement module to obtain multi-scale enhanced features;
[0009] S4: A multi-scale feature fusion module is used to progressively fuse multi-scale enhanced features from large scale to small scale to obtain fused features;
[0010] S5: For each combination of gender and population attributes, construct multiple sub-age estimation branches. Each sub-age estimation branch performs initial age prediction and attribute association difference prediction based on the fusion features.
[0011] S6: Based on the fusion features, perform attribute classification probability prediction through the adaptive weight module, and calculate the dynamic weights of each sub-age estimation branch based on the attribute association difference prediction results;
[0012] S7: The initial age prediction results of each sub-age estimation branch are weighted and fused according to the dynamic weights of each sub-age estimation branch to obtain the age prediction result of the original face image.
[0013] S8: Construct a joint loss function based on the age label corresponding to the original image, the attribute label corresponding to the original face image, the age prediction result of the original face image, and the attribute classification probability prediction result to iteratively optimize the age estimation model and obtain the trained age estimation model. The age estimation model is used to execute steps S2 to S7 on the face image to be tested to obtain the age prediction result of the face image to be tested.
[0014] Another aspect of the present invention provides an auxiliary attribute-guided multi-scale feature fusion facial age estimation system, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the auxiliary attribute-guided multi-scale feature fusion facial age estimation method.
[0015] Another aspect of the present invention provides a computer storage medium storing a remote monitoring program, which, when executed by a processor, implements the aforementioned auxiliary attribute-guided multi-scale feature fusion face age estimation method.
[0016] The present invention has at least the following beneficial effects
[0017] This invention acquires multi-scale features covering different levels through a multi-scale feature extraction module, and combines it with a feature enhancement module to focus on age-related fine-grained features and suppress irrelevant noise using deformable convolution and channel attention. A progressive fusion strategy from large to small is adopted to enhance feature discriminativeness. Furthermore, a sub-age estimation branch combining gender and population attributes and an adaptive weight module dynamically adapt to the heterogeneous influence of auxiliary attributes in different age ranges. Combined with a multi-dimensional joint loss function to comprehensively optimize the model, this invention not only effectively improves the accuracy of age estimation but also enhances the model's stability in complex cross-domain scenarios, making it better suited for various practical application scenarios such as medical diagnosis, public safety, and intelligent services. It has good practical value and economic benefits. Attached Figure Description
[0018] Figure 1 This is a schematic diagram of the method flow of the present invention;
[0019] Figure 2 This is a schematic diagram of the overall structure of the age estimation model of the present invention;
[0020] Figure 3 The schematic diagram of the multi-scale feature extraction module of the present invention is as follows;
[0021] Figure 4 This is a schematic diagram of the feature enhancement module structure of the present invention;
[0022] Figure 5 Schematic diagram of the multi-scale feature fusion module structure of the present invention;
[0023] Figure 6 This is a schematic diagram of the adaptive weight module structure of the present invention;
[0024] Figure 7 This is a schematic diagram illustrating the fusion of the initial age prediction results of the present invention;
[0025] Figure 8 This is a schematic diagram illustrating the recognition effect of the age estimation system of the present invention. Detailed Implementation
[0026] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0027] Please see Figure 1and Figure 2 One aspect of the present invention provides a multi-scale feature fusion face age estimation method guided by auxiliary attributes, comprising:
[0028] S1: Obtain the original face image dataset and preprocess it; the original face image dataset includes: original face images, age labels corresponding to the original face images, and attribute labels corresponding to the original face images; the attribute labels include gender labels and population labels;
[0029] Preferably, the preprocessing of the original face image dataset includes performing data augmentation operations such as random cropping, normalization, color dithering, flipping, and rotation on the original face images.
[0030] In this embodiment, the first step is to acquire the original face image dataset. Key sources include publicly available face age datasets (such as the IMDB-WIKI dataset after MTCNN detection, containing over 500,000 face images covering ages 1-100, encompassing children, youth, middle-aged, and elderly, and including different populations such as Asians, Europeans, and Africans). Each image is then labeled: age labels use numerical values accurate to the year; gender labels are divided into "male" and "female," verified automatically through a combination of manual labeling and facial feature analysis; population labels are categorized by region and ethnicity into four types: "Asian," "European," "African," and "American," ensuring label consistency. The specific operations in the preprocessing stage are as follows: ① Random cropping: From the original 640×480 pixel image, a 224×224 pixel face region is randomly cropped based on the center of the face to remove background redundancy; ② Normalization: The RGB pixel values of the image are mapped from [0,255] to the [-1,1] range to eliminate pixel scale differences caused by different devices; ③ Color jittering: The image brightness, contrast ±10%, and saturation ±15% are randomly adjusted to simulate different lighting environments in a shopping mall (such as spotlights and natural light); ④ Flipping: 30% of the image is horizontally flipped to maintain the symmetry of the face structure; ⑤ Rotation: The image is randomly rotated within the range of -10° to 10° to adapt to natural postures such as customers' side profiles and heads tilted down. These preprocessing operations not only optimize data quality and remove irrelevant interference information, but also expand the effective sample size through data augmentation, enhancing the generalization ability of the data.
[0031] Please see Figure 3 S2: Input the original face image into the multi-scale feature extraction module to extract features and obtain multi-scale features;
[0032] Preferably, the multi-scale feature extraction module uses a ResNet18 network with the fully connected layers removed to extract intermediate features at scales of 56×56, 28×28, 14×14, and 7×7. Starting from the first-level features, a 3×3 convolutional kernel with a stride of 2 is used to downsample the large-scale feature map. A 1×1 convolution is used to adjust the channel dimension to match the deep features. The dimension-aligned feature maps are added and fused element by element. The process is iterated until the feature map is fused with the last-level feature to obtain multi-scale features that cover different levels and scales.
[0033] In this embodiment, ResNet18 with the last two fully connected layers removed is selected as the backbone network, while its convolutional and pooling layer structures are retained to adapt to the multi-scale feature extraction requirements. After inputting a preprocessed face image into the network, multi-scale features are obtained according to the following process: ① The image is first processed by a 7×7 convolutional layer (stride 2) and a 3×3 max pooling layer (stride 2), outputting a first-level feature map with 64 channels and a scale of 56×56 (corresponding to the Layer 1 output of ResNet18, focusing on capturing shallow details such as facial skin texture and eyebrow contour); ② After processing by Layer 2 (containing 2 residual blocks), a second-level feature map with 128 channels and a scale of 28×28 is output (focusing on mid-level features such as facial feature layout); ③ After processing by Layer 3 (containing 2 residual blocks), a third-level feature map with 256 channels and a scale of 14×14 is output (containing deep features such as semantic association of facial regions); ④ After processing by Layer 4 (containing 2 residual blocks), a fourth-level feature map with 512 channels and a scale of 7×7 is output (focusing on overall facial semantic information, such as facial contour style).
[0034] The feature fusion process then begins: starting with the first-level 56×56 feature map, it is downsampled to 28×28 using a 3×3 convolution kernel with a stride of 2. Simultaneously, the number of channels is adjusted from 64 to 128 using a 1×1 convolution (to match the channel dimension of the second-level feature map). The dimension-aligned feature map is then fused element-wise with the second-level 28×28 feature map to obtain the first-level scale features. Next, the above operation is repeated on the fused 28×28 feature map, downsampled to 14×14, and the number of channels is adjusted to 256. This is then added to the third-level 14×14 feature map to obtain the second-level scale features. Finally, the fused features are downsampled to 7×7, the number of channels is adjusted to 512, and this is added to the fourth-level 7×7 feature map to obtain the third-level scale features. Ultimately, a multi-scale fused feature covering shallow details, mid-level layout, and deep semantics is obtained, providing a comprehensive feature foundation for subsequent feature enhancement.
[0035] Please see Figure 4 S3: Enhance the features at each scale separately through the feature enhancement module to obtain multi-scale enhanced features;
[0036] Preferably, the enhancement processing of features at each scale through the feature enhancement module includes:
[0037] S31: Spatial feature smoothing is performed on the features at each scale through 1×1 pointwise convolution, and then the output features of 1×1 pointwise convolution are processed through 3×3 deformable convolutional layers to focus on fine-grained aging features.
[0038] S32: The output features of the 3×3 deformable convolutional layer are sequentially passed through a global average pooling layer, a first fully connected layer, a first sigmoid function, and a second fully connected layer to generate the first weight matrix.
[0039] S33: The output features of the 3×3 deformable convolutional layer are sequentially passed through a global average pooling layer, a third fully connected layer, a second sigmoid function, and a fourth fully connected layer to generate a second weight matrix;
[0040] S34: Add the features of the first weight matrix and the second weight matrix to obtain the comprehensive weight matrix. Multiply the features of each scale with their corresponding comprehensive weight matrix to obtain the multi-scale enhanced features.
[0041] In this embodiment, the 28×28×128, 14×14×256, and 7×7×512 scale features extracted in step S2 are enhanced one by one through the feature enhancement module. The core is to strengthen age-related fine-grained features and suppress irrelevant noise. The specific execution is as follows:
[0042] Taking a shallow detail feature of 28×28×128 as an example: ① First, spatial smoothing is performed on the feature using a 1×1 pointwise convolution (128 output channels, ReLU activation function) to eliminate high-frequency artifacts caused by the superposition of features in different regions, making the texture features more coherent; ② Input a 3×3 deformable convolutional layer (stride 1, padding 1, 128 output channels). This layer learns the offset vector and dynamically adjusts the sampling point position to accurately focus on fine-grained structures strongly related to age, such as fine lines around the eyes and skin pores, thus strengthening the expression of aging features; ③ Generate the first weight matrix: The deformable convolutional output features are subjected to global average pooling (output dimension 128), and then sequentially passed through the first fully connected layer (1 28→512, ReLU activation), first Sigmoid function, second fully connected layer (512→128), to obtain a 128-dimensional first weight matrix; ④ Generate the second weight matrix: using a parallel structure, the same output feature is global average pooled, and then passed through the third fully connected layer (128→512, ReLU activation), the second Sigmoid function, and the fourth fully connected layer (512→128) to obtain a 128-dimensional second weight matrix; ⑤ The two weight matrices are added element by element to obtain a comprehensive weight matrix (128-dimensional), and then multiplied by the original 28×28×128 feature map by channel dimension to output the 28×28×128 enhanced feature.
[0043] For 14×14×256 (deep semantic association features) and 7×7×512 (overall contour features), the same process is used but the number of channels is adapted: the output channel number of 1×1 convolution and deformable convolution is matched with the original channel number (256, 512) at each scale, and the dimension of the fully connected layer is adjusted to "channel number → 512 → channel number" to ensure that the weight matrix is consistent with the channel dimension of the feature map. For example, after processing, the 14×14×256 feature outputs a 14×14×256 enhanced feature, which focuses on strengthening age-related features such as facial proportions (e.g., distance between eyes, depth of nasolabial folds); the 7×7×512 feature, through enhancement, highlights the age-relatedness of the overall facial contour (e.g., contour changes caused by facial sagging in the elderly).
[0044] Finally, step S3 outputs enhanced features at three scales (28×28×128, 14×14×256, and 7×7×512), which not only retain the core information at each scale, but also make the features more age-discriminative through fine-grained focusing and noise suppression, laying the foundation for subsequent multi-scale fusion.
[0045] Please see Figure 5 S4: A multi-scale feature fusion module is used to progressively fuse multi-scale enhanced features from large scale to small scale to obtain fused features;
[0046] Preferably, the progressive fusion of multi-scale enhancement features from large to small scale includes: starting from the first layer enhancement feature with the largest scale, downsampling it with a 3×3 convolution kernel with a stride of 2, adding the sampling result element-wise with the next layer enhancement feature to obtain an intermediate fused feature, downsampling the intermediate fused feature with a 3×3 convolution kernel with a stride of 2, adding the sampling result element-wise with the next layer enhancement feature, repeating the downsampling and addition operations until it is fused with the last layer enhancement feature to obtain the fused feature.
[0047] In this embodiment, a progressive fusion process, "from large scale to small scale," is performed through a multi-scale feature fusion module. The core of this process is to integrate detailed features and semantic information from each scale to generate more discriminative fused features. The specific execution is as follows:
[0048] The first stage of fusion (combining mid-level layout and deep semantics): Starting with the maximum scale 28×28×128 enhanced features (focusing on age-related mid-level features such as facial feature layout and nasolabial fold depth), a 3×3 convolutional layer (stride 2, padding 1, output channel number 256) is used to downsample it—compressing the spatial scale from 28×28 to 14×14, while adjusting the number of channels from 128 to 256, perfectly matching the dimensions of the next layer 14×14×256 enhanced features (focusing on deep features such as semantic association of facial regions and association of key aging regions); then the downsampled 14×14×256 features are added element-wise with the original 14×14×256 enhanced features to obtain the first stage intermediate fusion feature (14×14×256). This feature retains mid-level details such as facial feature proportions at the 28×28 scale, and incorporates semantic association information at the 14×14 scale, strengthening the hierarchical complementarity of aging features.
[0049] The second stage of fusion (final feature integration): The intermediate fusion feature (14×14×256) from the first stage is downsampled and fused for the last time. A 3×3 convolutional layer (stride 2, padding 1, output channel number 512) is used to downsample it to 7×7, and the number of channels is adjusted to 512 to align with the dimensions of the minimum scale 7×7×512 enhanced feature (focusing on global semantic features such as overall facial contour and relaxation). The two are added element by element, and a non-linear transformation is introduced through the ReLU activation function to further enhance the feature expression capability, and finally output the fusion feature of 7×7×512.
[0050] The entire fusion process employs a progressive design of "downsampling - dimensional alignment - element-by-element addition," avoiding information redundancy from directly splicing features of different scales. This allows the mid-level layout details of large-scale features to progressively complement the deep semantics and global contours of small-scale features. The resulting fused features include both mid-level details strongly correlated with age, such as nasolabial fold depth and facial proportions, and global information such as facial semantic relationships and overall contour changes. This provides efficient and comprehensive feature support for the accurate prediction of subsequent sub-age estimation branches.
[0051] S5: For each combination of gender and population attributes, construct multiple sub-age estimation branches. Each sub-age estimation branch performs initial age prediction and attribute association difference prediction based on the fusion features.
[0052] Preferably, the number of sub-age estimation branches is: indivual, The age estimation branch is designed using a multilayer perceptron to output an initial age prediction based on the fused features, where the number of categories represents the population attributes. The attribute association prediction difference includes the gender association difference. Association difference with the population , By The individual age estimation branch is divided into male association group and female association group. The absolute value of the difference between the mean of the initial age prediction results in the group is obtained. By Individual age estimation branch is divided into: For each group of individuals, the mean of the initial age prediction results is calculated, and then the absolute value of the difference between pairs of groups is taken. Finally, the mean of the difference vector obtained by taking the absolute value of the difference between all pairs of groups is taken.
[0053] In this embodiment, a specific sub-age estimation branch is constructed based on the combination of gender and population attributes. The correlation between attributes and aging patterns is used to improve the targeting of the initial prediction. The specific execution is as follows:
[0054] Based on the label settings of the scene dataset, the gender attribute is divided into two categories: "male" and "female". The population attribute is divided into four categories: "Asian", "European", "African" and "American". The Cartesian product of the two forms eight attribute combinations (Asian-male, Asian-female, European-male, European-female, African-male, African-female, American-male, American-female), corresponding to eight sub-age estimation branches, each branch is specifically adapted to the age prediction needs of a certain type of attribute combination.
[0055] All sub-age estimation branches employ a unified architecture Multilayer Perceptron (MLP), with the input being the 7×7×512 fused features output from step S4. First, the 7×7×512 feature map is transformed into a 512-dimensional one-dimensional vector through global average pooling, and then passed through three fully connected layers in sequence: the first layer (512→512 nodes, ReLU activation function, Dropout probability 0.3 to prevent overfitting), the second layer (512→512 nodes, ReLU activation function), and the third layer (512→101 nodes, Softmax activation function), finally outputting a 101-dimensional probability distribution (corresponding to the predicted probability of each age from 0 to 100 years old).
[0056] The 7×7×512 fused features of the same sample are simultaneously input into 8 sub-branches, and each branch makes predictions based on its own adapted attribute combination characteristics. For example, the "Asian-female" branch focuses on learning the aging characteristics of Asian women (such as the evolution of fine lines around the eyes and the pattern of facial contour changes), and outputs the probability distribution of the sample belonging to each age from 0 to 100 years old; while the "European-male" branch focuses on the aging characteristics of European men (such as the rate of skin laxity and aging characteristics of the beard area), and generates an independent probability distribution.
[0057] The 101-dimensional probability distribution output by each sub-branch is the initial age prediction result of that branch. A total of 8 sets of initial prediction data are generated from the 8 sub-branches. Subsequently, through the dynamic weight calculation in step S6, the branch results that are more suitable for the current sample will be selected, providing a basis for the final weighted fusion.
[0058] This design subdivides branches by combining attributes, allowing each branch to focus on learning the aging patterns of a specific population. This avoids interference between the aging characteristics of different attribute combinations, improves the targeting and accuracy of the initial prediction, and lays a high-quality foundation for subsequent dynamic weighted fusion.
[0059] Gender-related differences calculate:
[0060] The first step is grouping: the 8 sub-branches are divided into two major association groups according to gender - the male association group (containing 4 branches: Asian-male, European-male, African-male, and American-male) and the female association group (containing 4 branches: Asian-female, European-female, African-female, and American-female).
[0061] The second step is to calculate the within-group mean: Assume that the initial age prediction results (taking the expected age values from the probability distribution) for a sample output from 8 branches are as follows: for the male association group, the results from the 4 branches are 32 years old, 33 years old, 31 years old, and 34 years old. The within-group mean is... Age; the results for the four branches of the female association group were 30, 29, 31, and 30 years old, with the intra-group mean being... age.
[0062] The third step is to take the absolute value of the difference: This value quantifies the difference between male and female groups in the prediction of aging characteristics in this sample.
[0063] population association difference calculate:
[0064] The first step is grouping: the 8 sub-branches are divided into n=4 population association groups according to the population: Asian group (Asian-male, Asian-female), European group (European-male, European-female), African group (African-male, African-female), and American group (American-male, American-female).
[0065] The second step is to calculate the within-group mean: Based on the branch prediction results of the above samples, calculate the mean for each population group: Asian population European group African groups American groups .
[0066] The third step is to calculate the absolute value of the pairwise difference: calculate all pairwise combinations of the mean of the 4 groups (6 groups in total) to obtain the difference vector: |31−31|=0 (Asia-Europe), |31−31|=0 (Asia-Africa), |31−32|=1 (Asia-America), |31−31|=0 (Europe-Africa), |31−32|=1 (Europe-America), |31−32|=1 (Africa-America), that is, the difference vector is [0,0,1,0,1,1].
[0067] Step 4: Take the average. This value quantifies the average difference in the prediction of aging characteristics among different population groups in this sample.
[0068] Please see Figure 6 S6: Based on the fusion features, the attribute classification probability is predicted through the adaptive weight module, and the dynamic weights of each sub-age estimation branch are calculated based on the attribute association difference prediction results.
[0069] Preferably, the adaptive weight module includes: a gender adaptive weight module and a population adaptive weight module; the gender adaptive weight module includes a gender attribute predictor and a gender fully connected mapping layer; the gender attribute predictor is used to output a gender classification probability based on the fused features; the gender fully connected mapping layer is used to map the gender association difference to obtain a gender factor; the population adaptive weight module includes a population attribute predictor and a population fully connected mapping layer; the population attribute predictor is used to output a population classification probability based on the fused features; the population fully connected mapping layer is used to map the population association difference to obtain a population factor; the gender attribute predictor and the population attribute predictor are designed based on fully connected layers;
[0070] The dynamic weights of each sub-age estimation branch include:
[0071]
[0072]
[0073]
[0074] in, Indicates gender and crowds The weight of the combined branches; Indicates gender factor; Indicates population factors; Indicates the number of categories in the population; This indicates that the gender attribute predictor outputs a gender classification as a category. The probability of; This indicates that the population classification output by the population attribute predictor is... The probability of.
[0075] In this embodiment, the adaptive weight module accurately predicts the attribute classification probability based on the fusion features output in step S4 (clarifying the probability distribution of the sample's gender and population attributes). It also dynamically generates the weights of each sub-age estimation branch by combining this key information. This approach gives higher weights to branches that match the actual attributes of the sample and have strong adaptability to aging features, while reasonably reducing the interference weights of branches with mismatched attributes. This effectively avoids the noise problem that is easily introduced by fixed weight allocation, achieves accurate adaptation between branch weights and sample attribute features, and significantly improves the relevance and reliability of subsequent age prediction results.
[0076] Please see Figure 7 S7: The initial age prediction results of each sub-age estimation branch are weighted and fused according to the dynamic weights of each sub-age estimation branch to obtain the age prediction result of the original face image.
[0077] In this embodiment, taking the above scenario as an example: ① Initial age prediction results of the 8 sub-branches (simplified display of expected age values in a 101-dimensional probability distribution, actually age-wise probabilities): Asian-male (32 years old, weight W1=0.32), Asian-female (30 years old, weight W2=0.28), European-male (33 years old, weight W3=0.07), European-female (29 years old, weight W4=0.06), African-male (31 years old, weight W5=0.05), African-female (31 years old, weight W6=0.04), American-male (34 years old, weight W7=0.03), American-female (30 years old, weight W8=0.15); ② The dynamic weights of each branch have been calculated in step S6, among which the branches with strong matching and adaptability to the actual attributes of the sample (Asian-female) have significantly higher weights.
[0078] Weighted fusion calculation: The calculation logic is to calculate each branch by multiplying the initial prediction result by the corresponding dynamic weight, and then summing all the results. The specific calculation process is as follows: (32×0.32)+(30×0.28)+(33×0.07)+(29×0.06)+(31×0.05)+(31×0.04)+(34×0.03)+(30×0.15)=10.24+8.4+2.31+1.74+1.55+1.24+1.02+4.5=31.0.
[0079] The final output is a weighted fusion result of 31.0 years, which is the predicted age for this sample. In practice, a 101-dimensional probability distribution is used for weighting (age probability × corresponding branch weight, then summing the probabilities of all ages × the weighted probability) to further improve accuracy. This example simplifies the calculation of expected age and clearly presents the core logic—allowing branches with strong adaptability and high weight (such as Asian-male, Asian-female) to dominate the final result, while reasonably incorporating effective information from other branches. This avoids the prediction bias of a single branch and weakens the interference of branches with mismatched attributes, ultimately resulting in a more accurate and robust age prediction.
[0080] S8: Construct a joint loss function based on the age label corresponding to the original image, the attribute label corresponding to the original face image, the age prediction result of the original face image, and the attribute classification probability prediction result to iteratively optimize the age estimation model and obtain the trained age estimation model. The age estimation model is used to execute steps S2 to S7 on the face image to be tested to obtain the age prediction result of the face image to be tested.
[0081] Preferably, the joint loss function includes:
[0082]
[0083]
[0084]
[0085]
[0086]
[0087]
[0088] in, Represents the joint loss function; Indicates the training batch size; The number of constraints formed by attribute combinations; Indicates the first The set of possible values for each attribute; Represents the Cartesian product; For the first Learnable weighted coefficients for combinations of attributes; and For hyperparameters; For the first The sample at the th Among the branches, the one that corresponds to the actual age is... The probability of; Indicates the total number of age categories; For the first The sample at the th Among the branches, the one belonging to the age category The probability of; The cross-entropy loss function represents the sub-age estimation branch; This represents the classification loss based on auxiliary attributes; Indicates the first The sample belongs to the first The probability of the true label for each auxiliary attribute; Indicates the first The sample belongs to the first The probability of each category; For the first The total number of categories for each auxiliary attribute; This indicates the loss in age prediction results; No. Age prediction results for each sample; No. The true label of each sample; Indicates deviation loss; For the first The sample at the th Among the branches, the one belonging to the age category The probability of.
[0089] In this embodiment, by integrating the age label, attribute label, age prediction result, and attribute classification probability prediction result of the original face image, a joint loss function is constructed, which includes cross-entropy loss of sub-age estimation branches, auxiliary attribute classification loss, SmoothL1 age prediction loss, and bias loss. This multi-dimensional constraint on the model training process strengthens the learning of the aging patterns of specific populations through sub-branch loss, optimizes the accuracy of attribute classification and association modeling through auxiliary attribute loss, makes the predicted age closer to the true value through Smooth L1 loss, and standardizes the rationality of the age probability distribution through bias loss, effectively avoiding the model bias problem caused by a single loss function. After multiple rounds of iterative optimization, the model can accurately capture the dynamic correlation between age and auxiliary attributes, fully leverage the advantages of multi-scale fusion features and dynamic weights, significantly improve the accuracy of age estimation and robustness across different scenarios, and the final trained model can stably adapt to practical application scenarios such as smart retail, efficiently outputting reliable age prediction results for the face image under test. The final prediction result is as follows: Figure 8 As shown.
[0090] Another aspect of the present invention provides an auxiliary attribute-guided multi-scale feature fusion facial age estimation system, the system comprising a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute the auxiliary attribute-guided multi-scale feature fusion facial age estimation method.
[0091] Another aspect of the present invention provides a computer storage medium storing a remote monitoring program, which, when executed by a processor, implements the aforementioned auxiliary attribute-guided multi-scale feature fusion face age estimation method.
[0092] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0093] In summary, this invention acquires multi-scale features covering different levels through a multi-scale feature extraction module, combines a feature enhancement module to focus on age-related fine-grained features and suppress irrelevant noise using deformable convolution and channel attention, and employs a progressive fusion strategy from large to small to enhance feature discriminativeness. Furthermore, it dynamically adapts to the heterogeneous influence of auxiliary attributes in different age ranges through a sub-age estimation branch combining gender and population attributes and an adaptive weight module, and comprehensively optimizes the model with a multi-dimensional joint loss function. This not only effectively improves the accuracy of age estimation but also enhances the model's stability in complex cross-domain scenarios, enabling it to better adapt to various practical application scenarios such as medical diagnosis, public safety, and intelligent services, demonstrating good practical value and economic benefits.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A multi-scale feature fusion facial age estimation method guided by auxiliary attributes, characterized in that, include: S1: Obtain the original face image dataset and preprocess the original face image dataset; The original face image dataset includes: original face images, age labels corresponding to the original face images, and attribute labels corresponding to the original face images; the attribute labels include gender labels and population labels; S2: Input the original face image into the multi-scale feature extraction module to extract features and obtain multi-scale features; S3: Enhance the features at each scale separately through the feature enhancement module to obtain multi-scale enhanced features; S4: A multi-scale feature fusion module is used to progressively fuse multi-scale enhanced features from large scale to small scale to obtain fused features; S5: For each combination of gender and population attributes, construct multiple sub-age estimation branches. Each sub-age estimation branch performs initial age prediction and attribute association difference prediction based on the fusion features. S6: Based on the fusion features, perform attribute classification probability prediction through the adaptive weight module, and calculate the dynamic weights of each sub-age estimation branch based on the attribute association difference prediction results; S7: The initial age prediction results of each sub-age estimation branch are weighted and fused according to the dynamic weights of each sub-age estimation branch to obtain the age prediction result of the original face image. S8: Construct a joint loss function based on the age label corresponding to the original image, the attribute label corresponding to the original face image, the age prediction result of the original face image, and the attribute classification probability prediction result to iteratively optimize the age estimation model and obtain the trained age estimation model. The age estimation model is used to execute steps S2 to S7 on the face image to be tested to obtain the age prediction result of the face image to be tested.
2. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 1, characterized in that, The preprocessing of the original face image dataset includes performing data augmentation operations such as random cropping, normalization, color jittering, flipping, and rotation on the original face images.
3. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 1, characterized in that, The multi-scale feature extraction module uses a ResNet18 network with the fully connected layers removed to extract intermediate features at scales of 56×56, 28×28, 14×14, and 7×7. Starting from the first-level features, a 3×3 convolutional kernel with a stride of 2 is used to downsample the large-scale feature map. A 1×1 convolution is used to adjust the channel dimension to match the deep features. The dimension-aligned feature maps are added and fused element by element. The process is iterated until the feature map is fused with the last-level feature, resulting in multi-scale features that cover different levels and scales.
4. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 1, characterized in that, The enhancement process for each scale's features via the feature enhancement module includes: S31: Spatial feature smoothing is performed on the features at each scale through 1×1 pointwise convolution, and then the output features of 1×1 pointwise convolution are processed through 3×3 deformable convolutional layers to focus on fine-grained aging features. S32: The output features of the 3×3 deformable convolutional layer are sequentially passed through a global average pooling layer, a first fully connected layer, a first sigmoid function, and a second fully connected layer to generate the first weight matrix. S33: The output features of the 3×3 deformable convolutional layer are sequentially passed through a global average pooling layer, a third fully connected layer, a second sigmoid function, and a fourth fully connected layer to generate a second weight matrix; S34: Add the features of the first weight matrix and the second weight matrix to obtain the comprehensive weight matrix. Multiply the features of each scale with their corresponding comprehensive weight matrix to obtain the multi-scale enhanced features.
5. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 1, characterized in that, The progressive fusion of multi-scale enhanced features from large to small scale includes: starting from the first layer of enhanced features with the largest scale, downsampling it with a 3×3 convolution kernel with a stride of 2, adding the sampling result element-wise with the next layer of enhanced features to obtain intermediate fused features, downsampling the intermediate fused features with a 3×3 convolution kernel with a stride of 2, adding the sampling result element-wise with the next layer of enhanced features, repeating the downsampling and addition operations until it is fused with the last layer of enhanced features to obtain the fused feature.
6. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 1, characterized in that, The number of sub-age estimation branches is: indivual, The age estimation branch is designed using a multilayer perceptron to output an initial age prediction based on the fused features, where the number of categories represents the population attributes. The attribute association prediction difference includes the gender association difference. Association difference with the population , By The individual age estimation branch is divided into male association group and female association group. The absolute value of the difference between the mean of the initial age prediction results in the group is obtained. By Individual age estimation branch is divided into: For each group of individuals, the mean of the initial age prediction results is calculated, and then the absolute value of the difference between pairs of groups is taken. Finally, the mean of the difference vector obtained by taking the absolute value of the difference between all pairs of groups is taken.
7. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 6, characterized in that, The adaptive weighting module includes a gender adaptive weighting module and a population adaptive weighting module. The gender adaptive weighting module includes a gender attribute predictor and a gender fully connected mapping layer. The gender attribute predictor outputs a gender classification probability based on the fused features. The gender fully connected mapping layer maps gender association differences to obtain a gender factor. The population adaptive weighting module includes a population attribute predictor and a population fully connected mapping layer. The population attribute predictor outputs a population classification probability based on the fused features. The population fully connected mapping layer maps population association differences to obtain a population factor. The gender attribute predictor and the population attribute predictor are designed based on fully connected layers. The dynamic weights of each sub-age estimation branch include: in, Indicates gender and crowds The weight of the combined branches; Indicates gender factor; Indicates population factors; Indicates the number of categories in the population; This indicates that the gender attribute predictor outputs a gender classification as a category. The probability of; This indicates that the population classification output by the population attribute predictor is... The probability of.
8. The method for estimating face age by multi-scale feature fusion guided by auxiliary attributes according to claim 1, characterized in that, The joint loss function includes: in, Represents the joint loss function; Indicates the training batch size; The number of constraints formed by attribute combinations; Indicates the first The set of possible values for each attribute; Represents the Cartesian product; For the first Learnable weighted coefficients for combinations of attributes; and For hyperparameters; For the first The sample at the th Among the branches, the one that corresponds to the actual age is... The probability of; Indicates the total number of age categories; For the first The sample at the th Among the branches, the one belonging to the age category The probability of; The cross-entropy loss function represents the sub-age estimation branch; This represents the classification loss based on auxiliary attributes; Indicates the first The sample belongs to the first The probability of the true label for each auxiliary attribute; Indicates the first The sample belongs to the first The probability of each category; For the first The total number of categories for each auxiliary attribute; This indicates the loss in age prediction results; No. Age prediction results for each sample; No. The true label of each sample; Indicates deviation loss; For the first The sample at the th Among the branches, the one belonging to the age category The probability of.
9. A multi-scale feature fusion facial age estimation system guided by auxiliary attributes, characterized in that, The system includes a memory and a processor; the memory is used to store an application program; the processor is used to run the application program and execute an auxiliary attribute-guided multi-scale feature fusion face age estimation method as described in any one of claims 1 to 8.
10. A computer storage medium, characterized in that, The computer storage medium stores a remote monitoring program, which, when executed by the processor, implements an auxiliary attribute-guided multi-scale feature fusion face age estimation method as described in any one of claims 1 to 8.