A method, system and device for light-weighted age prediction
By using the lightweight deep learning network EGA-ConvNeXt and the CORN loss function, the problem of deploying face age prediction methods on resource-constrained devices is solved, achieving efficient and stable age prediction and improving prediction accuracy and stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN TECH UNIV
- Filing Date
- 2026-04-13
- Publication Date
- 2026-06-12
AI Technical Summary
Existing face age prediction methods are difficult to deploy on resource-constrained devices, have high computational complexity, and fail to adequately model the sequential relationship of age labels, resulting in insufficient prediction accuracy and stability.
We employ a lightweight deep learning network, EGA-ConvNeXt, combined with Ghost convolution and ECA channel attention modules for feature extraction. We use the CORN loss function to model the order relationship between age labels and improve model performance through adaptive optimization algorithms and regularization.
While reducing the number of model parameters and computational complexity, it improves the accuracy and stability of face age prediction, is suitable for resource-constrained mobile terminals and embedded devices, and has good generalization ability and practicality.
Smart Images

Figure CN122200770A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of computer vision and artificial intelligence technology, and specifically relates to a lightweight method, system and device for predicting aging. Background Technology
[0002] Facial age prediction is an important research direction in computer vision and pattern recognition, widely applied in scenarios such as human-computer interaction, identity authentication, intelligent security, and precise recommendation. Existing facial age prediction methods mainly include those based on traditional handcrafted features and those based on deep learning. Methods based on traditional handcrafted features typically rely on manually designed features such as facial texture and shape, combined with regression or classification models for age prediction. These methods are highly dependent on feature design, making it difficult to fully characterize the complex patterns of facial changes with age, and their prediction performance is limited under complex lighting and pose variations. With the development of deep learning technology, facial age prediction methods based on convolutional neural networks have gradually become mainstream. These methods automatically learn high-level semantic features of faces through deep network structures, achieving significant improvements in prediction accuracy compared to traditional methods. However, most existing deep learning methods typically employ complex network models with a large number of parameters, resulting in high reliance on computational and storage resources, making them difficult to deploy directly in resource-constrained applications such as mobile terminals or embedded devices. Furthermore, some existing deep learning methods, when modeling age prediction tasks, often treat age labels as independent classification categories or simple regression targets, ignoring the inherent sequential relationship between age labels. This makes it difficult for the model to fully utilize the continuous characteristics of age changes, thus leaving room for improvement in prediction accuracy and stability.
[0003] While existing face age prediction methods have made some progress in prediction accuracy, they still have many shortcomings. On the one hand, most existing deep learning-based face age prediction methods typically rely on complex convolutional neural network models with large parameter sizes, resulting in high computational complexity, large storage overhead, and high hardware resource requirements, making them difficult to deploy efficiently and apply in resource-constrained environments such as mobile terminals and embedded devices. On the other hand, some existing methods focus on increasing network depth or width to pursue prediction accuracy during model design, while neglecting the importance of lightweight model design, which can easily lead to redundant feature calculations and reduce overall inference efficiency. In addition, many existing methods often treat age labels as independent categories or simple continuous values when modeling age prediction tasks, failing to fully consider the objectively existing sequential relationships and continuous change characteristics between age labels, thus limiting the model's effective characterization of age change patterns, resulting in insufficient accuracy and stability in the prediction results.
[0004] In summary, existing technologies still struggle to simultaneously achieve optimal performance in terms of computational efficiency, model size, and the ability to model age order relationships, and thus cannot meet the practical application requirements for high-precision, low-complexity face age prediction technology. Summary of the Invention
[0005] The purpose of this invention is to address the problems of existing facial age prediction models, such as large number of parameters, high computational complexity, difficulty in deployment on resource-constrained devices, and insufficient modeling of the order relationship of age labels, resulting in insufficient prediction accuracy and stability. The invention aims to provide a facial age prediction technology solution that balances prediction accuracy and computational efficiency. By designing the network structure and training strategy as a whole, the invention effectively portrays the continuity and order of age changes while reducing model computational overhead and storage requirements, thereby achieving efficient and stable facial age prediction.
[0006] To achieve the above-mentioned objectives, the present invention provides the following technical solution: A method for predicting facial age based on lightweight deep learning networks includes the following steps: S1. Face image acquisition and preprocessing: Acquire the face image to be predicted and perform preprocessing operations on the image; S2. Face feature extraction: The preprocessed image is input into a feature extraction network for multi-layer semantic feature extraction. The feature extraction network is an EGA-ConvNeXt network, which is based on ConvNeXt as a skeleton and integrates an improved ConvNeXt module and an ECA channel attention module. S3. Lightweight Feature Generation: In the feature extraction process, a lightweight feature generation module is introduced. The lightweight feature generation module adopts the Ghost convolution structure, generates basic feature maps through standard convolution, and generates additional features by combining low-cost linear transformation, and then splices them to generate lightweight features. S4. Channel Feature Enhancement: After lightweight feature generation, the extracted features are adaptively weighted using the ECA high-efficiency channel attention module; S5. Model training based on age order relationship: During the model training phase, a loss function based on age order relationship is used for optimization. The loss function is the CORN loss function, which transforms the age prediction problem into an ordered binary classification subtask to model the order relationship between age labels. S6. Age prediction result output: Calculate the corresponding face prediction age value based on the network output result, and output the final age prediction result.
[0007] Preferably, in step S1, the preprocessing operation includes image size normalization, pixel value normalization, and data augmentation processing.
[0008] Preferably, the pixel value normalization includes standardizing the image pixels to give them zero mean and unit variance, in order to accelerate model convergence.
[0009] Preferably, the data augmentation process includes a horizontal flip operation to simulate different shooting angles.
[0010] Preferably, in step S2, the structure of the EGA-ConvNeXt is as follows: the input first passes through a two-dimensional convolutional layer and layer normalization, and then enters an improved ConvNeXt module and an ECA attention module. The network consists of a series of improved ConvNeXt modules, each of which is followed by an ECA module. Between different module groups, there is an improved downsampling layer to reduce spatial resolution and increase the number of feature channels, thereby enhancing the model's attention to high-level feature patterns. After all stages, the feature map passes through global average pooling, layer normalization, and linear layers in sequence to generate the final output.
[0011] Preferably, the improved ConvNeXt module structure is as follows: the input first passes through a depth-separable 2D convolutional layer and layer normalization, then through two Ghost modules separated by a GELU activation function, followed by layer scaling and random depth processing (Drop Path), and finally the output is fused with the input through residual connections.
[0012] Preferably, the improved downsampling module includes layer normalization and a Ghost module, thereby reducing spatial resolution and adjusting the number of feature channels.
[0013] Preferably, the Ghost convolutional structure in the lightweight feature generation module includes a main convolutional path that generates native features and an auxiliary convolutional branch that generates Ghost features, and finally forms the output through feature fusion.
[0014] More preferably, the Ghost convolution structure in the lightweight feature generation module is as follows: the input first enters the main convolution to generate an initial feature layer containing core semantic information; then, the initial feature layer is divided into two paths, one path directly connects to the output as the intrinsic feature, and the other path branches into multiple auxiliary convolution branches; each auxiliary convolution generates a fine-grained feature map with few parameters and low computational cost through lightweight transformation; the fine-grained feature map complements the main convolution feature and is used to capture the detailed information that the main convolution failed to extract, thus constituting the Ghost feature in the output; finally, the intrinsic feature and the Ghost feature are fused to form a complete output result.
[0015] Preferably, in step S4, the ECA high-efficiency channel attention module obtains channel statistics through global average pooling, and uses one-dimensional convolution to model the local dependencies between channels, generates channel weight coefficients, enhances important feature channels, and suppresses redundant channels, thereby improving feature discrimination ability.
[0016] Preferably, the CORN loss function transforms the age prediction problem into multiple binary classification sub-tasks with sequential relationships, as follows: Let the total number of age categories be K The problem of predicting the original age is then divided into: K One subtask, of which the first k A sub-task is used to determine the real age. y Is it greater than the threshold? k Its probability is expressed as:
[0017] in, This represents the features of the input face image; The predicted probability corresponding to the model output is:
[0018] in, The first output of the model Predicted values for each sub-task For the Sigmoid function; The CORN loss function is defined as:
[0019] in, This is an indicator function used to distinguish between positive and negative samples; The final predicted age is obtained by summing the results of each subtask: .
[0020] Preferably, during model training, an adaptive optimization algorithm is used to update the model parameters, employing the AdamW optimizer with an initial learning rate of 5e. 4. The weight decay coefficient is 5e. 2. The batch size is 32, the number of training rounds is 100, and a cosine annealing learning rate decay strategy is applied.
[0021] Preferably, the method further includes regularization processing to prevent overfitting through a random depth strategy, thereby improving the model's generalization ability.
[0022] Preferably, during training, a cosine annealing learning rate decay strategy is adopted, so that the learning rate gradually decreases with the number of training rounds, thereby improving the convergence stability of the model.
[0023] Secondly, the present invention also provides a lightweight aging age prediction system, comprising: The face image acquisition and preprocessing module is used to acquire the face image to be predicted and to perform preprocessing operations on the image; The face feature extraction module is used to input the preprocessed image into the feature extraction network for multi-layer semantic feature extraction. The feature extraction network is an EGA-ConvNeXt network, which is based on ConvNeXt as a skeleton and integrates an improved ConvNeXt module and an ECA channel attention module. A lightweight feature generation module is used to introduce a lightweight feature generation module during the feature extraction process. The lightweight feature generation module adopts a Ghost convolution structure, generates a basic feature map through standard convolution, and generates additional features by combining low-cost linear transformation, and then concatenates them to generate lightweight features. The channel feature enhancement module is used to adaptively weight the extracted features after lightweight feature generation using the ECA efficient channel attention module; The model training module based on age order relationship is used to optimize the model training stage by using a loss function based on age order relationship. The loss function is the CORN loss function, which transforms the age prediction problem into an ordered binary classification subtask to model the order relationship between age labels. The age prediction result output module is used to calculate the corresponding face prediction age value based on the network output results and output the final age prediction result.
[0024] Thirdly, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to the present invention.
[0025] Fourthly, the present invention also provides an electronic device comprising a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the method according to the present invention.
[0026] This invention proposes a face age prediction method based on a lightweight deep neural network, constructing an improved age estimation network structure. The network uses ConvNeXt as its backbone, introduces Ghost convolutions to achieve lightweight feature generation, and combines ECA channel attention mechanism for feature enhancement, constructing an EGA-ConvNeXt network structure. This is then trained using a loss function based on age order, achieving the goal of improving age prediction accuracy while reducing the number of model parameters and computational complexity.
[0027] Through the collaborative design of the above technical solutions, this invention realizes a face age prediction method that balances prediction accuracy and computational efficiency. It can maintain good prediction performance in various public datasets and different application scenarios, and is suitable for server-side inference as well as resource-constrained scenarios such as mobile devices and embedded devices.
[0028] Compared with existing technologies, the face age prediction technology based on lightweight convolutional neural networks proposed in this invention has the following advantages: (1) By introducing a lightweight feature generation module, this invention effectively reduces redundant model calculations while ensuring feature expression capabilities, significantly reduces the number of model parameters and computational complexity, and improves model running efficiency. It is suitable for application scenarios with limited computing resources.
[0029] (2) By setting up a channel feature enhancement module, the present invention can adaptively weight different feature channels, highlight key features closely related to age changes, suppress irrelevant or redundant features, thereby improving the model's ability to distinguish facial age features.
[0030] (3) In the model training stage, the present invention adopts a loss function based on age order relationship, makes full use of the order constraint between age labels, guides the model to learn feature representations that are more in line with the real age distribution, effectively reduces prediction error, and improves the accuracy and stability of age prediction.
[0031] (4) Through the collaborative design of network structure and training strategy, this invention achieves superior prediction performance on multiple public face age datasets, demonstrating good generalization ability and adapting to different population characteristics and shooting conditions.
[0032] (5) The technical solution described in this invention has a clear overall structure and a simple implementation method, which is convenient for engineering implementation and actual deployment. It is applicable to high-precision inference tasks on the server side, as well as real-time age prediction applications in mobile terminals and embedded devices. Attached Figure Description
[0033] Figure 1This is a comparison diagram of network architectures. (A) ConvNeXt structure; (B) EGA-ConvNeXt structure; (C) Improved ConvNeXt module structure; (D) Improved downsampling module structure.
[0034] Figure 2 This is a diagram illustrating the working principle of the Ghost module, showcasing the lightweight feature generation mechanism.
[0035] Figure 3 This is a flowchart of the ECA efficient channel attention mechanism, illustrating the channel feature enhancement process.
[0036] Figure 4 These are visualization examples of the model of this invention in the task of facial age prediction. (A) An example of the model of this invention predicting facial age under good lighting conditions and clear facial features; (B) An example of prediction under conditions of partial occlusion of facial features or low image quality. The predicted age result is shown outside the parentheses, and the actual age is labeled inside the parentheses. Detailed Implementation
[0037] To facilitate understanding of the present invention, a more complete description will be given below with reference to specific embodiments. Preferred embodiments of the invention are shown in the accompanying drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a thorough and complete understanding of the disclosure of the invention.
[0038] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention.
[0039] Unless otherwise specified, the experimental methods used in the following examples and comparative examples are conventional methods.
[0040] This invention provides a face age prediction method based on a lightweight convolutional neural network, the method comprising the following steps: Step S1: Face image acquisition and preprocessing The face image data to be predicted is acquired, and a series of preprocessing operations are performed on the image to improve the robustness of the model and reduce the impact of factors such as illumination changes and pose differences on the age prediction results.
[0041] Specific preprocessing operations include: (1) Image size normalization: Adjust the image to a uniform size to ensure the consistency of input data.
[0042] (2) Pixel value normalization: The pixel values of the image are standardized to have zero mean and unit variance, thereby accelerating the convergence of the model.
[0043] (3) Data augmentation: A flipping operation (horizontal flip) was used as a data augmentation method to simulate different shooting angles and face orientations. This operation helps improve the model's ability to adapt to the diversity and symmetry of faces.
[0044] The above preprocessing operations enhance the diversity of the dataset and reduce the impact of external changes on prediction accuracy.
[0045] Step S2: Facial Feature Extraction The preprocessed face image is input into the feature extraction network EGA-ConvNeXt, and features are extracted from the face image through multi-layer convolution operations to obtain a multi-layer semantic feature representation containing age-related information.
[0046] The architectures of ConvNeXt and EGA-ConvNeXt are as follows: Figure 1 As shown.
[0047] Architecture descriptions of ConvNeXt and EGA-ConvNeXt: (A) The structure of ConvNeXt. The input is first processed through a 2D convolutional layer (Conv2d) and layer normalization to facilitate subsequent deep feature extraction. Then, the network employs a series of ConvNeXt modules, each progressively extracting more complex features. Between each module group, downsampling layers reduce spatial resolution and increase the number of feature channels, allowing the model to focus more on high-level semantic information. After multiple (e.g., three) stacking and downsampling of modules, the feature maps sequentially undergo global average pooling, layer normalization, and linear layers to obtain the final output.
[0048] (B) Structure of EGA-ConvNeXt. The input first passes through a 2D convolutional layer and layer normalization, then enters an improved ConvNeXt module and an ECA attention module. The network consists of a series of improved ConvNeXt modules (each followed by an ECA module). Between different module groups, improved downsampling layers are used to reduce spatial resolution and increase the number of feature channels, thereby enhancing the model's attention to high-level feature patterns. After all stages, the feature maps are sequentially passed through global average pooling, layer normalization, and linear layers to generate the final output.
[0049] (C) Improved ConvNeXt module structure. The input first passes through a depthwise separable 2D convolutional layer (DepthwiseConv2d) and layer normalization, then through two Ghost modules separated by a GELU activation function, followed by layer scaling and drop path processing. Finally, the output is fused with the input via residual connections. By replacing the original components with Ghost modules, this structure achieves a good balance between computational efficiency and model performance.
[0050] (D) Improved downsampling module structure. The input is first processed by layer normalization, and then enters a Ghost module. This module adjusts the number of feature channels while reducing spatial resolution, and uses fewer parameters compared to traditional downsampling methods, thus achieving efficient feature dimension compression.
[0051] Step S3: Lightweight Feature Generation To reduce the number of model parameters and computational complexity, a lightweight feature generation module is introduced into the feature extraction network. This module employs a Ghost convolutional structure. The Ghost convolution first generates a basic feature map using standard convolution, then generates additional features using efficient linear transformations, and finally concatenates the two feature sets. This significantly reduces the number of model parameters and computational cost while maintaining feature expressive power, achieving network lightweighting. Figure 2 As shown.
[0052] Figure 2 The structure of the Ghost Module is explained as follows: The input first enters the main convolution, generating an initial feature layer containing core semantic information. This feature layer is then divided into two paths: one path directly connects to the output, serving as intrinsic features; the other branches into multiple auxiliary convolution branches. Each auxiliary convolution generates fine-grained feature maps with few parameters and low computational cost through lightweight transformations. Although these feature maps have some redundancy in information, they complement the main convolution features, capturing detailed information that the main convolution failed to extract, thus forming the Ghost features in the output. Finally, the intrinsic features and Ghost features are fused to form a complete output, effectively reducing the number of model parameters and computational complexity while maintaining feature expressive power, thereby improving model inference efficiency.
[0053] Step S4: Channel Feature Enhancement After lightweight feature generation, an ECA channel attention module is introduced to adaptively weight the features. This module obtains channel statistics through global average pooling and uses one-dimensional convolution to model local dependencies between channels, generating channel weight coefficients to enhance important feature channels and suppress redundant channels, thereby improving feature discrimination ability. Figure 3 As shown.
[0054] The ECA (Efficient Channel Attention) mechanism works as follows: For the aggregated feature map obtained through Global Average Pooling (GAP), ECA uses a fast one-dimensional convolution to generate channel-wise weight coefficients. The kernel size of the one-dimensional convolution is k, and k is adaptively mapped according to the number of channels C. This process enables effective inter-channel information exchange and feature recalibration without introducing significant parameter overhead, thereby improving feature representation capabilities.
[0055] Step S5: Model training based on age order relationship During the model training phase, the CORN loss function is used to transform the age prediction problem into multiple ordered binary classification sub-tasks. By modeling the order relationship between age labels, the stability and accuracy of prediction are improved.
[0056] The CORN (Categorical Ordinal Regression Network) loss function transforms the age prediction problem into multiple binary classification subtasks with sequential relationships. Let the total number of age categories be... K The problem of predicting the original age is then divided into: K One subtask, of which the first k A sub-task is used to determine the real age. y Is it greater than the threshold? k Its probability is expressed as:
[0057] in, This represents the features of the input face image.
[0058] The predicted probability corresponding to the model output is:
[0059] in, The first output of the model Predicted values for each sub-task This is the Sigmoid function.
[0060] The CORN loss function is defined as:
[0061] in, This is an indicator function used to distinguish between positive and negative samples.
[0062] The final predicted age is obtained by summing the results of each subtask:
[0063] Step S6: Output age prediction results Calculate the corresponding predicted age value of the face based on the network output, and output the final age prediction result.
[0064] achievable training process: During training, an adaptive optimization algorithm is used to update the model parameters, with the following specific settings: Optimizer: AdamW optimizer; Initial learning rate: ; Weight decay coefficient: ; Batch size: 32; Training epochs: 100 epochs.
[0065] To improve the model's convergence speed and prevent overfitting, a cosine annealing learning rate decay strategy is used during training, which gradually reduces the learning rate with each training round, thereby improving the model's convergence stability.
[0066] Example 1: Comparative Examples of Different Loss Functions in Age Prediction Tasks This embodiment is used to verify the technical effect of the loss function based on age order relationship in the face age prediction task.
[0067] In this embodiment, a publicly available facial age dataset is selected as the experimental data. The input facial images are preprocessed by uniformly adjusting their size and normalizing them before being input into the facial age prediction model of this invention for training and testing. The model network structure remains consistent; different loss functions are used only during the model training phase for comparison to eliminate the influence of other factors on the experimental results.
[0068] Specifically, in the control experiment, one set of models was trained using the traditional cross-entropy loss function; the other set was trained using the age order loss function (CORN). Both sets of models were trained under the same training parameter settings and training epochs, and then tested on four publicly available face age datasets: LAP, MegaAge_Asian, AFAD, and CACD. The mean absolute error (MAE) was used as the performance evaluation metric for the models.
[0069] The publicly available facial age datasets are sourced from the following sources: LAP: ChaLearn Looking at People (LAP) public dataset, available on the official data page (https: / / chalearnlap.cvc.uab.cat). MegaAge_Asian: The Asian facial age dataset publicly released by MMLAB at the Chinese University of Hong Kong. It can be accessed on the official project page (https: / / mmlab.ie.cuhk.edu.hk / projects / MegaAge). AFAD: The Asian Face Age Dataset is a publicly available dataset, accessible from the official website (https: / / github.com / John-niu-07 / afad-dataset.github.io). CACD: Cross-Age Celebrity Dataset, a public dataset available on the official project page (https: / / bcsiriuschen.github.io / CARC).
[0070] The experimental results are shown in Table 1.
[0071] Table 1: Comparison of mean absolute error of different loss functions on multiple face age datasets.
[0072]
[0073] As shown in Table 1, on multiple datasets, the model trained using the age order loss function outperforms or significantly outperforms the model trained using the traditional cross-entropy loss function in terms of prediction error. This result demonstrates that, compared to traditional methods that treat age labels as independent categories, the age order loss function employed in this invention can more effectively characterize the continuity and sequence relationships between age labels, thereby improving the overall performance of the model in age prediction tasks.
[0074] Example 2: Comparative Examples of Different Network Models in Age Prediction Tasks This embodiment is used to verify the prediction performance of the face age prediction model (EGA-ConvNeXt) described in this invention under different network structure conditions.
[0075] In this embodiment, several existing convolutional neural network models were selected as control models, including VGG-16, ResNet-50, ConvNeXt, and ConvNeXtV2. The performance of each model in the face age prediction task was compared and analyzed under the same dataset, training strategy, and testing conditions. To ensure the comparability of the experimental results, all models adopted the same data preprocessing method and evaluation metrics.
[0076] Specifically, different network models were trained and tested on four public face age datasets: LAP, MegaAge_Asian, AFAD, and CACD, and the mean absolute error (MAE) was used as the performance evaluation metric for the models.
[0077] The experimental results are shown in Table 2.
[0078] Table 2: Comparison of mean absolute error of different network models on multiple face age datasets.
[0079]
[0080] As shown in Table 2, the prediction error of the model described in this invention is lower than or close to that of the control model on multiple datasets, and it achieves good performance stability while ensuring prediction accuracy.
[0081] Experimental results show that by improving the network structure, this invention enhances the model's ability to model facial age features without significantly increasing model complexity, thereby effectively improving the overall performance of the age prediction task.
[0082] Example 3: Comparison of Model Parameter Quantity and Computational Complexity This embodiment is used to verify the technical effectiveness of the face age prediction model described in this invention in terms of model size and computational complexity.
[0083] In this embodiment, the model described in this invention and a control model are selected as comparison objects. Under the same network input size and inference settings, statistical analysis is performed on the number of model parameters and computational complexity. The number of model parameters is used to measure the model size, and computational complexity is evaluated using floating-point operations (FLOPs) as an indicator to measure the computational cost of the model during the inference phase.
[0084] Specifically, the number of parameters and FLOPs of the control model (ConvNeXt) and the model described in this invention (EGA-ConvNeXt) were statistically analyzed, and the differences in model complexity between the two were compared and analyzed.
[0085] The experimental results are shown in Table 3.
[0086] Table 3: Comparison of different models in terms of parameter count and computational complexity.
[0087]
[0088] As shown in Table 3, compared with the control model, the model described in this invention significantly reduces the number of model parameters and computational complexity. While greatly reducing the model size and computational overhead, it still maintains good age prediction performance. This result demonstrates that this invention, through lightweight network structure design, effectively improves the computational efficiency of the model without sacrificing prediction accuracy, making it suitable for application scenarios with high requirements for computing power and storage resources.
[0089] Example 4: Comparative Example of Functional Module Ablation Experiment This embodiment is used to verify the impact of each functional module in the face age prediction model of the present invention on the model performance and computational complexity.
[0090] In this embodiment, a basic network structure is used as the baseline model. While maintaining consistency in the main network structure and training parameters, different functional modules are introduced into the baseline model to compare and analyze the model's age prediction performance and model complexity on multiple datasets. By gradually introducing functional modules, the interference of other factors on the experimental results can be eliminated.
[0091] Specifically, the baseline model (ConvNeXt) without any functional modules was first trained and tested. Then, a lightweight feature generation module (GhostConv), a channel feature enhancement module (ECA attention), stochastic deep processing (DropPath), and an age-order-based loss function (CORN) were sequentially introduced into the baseline model to obtain improved models at different stages, ultimately forming the complete EGA-ConvNeXt model. Under the same experimental conditions, each of these models was trained and tested. The mean absolute error (MAE) was used to evaluate model performance, and the number of model parameters and the number of floating-point operations (FLOPs) were used to evaluate model complexity.
[0092] The experimental results are shown in Table 4.
[0093] Table 4: Comparison of model performance and complexity before and after introducing different functional modules.
[0094]
[0095] As shown in Table 4, with the gradual introduction of functional modules, the prediction error of the model on multiple datasets generally shows a downward trend, while the number of model parameters and computational complexity remain at a low level. Experimental results demonstrate that the functional modules described in this invention can cooperate and work synergistically in the overall network structure, further improving age prediction performance while ensuring the lightweight nature of the model, thus verifying the rationality and effectiveness of the technical solution of this invention.
[0096] Example 5: Visual Analysis of Age Prediction Results This embodiment is used to visualize the prediction results of a portion of the test samples to further illustrate the performance of the face age prediction model described in this invention in practical applications.
[0097] In this embodiment, several face image samples from the test dataset are selected, and the face age is predicted under different lighting conditions, pose changes, and facial feature clarity conditions. The model prediction results are then compared and displayed with the corresponding real ages.
[0098] Visualization examples of prediction results are as follows: Figure 4 As shown. Among them, Figure 4 In this context, A represents an example of how the model described in this invention predicts facial age under good lighting conditions and with clear facial features. Figure 4 In the diagram, B represents a prediction example under conditions of partial facial feature occlusion or low image quality. The predicted age is shown outside the parentheses, while the actual age is labeled inside the parentheses.
[0099] Depend on Figure 4 As can be seen, in most test samples, the model described in this invention can predict facial age relatively accurately; in some complex scenarios, although the prediction results have certain deviations, the overall prediction trend remains consistent with the actual age. This visualization further illustrates that the technical solution described in this invention has good stability and practicality in real-world application scenarios.
[0100] On the other hand, the present invention also provides a lightweight aging age prediction system, comprising: The face image acquisition and preprocessing module is used to acquire the face image to be predicted and to perform preprocessing operations on the image; The face feature extraction module is used to input the preprocessed image into the feature extraction network for multi-layer semantic feature extraction. The feature extraction network is an EGA-ConvNeXt network, which is based on ConvNeXt as a skeleton and integrates an improved ConvNeXt module and an ECA channel attention module. A lightweight feature generation module is used to introduce a lightweight feature generation module during the feature extraction process. The lightweight feature generation module adopts a Ghost convolution structure, generates a basic feature map through standard convolution, and generates additional features by combining low-cost linear transformation, and then concatenates them to generate lightweight features. The channel feature enhancement module is used to adaptively weight the extracted features after lightweight feature generation using the ECA efficient channel attention module; The model training module based on age order relationship is used to optimize the model training stage by using a loss function based on age order relationship. The loss function is the CORN loss function, which transforms the age prediction problem into an ordered binary classification subtask to model the order relationship between age labels. The age prediction result output module is used to calculate the corresponding face prediction age value based on the network output results and output the final age prediction result.
[0101] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method according to the present invention.
[0102] On the other hand, the present invention also provides an electronic device including a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the method according to the present invention.
[0103] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Therefore, any simple modifications, equivalent changes, and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.
Claims
1. A lightweight method for predicting aging, characterized in that, Includes the following steps: S1. Face image acquisition and preprocessing: Acquire the face image to be predicted and perform preprocessing operations on the image; S2. Face feature extraction: The preprocessed image is input into a feature extraction network for multi-layer semantic feature extraction. The feature extraction network is an EGA-ConvNeXt network, which is based on ConvNeXt as a skeleton and integrates an improved ConvNeXt module and an ECA channel attention module. S3. Lightweight Feature Generation: In the feature extraction process, a lightweight feature generation module is introduced. The lightweight feature generation module adopts the Ghost convolution structure, generates basic feature maps through standard convolution, and generates additional features by combining low-cost linear transformation, and then splices them to generate lightweight features. S4. Channel Feature Enhancement: After lightweight feature generation, the extracted features are adaptively weighted using the ECA high-efficiency channel attention module; S5. Model training based on age order relationship: During the model training phase, a loss function based on age order relationship is used for optimization. The loss function is the CORN loss function, which transforms the age prediction problem into an ordered binary classification subtask to model the order relationship between age labels. S6. Age prediction result output: Calculate the corresponding face prediction age value based on the network output result, and output the final age prediction result.
2. The method according to claim 1, characterized in that, In step S1, the preprocessing operation includes image size normalization, pixel value normalization, and data augmentation.
3. The method according to claim 1, characterized in that, In step S2, the structure of the EGA-ConvNeXt is as follows: the input first passes through a two-dimensional convolutional layer and layer normalization, and then enters the improved ConvNeXt module and the ECA attention module. The network consists of a series of improved ConvNeXt modules, each of which is followed by an ECA module. Between different module groups, there is an improved downsampling layer to reduce spatial resolution and increase the number of feature channels, thereby enhancing the model's attention to high-level feature patterns. After all stages, the feature map is sequentially processed through global average pooling, layer normalization, and linear layers to generate the final output.
4. The method according to claim 3, characterized in that, The improved ConvNeXt module structure is as follows: the input first passes through a depth-separable 2D convolutional layer and layer normalization, then through two Ghost modules separated by a GELU activation function, followed by layer scaling and random depth processing, and finally the output is fused with the input through residual connections.
5. The method according to claim 3, characterized in that, The improved downsampling module includes layer normalization and a Ghost module, which reduces spatial resolution and adjusts the number of feature channels.
6. The method according to claim 1, characterized in that, The lightweight feature generation module's Ghost convolutional structure includes a main convolutional path that generates native features, and auxiliary convolutional branches that generate Ghost features. Finally, the output is formed through feature fusion.
7. The method according to claim 1, characterized in that, In step S4, the ECA high-efficiency channel attention module obtains channel statistics through global average pooling, and uses one-dimensional convolution to model the local dependencies between channels, generating channel weight coefficients to enhance important feature channels and suppress redundant channels, thereby improving feature discrimination ability.
8. The method according to claim 1, characterized in that, The CORN loss function transforms the age prediction problem into multiple binary classification sub-tasks with sequential relationships, as follows: Let the total number of age categories be K The problem of predicting the original age is then divided into: K One subtask, of which the first k A sub-task is used to determine the real age. y Is it greater than the threshold? k Its probability is expressed as: in, This represents the features of the input face image; The predicted probability corresponding to the model output is: in, The first output of the model Predicted values for each sub-task For the Sigmoid function; The CORN loss function is defined as: in, This is an indicator function used to distinguish between positive and negative samples; The final predicted age is obtained by summing the results of each subtask: 。 9. A lightweight system for predicting aging, characterized in that, The system includes: The face image acquisition and preprocessing module is used to acquire the face image to be predicted and to perform preprocessing operations on the image; The face feature extraction module is used to input the preprocessed image into the feature extraction network for multi-layer semantic feature extraction. The feature extraction network is an EGA-ConvNeXt network, which is based on ConvNeXt as a skeleton and integrates an improved ConvNeXt module and an ECA channel attention module. A lightweight feature generation module is used to introduce a lightweight feature generation module during the feature extraction process. The lightweight feature generation module adopts a Ghost convolution structure, generates a basic feature map through standard convolution, and generates additional features by combining low-cost linear transformation, and then concatenates them to generate lightweight features. The channel feature enhancement module is used to adaptively weight the extracted features after lightweight feature generation using the ECA efficient channel attention module; The model training module based on age order relationship is used to optimize the model training stage by using a loss function based on age order relationship. The loss function is the CORN loss function, which transforms the age prediction problem into an ordered binary classification subtask to model the order relationship between age labels. The age prediction result output module is used to calculate the corresponding face prediction age value based on the network output results and output the final age prediction result.
10. An electronic device, characterized in that, The electronic device includes a processor and a memory, the memory storing a computer program that, when executed by the processor, implements the method as described in any one of claims 1 to 8.