A method for analyzing facial attributes of minors based on Ret attention and ConvNeXt network

CN119600657BActive Publication Date: 2026-09-08BOKAI JIAXIN TECH DEV (TIANJIN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411390998.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-08
Publication Date
2026-09-08
Estimated Expiration
2044-10-08

AI Technical Summary

Benefits of technology

[0040] This invention designs a method for analyzing facial attributes of minors that integrates Ret Attention and ConvNeXt networks. By simply inputting a facial image of the minor, it can obtain gender, age, race, and expression attributes, providing supplementary information for the education of minors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119600657B_ABST
    Figure CN119600657B_ABST
Patent Text Reader

Abstract

The application discloses a minor face attribute analysis method based on a Ret attention and a ConvNeXt network, mainly including model training and model reasoning two parts, the model training part specifically includes the following steps: S100: a large number of face image data sets of minors are collected and cleaned, and are divided into different categories and subjected to basic labeling; S200: a RetNeXt deep convolutional neural network model combining Ret attention and ConvNeXt is constructed; S300: the model is trained using the cleaned data set, and a fine-tuning model is supervised to improve the accuracy of the attributes of minors; the model reasoning part includes the following steps: S400: a face image to be detected is input into the trained RetNeXt model, and the model extracts the features of the face image by means of the method combining Ret attention and ConvNeXt; S500: the face attributes are inferred by using the model, and the network model combining Ret attention and ConvNeXt has higher accuracy and robustness in the attribute information such as expressions, ages, genders and races of minors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer vision technology, and in particular to a method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks. Background Technology

[0002] Minor attribute recognition is a highly anticipated problem in computer vision, aiming to infer attributes such as gender, age, expression, and ethnicity from facial images of minors. This task has broad application prospects, spanning fields from child protection to targeted advertising. To achieve minor attribute recognition, researchers are constantly exploring various methods and technologies, among which deep learning-based methods have made significant progress in recent years. Minor attribute recognition is a challenging task, requiring computer systems to automatically infer attributes such as gender, age, expression, and ethnicity from facial images. This task has significant application value in many fields, such as: Child protection: In the internet age, children become targets of harmful information and potential threats online. Identifying minors can help monitor and protect them from potential risks. Targeted advertising: Many advertising companies want to target their ads to audiences of specific ages and genders. Minor attribute recognition can help advertising companies target their ads more accurately. Education: In the field of education, identifying students' age and emotional state can help educators better understand their needs and emotional states, thereby providing more personalized education. Medical Diagnosis: In the medical field, facial attribute recognition can help doctors better diagnose patients' diseases and emotional states, providing more information for medical decisions.

[0003] The Ret Attention network is a deep learning-based visual processing network inspired by the human visual system's varying attention levels to different regions of an image. This network combines attention mechanisms and residual connections to improve the perception and utilization of important information in an image. In attribute recognition for minors, the application of the Ret Attention network can help the model better understand information from different regions of facial images, thereby improving the accuracy of attribute recognition. The Ret Attention network achieves its focus on different regions of an image by introducing a QKVD (Query, Key, Value, Dependency) matrix. Specifically, it works through the following steps: Query and Key Calculation: First, the Ret Attention network calculates the Query and Key vectors for each pixel to measure the correlation between different regions. This helps the network determine which regions are more important. Value Calculation: Next, a Value vector is calculated for each pixel, containing information about that pixel. Dependency Calculation: By calculating the correlation between the Query and Key, a Dependency matrix is ​​generated to measure the dependencies between different regions. This helps the network better understand the propagation path of information in the image. Ret Attention Calculation: Finally, the Ret Attention network uses the QKVD matrix to calculate the RetAttention vector for each pixel, which is used to adjust the importance of that pixel. This process can be viewed as weighting the image, focusing more attention on important regions. Through these steps, the Ret Attention network can better capture information from different regions in the image, improving the accuracy of attribute recognition.

[0004] The ConvNeXt network is a deep convolutional neural network architecture that enhances feature map extraction capabilities by combining multiple branch networks. Inspired by multi-path information transmission in networks, this architecture effectively captures features at different scales and levels in an image. The core idea of ​​ConvNeXt is to combine different convolutional branches to obtain more representative features. Its working principle is as follows: Multi-branch structure: The ConvNeXt network contains multiple convolutional branches, each extracting features at different levels and scales. These branches share weight parameters to effectively learn features. Feature fusion: Feature maps extracted from different branches are integrated through a feature fusion layer to generate more representative features. This process helps the network better understand information in the image. Multi-label classification: Finally, the ConvNeXt network uses multiple classifiers to predict different attribute labels. This allows the network to perform multiple attribute recognition tasks simultaneously.

[0005] This invention proposes a method for identifying the attributes of minors based on Ret Attention and ConvNeXt networks, which combines attention mechanism and multi-path feature extraction, and has high accuracy and generalization ability. Summary of the Invention

[0006] To address the aforementioned technical problems, this invention provides a method for analyzing facial attributes of minors based on Ret Attention and ConvNeXt networks. This method integrates Ret Attention and ConvNeXt networks, allowing for the acquisition of gender, age, ethnicity, and expression attributes simply by inputting a facial image of a minor, thus providing supplementary information for the education of minors.

[0007] To achieve the above objectives, the technical solution of the present invention is as follows:

[0008] A method for facial attribute analysis of minors based on Ret attention and ConvNeXt network, the specific steps of which are as follows:

[0009] S100: Collect a large amount of image data of minors, clean it, and classify and label the image data;

[0010] Images are acquired through multiple methods. Images that do not show faces are filtered out, retaining only those with clearly identifiable faces. The acquired image data needs to be cleaned. During cleaning, a certain proportion of images with large angles of rotation are retained to ensure the model can recognize faces from different angles. Images with excessively high or low lighting quality are also retained to increase data diversity. The cleaned images require attribute labeling. To ensure balanced model training, oversampling or undersampling techniques are used to balance the dataset, ensuring a similar number of samples for each attribute category.

[0011] S200: Construct a deep convolutional neural network model, and use the Ret Attention and ConvNeXt networks to build a RetNeXt network to recognize facial attributes;

[0012] The original ConvNeXt structure is extended to increase network depth, and Retina Attention components are embedded in the 1st, 3rd, and 5th blocks. This increases the original ConvNeXt layer count to four, resulting in four convolutional blocks, each containing multiple convolutional layers and branches. The Retina Attention module is inserted into specific blocks to enhance the model's perceptual capabilities and form the RetNeXt network model. The Ret structure, with its powerful retention mechanism, simulates the retention phenomenon of the human retina. Specifically, it is an evolution of the original Transformer structure. In the original Transformer model, the output is calculated as: input matrix X multiplied by three weight matrices W. Q W K and W V To create a query matrix Q, a key matrix K, and a value matrix V, calculate the dot product of the query matrix Q and the key matrix K, then apply the softmax function to obtain the attention weights. Multiply these attention weights by the value matrix V to produce the final output O. The calculation formula is as follows:

[0013] Q = XW Q

[0014] K = XW K

[0015] V = XW V

[0016]

[0017] The Ret structure integrates loop and parallel processing mechanisms by introducing so-called "hold" blocks in the loop mode. These blocks process each "n" element of the input data individually. Subsequently, to improve efficiency, these loop hold blocks are transformed into a vectorized form, as follows:

[0018]

[0019] Furthermore, the Ret structure incorporates causal masking and exponential decay. The D matrix (D-matrix) serves both as a causal mask and as an exponential decay weighting scheme for past positions, as detailed below:

[0020]

[0021] When processing sequential data, causal masking is used in self-attention mechanisms to maintain temporal consistency and prevent premature leakage of future information. This involves introducing a state vector S, which is passed from one time step to the next, carrying temporal or positional information. At each time step, this S... n-1 Multiplying by an exponential decay or discount factor v is to recursively complete the task of D, while controlling the type of information retained in the state vector S for future steps, unlike QK in the standard Transformer setup. T The first operation now is K. T V, while the query matrix Q is calculated in later steps. This calculation order differs between the parallel training and inference phases, as detailed below:

[0022]

[0023] Ret(x n )=Q n S n n = 1, 2, ..., |X|

[0024] S300: Using the cleaned dataset, the RetNeXt model is trained. During the training process, strategies are adopted to supervise fine-tuning, optimize the model's performance and improve its generalization ability, and ensure that the model can accurately recognize facial expressions, age, gender and race.

[0025] Three strategies were adopted. The first is a warm-start strategy: A strategy called "warm start" was implemented, using the Adam optimizer to set the learning rate to 0.03 during the first 10 epochs of training. This relatively high initial learning rate helps the model converge quickly in the early stages of training, thus accelerating the entire learning process and helping the model quickly adapt to the basic features of the dataset, achieving significant performance improvements in the early stages of training. The second strategy is cosine annealing learning rate adjustment: As training progresses, a cosine annealing strategy is used to dynamically adjust the learning rate. The learning rate is gradually reduced as the loss (the value of the loss function) tends to stabilize, stopping when it reaches 5e-6. This strategy is based on the observation that in the later stages of training, the learning rate becomes more stable. The learning rate is finely adjusted to precisely optimize the model's parameters. This allows the model to be "fine-tuned" more precisely as it approaches the optimal solution, avoiding fluctuations caused by excessively large learning rates and ensuring a smooth and efficient training process. The third method involves introducing new data for fine-tuning: During training, new datasets are introduced to improve the model's generalization ability, while the learning rate is increased to three times the minimum and kept constant. This new data comprises 10% of the original dataset. The purpose of this step is to enable the model to adapt to and learn from data samples it has never encountered before. By introducing these new samples for fine-tuning in the later stages of training, the model's ability to recognize unseen data is significantly improved.

[0026] S400: Input the face image to be detected into the trained model. The model uses Ret Attention’s unique attention mechanism and ConvNeXt’s powerful feature extraction method to extract key features from the face image.

[0027] After processing by the RetNeXt network, the image data is transformed into a rich set of feature vectors. These vectors capture key visual information in the image. These feature vectors are then used to drive four independent attribute task classifiers. Each classifier classifies a specific facial attribute, focusing on determining the gender of the person in the image. It analyzes the features extracted from the RetNeXt network, identifies gender-related patterns and features, including differences in facial structure, hairstyle, etc., and ultimately outputs a judgment about the gender of the person in the image. The four classifiers are as follows:

[0028] Age classifier: This process involves a detailed analysis of a range of key features, including facial wrinkles, skin tone, and facial proportions.

[0029] Race Classifier: The core task of a race classifier is to identify the race of people in an image. It relies on features extracted from advanced RetNeXt networks. These features include a range of facial attributes closely related to race, such as skin color, facial structure, and the shape of the eyes and nose. By analyzing these features, the classifier can categorize people in an image into a specific race.

[0030] Facial Expression Classifier: A facial expression classifier identifies facial expressions from images. This task covers a range of basic human emotional expressions, including happiness, sadness, anger, and surprise. It focuses on analyzing various key facial features. A facial expression classifier includes a predictor and a scorer. The predictor performs initial expression prediction by processing facial features to infer the expression of a person in the image. The scorer intervenes, evaluating and scoring the output of the predictor. It helps identify and correct any possible errors or inaccuracies, thereby optimizing the entire facial expression recognition process.

[0031] S500 uses a trained model to infer facial attributes, including expression, age, gender, and race.

[0032] Specifically, the acquisition methods are any one or more of the following: image search engines, social media platforms, and other legitimate means.

[0033] Specifically, the attribute labeling includes gender, age group labels, and ethnicity attributes, which can be completed manually or using advanced computer vision technology.

[0034] Specifically, Retina Attention is an attention mechanism typically used to enhance a model's focus on important regions in an image. This technique may be particularly effective in recognizing facial features of minors and adults because there are significant differences in facial texture between the two age groups. Generally, minors have finer skin textures, while adults' faces may show more lines and wrinkles. Using such a technique can help improve the accuracy of facial recognition systems, especially in application scenarios where it is necessary to accurately distinguish between different age groups.

[0035] Specifically, in step S200, for any two positions n and m in the sequence of the D matrix, if n > m, then the corresponding element will be set to 0 when calculating Q·KT. This is to ensure that when processing position n, the model will not be affected by information at position m (any position after n), thus ensuring the causality of the sequence processing. When n ≤ m, that is, when processing current or past information, the result of Q·KT will be weighted by an exponential decay factor γ. This means that as time goes by, the importance of past markers to the current time step gradually decreases. In other words, the further away a marker is from the current step in time, the smaller its influence on the current step.

[0036] Specifically, the three strategies in step S300 can be used in any combination. These combined strategies can not only accelerate the training process of the model, but also significantly improve the model's generalization ability and performance in real-world scenarios. In addition, through this comprehensive training method, the RetNeXt network is effectively tuned and optimized to meet the needs of a specific task, namely, accurately identifying and processing the facial attributes of minors.

[0037] Specifically, the age classifier consists of three fully connected layers. The first fully connected layer has 128 neurons and is responsible for extracting preliminary features from the input data. This is followed by a larger 256-dimensional fully connected layer, which further enhances the processing and synthesis of these features to capture more complex age-related patterns. Finally, the third fully connected layer is an 18-dimensional layer, which aims to compress these complex patterns into a more concise representation, enabling the model to output a specific age range prediction.

[0038] Specifically, the race classifier consists of two fully connected layer structures. The first fully connected layer has 1024 neurons. The large dimensionality of this layer enables the model to capture rich information from the complex features extracted by the RetNeXt network. The second fully connected layer is a 7-dimensional layer, specifically designed to transform this rich information into the final race classification.

[0039] The beneficial effects of this invention are:

[0040] This invention designs a method for analyzing facial attributes of minors that integrates Ret Attention and ConvNeXt networks. By simply inputting a facial image of the minor, it can obtain gender, age, race, and expression attributes, providing supplementary information for the education of minors.

[0041] The ConvNeXt in this invention employs a modified convolutional block design, using layer normalization similar to Transformer instead of traditional batch normalization. ConvNeXt extensively utilizes depthwise separable convolutions in its architecture, a highly efficient convolutional method that significantly reduces the number of model parameters and computational complexity. ConvNeXt simplifies network design by removing some complex structures common in traditional CNNs. This simplification contributes to the model's scalability and flexibility. This technique is particularly effective in recognizing facial features of minors and adults because there are significant differences in facial texture between these two age groups. Typically, minors have finer skin textures, while adults' faces may exhibit more lines and wrinkles. Using such a technique can help improve the accuracy of facial recognition systems, especially in applications requiring precise differentiation between different age groups.

[0042] The RetNeXt network, the core extractor designed in this invention, transforms image data into a rich set of feature vectors during data processing. These feature vectors are then used to drive four independent attribute task classifiers. These four classifiers provide comprehensive and detailed facial attribute analysis, which is crucial for applications such as face recognition, social media analysis, and crowd monitoring. This method not only improves classification accuracy but also has excellent adaptability and scalability because it is based on deep learning. The combined use of these classifiers enables the system to perform accurate and in-depth analysis of facial attributes under various environments and conditions. Attached Figure Description

[0043] Figure 1 This is a Ret structure diagram of a facial attribute analysis method for minors based on Ret attention and ConvNeXt network according to the present invention.

[0044] Figure 2 The RetNeXt structure diagram is shown for the facial attribute analysis method for minors based on Ret attention and ConvNeXt network of the present invention.

[0045] Figure 3 This is a schematic diagram of the overall process of a method for analyzing facial attributes of minors based on Ret attention and ConvNeXt network according to the present invention. Detailed Implementation

[0046] The technical solution of the present invention will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0047] Example 1

[0048] This invention proposes a method for analyzing facial attributes of minors by integrating Ret Attention and ConvNeXt networks. By simply inputting facial images of minors, it obtains attributes such as gender, age, ethnicity, and expression, providing supplementary information for the education of minors. The model of this invention is mainly divided into a model training part and a model inference part. The model training part mainly involves collecting a large number of facial images of minors, classifying them according to attributes such as gender, age, expression, and ethnicity, and then feeding them into the RetNeXt network. The specific steps of the model training part are as follows:

[0049] S100: Collect a large amount of image data of minors, clean it, and then classify and label the image data. This can be obtained through various means, such as image search engines, social media platforms, or legal channels. To ensure data quality, images that do not show faces will be filtered out, retaining only images where faces can be clearly identified. During the data cleaning process, a certain proportion of images with large deflection angles will be retained to ensure that the model can recognize faces from different angles. Simultaneously, some images with excessively high or low lighting quality will be retained to increase data diversity. The cleaned images need to be attribute-labeled. This includes labeling each image with information such as gender, age group, expression, and ethnicity. This information can be obtained through manual annotation or using advanced computer vision techniques. To ensure the balance of model training, the number of samples for each attribute category should be kept as similar as possible. This means that techniques such as oversampling or undersampling may be needed to balance the dataset.

[0050] S200: Construct a RetNeXt deep convolutional neural network model that combines Ret attention and ConvNeXt to recognize human faces.

[0051] The original ConvNeXt structure is extended to increase network depth, and Retina Attention components are embedded in blocks 1, 3, and 5. To increase network depth, the original ConvNeXt layer count can be increased to 4. This means there will be 4 convolutional blocks, each containing multiple convolutional layers and branches. Retina Attention components are embedded in convolutional blocks 1, 3, and 5. Retina Attention is an attention mechanism typically used to enhance a model's focus on important regions in an image. This technique can be particularly effective in recognizing facial features in minors and adults because there are significant differences in facial texture between these two age groups. Generally, minors have finer skin textures, while adults' faces may show more lines and wrinkles. Using such techniques can help improve the accuracy of facial recognition systems, especially in applications requiring precise differentiation between different age groups. Retina Attention modules can be inserted into these specific blocks to enhance the model's perceptual capabilities. The Ret structure, with its powerful retention mechanism, simulates the retention phenomenon of the human retina. Specifically, it evolved from the original Transformer structure. In the original Transformer model, the output is calculated as: the input matrix X multiplied by three weight matrices W. Q W K and W V Create a query matrix Q, a key matrix K, and a value matrix V. Calculate the dot product of the query matrix Q and the key matrix K, and then apply the softmax function to obtain the attention weights. Multiply these attention weights by the value matrix V to produce the final output O.

[0052] Q = XW Q

[0053] K = XW K

[0054] V = XW V

[0055]

[0056] The Ret structure integrates mechanisms for looping and parallel processing. This is achieved by introducing so-called "hold" blocks within the loop pattern, which process each "n" element of the input data individually. Subsequently, to improve efficiency, these loop hold blocks are transformed into a vectorized form, as follows:

[0057]

[0058] Furthermore, the Ret structure incorporates causal masking and exponential decay. The D-matrix serves both as a causal mask and as an exponentially decaying weighted scheme for past positions.

[0059]

[0060] When processing sequential data, causal masking is used in self-attention mechanisms to maintain temporal consistency and prevent premature leakage of future information. Specifically, for any two positions n and m in the sequence, if n > m, then when calculating Q·K... T When n is n, the corresponding element is set to 0. This is to ensure that when processing position n, the model is not affected by information at position m (any position after n), thus ensuring the causality of sequence processing. For the case n ≤ m, i.e., when processing current or past information, Q·K T The results are weighted by an exponential decay factor γ. This means that the importance of past markers to the current time step gradually decreases over time. In other words, the further away a marker is in time from the current step, the smaller its influence on the current step. The cyclic graph of the Ret structure is as follows: Figure 1 As shown,

[0061] A state vector S is introduced, which is passed from one time step to the next, carrying time or position information. At each time step, this S... n-1 Multiplying by an exponential decay or discount factor v is to recursively complete the task of D while controlling the type of information retained in the state vector S for future steps. This differs from the QK in the standard Transformer setup. T The first operation now is K. T V is the initial matrix, while the query matrix Q is calculated in later steps. This order of calculation differs between the parallel training and inference phases.

[0062]

[0063] Ret(x n )=Q n S n n = 1, 2, ..., |X|

[0064] ConvNeXt employs a modified convolutional block design that uses Transformer-like layer normalization instead of traditional batch normalization.

[0065] ConvNeXt extensively utilizes depthwise separable convolutions in its architecture. This efficient convolutional method significantly reduces the number of model parameters and computational complexity. ConvNeXt simplifies network design by removing complex structures common in traditional CNNs, such as dense connections and residual connections. This simplification contributes to the model's scalability and flexibility. The increased depth of convolutional blocks further enables it to extract features from four tasks simultaneously, such as... Figure 2 As shown,

[0066] The convolutional blocks are increased to 4 in stages 1, 3, and 5. A Ret structure is then embedded on top of this to form the RetNeXt network model.

[0067] S300: The RetNeXt model is trained using the cleaned dataset, with supervised fine-tuning during training to ensure that the model can accurately recognize facial expressions, age, gender, and race.

[0068] Several key strategies were employed during training to optimize model performance and improve its generalization ability: 1. Warm Start Strategy: A strategy called "warm start" was implemented, using the Adam optimizer to set the learning rate to 0.03 during the first 10 epochs of training. This relatively high initial learning rate helps the model converge quickly in the early stages of training, thus accelerating the entire learning process. This method is particularly helpful for the model to quickly adapt to the basic features of the dataset and achieve significant performance improvements in the early stages of training. 2. Cosine Annealing Learning Rate Adjustment: As training progressed, a cosine annealing strategy was used to dynamically adjust the learning rate. Specifically, this means that the learning rate is gradually reduced as the loss (the value of the loss function) tends to stabilize. It stops when it reaches 5e-6. This strategy is based on the observation that fine-tuning the learning rate in the later stages of training can more accurately optimize the model's parameters. In this way, the model can be "fine-tuned" more precisely as it approaches the optimal solution, thus avoiding fluctuations caused by excessively large learning rates and ensuring a smooth and efficient training process. 3. Introducing New Data for Fine-tuning: To further enhance the model's generalization ability, a new dataset was introduced during training, while the learning rate was increased to three times the minimum learning rate and kept constant. This new data comprised 10% of the original dataset. The purpose of this step was to enable the model to adapt to and learn from data samples it had not encountered before. By introducing these new samples for fine-tuning in the later stages of training, the model's ability to recognize unseen data was significantly improved, which is crucial for handling various unknown situations in real-world applications. The combined use of these strategies not only accelerated the model's training process but also significantly improved its generalization ability and performance in real-world scenarios. Through this comprehensive training method, the RetNeXt network was effectively tuned and optimized to meet the needs of a specific task: accurately identifying and processing the facial attributes of minors.

[0069] The model inference part specifically includes the following steps:

[0070] S400: Input the face image to be detected into the trained model. The model uses Ret Attention's unique attention mechanism and ConvNeXt's powerful feature extraction method to extract key features from the face image.

[0071] The RetNeXt network is used as the core feature extractor to process the input image data. This advanced network architecture effectively extracts robust features from images, reflecting deeper information that is crucial for further analysis and classification. After processing by the RetNeXt network, the image data is transformed into a rich set of feature vectors that capture key visual information in the image. These feature vectors are then used to drive four independent attribute task classifiers. Each classifier classifies a specific facial attribute, including: This classifier focuses on determining the gender of a person in an image. It analyzes the features extracted from the RetNeXt network, identifying gender-related patterns and features. This might include differences in facial structure, hairstyle, etc., ultimately outputting a judgment about the gender of the person in the image. Age classifier: This process involves a detailed analysis of a series of key features, including facial wrinkles, skin tone, and facial proportions. In this specific age classifier, a three-layer fully connected structure is used. The first fully connected layer has 128 neurons and is responsible for extracting preliminary features from the input data. Following this is a larger 256-dimensional fully connected layer, which further enhances the processing and synthesis of these features to capture more complex age-related patterns. Finally, the third fully connected layer is an 18-dimensional layer, designed to compress these complex patterns into a more concise representation, enabling the model to output a specific age range prediction. Race Classifier: The core task of the race classifier is to identify the race of people in an image. To accomplish this, it relies on features extracted from the advanced RetNeXt network. These features include a range of race-related facial attributes, such as skin color, facial structure, and the shape of the eyes and nose. By analyzing these features, the classifier can categorize people in an image into specific race categories, such as Asian, African, or Caucasian. Structurally, this race classifier consists of two fully connected layers. The first fully connected layer has 1024 neurons; this large dimensionality allows the model to capture rich information from the complex features extracted by the RetNeXt network. The subsequent second fully connected layer is a 7-dimensional layer specifically designed to transform this rich information into the final race classification. Facial Expression Classifier: The primary responsibility of a facial expression classifier is to identify facial expressions from images. This task covers a range of basic human emotional expressions, such as happiness, sadness, anger, and surprise. To perform this task accurately, the classifier focuses on analyzing various key facial features, such as facial muscle movement, and the position of the eyes and mouth. These features are crucial for understanding and recognizing human facial expressions. Technically, a facial expression classifier consists of two main parts: a predictor and a scorer. The predictor's role is to make initial expression predictions. It infers the facial expressions of people in images by processing facial features.Then, a scorer intervenes, evaluating and scoring the predictor's output. This scoring process helps identify and correct any potential errors or inaccuracies, thereby optimizing the entire expression recognition process. Through these four specialized classifiers, the system can provide comprehensive and detailed facial attribute analysis, which is crucial for applications such as face recognition, social media analysis, and crowd monitoring. This approach not only improves classification accuracy but also possesses excellent adaptability and scalability due to its deep learning-based methodology. The combined use of these classifiers enables the system to perform accurate and in-depth analysis of facial attributes under various environments and conditions.

[0072] S500. Use the model to infer facial attributes, including expression, age, gender, and race.

[0073] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. The present invention is not limited to the above embodiments; the embodiments and descriptions in the specification are merely illustrative of the principles of the invention. Various changes and modifications can be made to the invention without departing from its spirit and scope, and all such changes and modifications fall within the scope of the present invention as claimed. The scope of protection of the present invention is defined by the appended claims and their equivalents.

Claims

1. A method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks, the specific steps of which are as follows: S100: Collect image data of minors, clean it, and classify and label the image data; S200: Construct a deep convolutional neural network model, and use Ret attention and ConvNeXt network to build a RetNeXt network to recognize facial attributes; The specific content of step S200 is as follows: the Ret attention is fused into the ConvNeXt network, and the original ConvNeXt structure is modified and extended to increase the depth of the network; The original ConvNeXt network was modified, including optimization of the layer normalization LN layer and adjustment of the network depth. The number of layers in the original ConvNeXt was increased to 4 to increase the network depth. Each block contains multiple convolutional layers and branches. Ret attention components were embedded in the 1st, 3rd and 5th convolutional blocks of ConvNeXt to enhance the model's perception ability and form a RetNeXt network model. S300: The RetNeXt model is trained using the cleaned dataset, with supervised fine-tuning during training to ensure that the model can accurately recognize facial expressions, age, gender, and race. S400: Input the face image to be detected into the trained model. The model uses Ret Attention’s unique attention mechanism and ConvNeXt’s powerful feature extraction method to extract key features from the face image. S500: Uses a trained model to infer facial attributes, including expression, age, gender, and race.

2. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks according to claim 1, characterized in that, The specific content of step S100 is as follows: Images are acquired through multiple acquisition methods. Images that do not show the face are filtered out, and only images that can clearly identify the face are retained. The acquired image data needs to be cleaned. During the cleaning process, a certain proportion of images with large deflection angles are retained to ensure that the model can recognize the face at different angles. At the same time, some images with excessively high and low lighting quality are also retained to increase the diversity of the data. The cleaned images need to be labeled with attributes. In order to ensure the balance of model training, oversampling or undersampling techniques are used to balance the dataset to ensure that the number of samples for each attribute category is similar.

3. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks according to claim 1, characterized in that, The specific content of step S300 is as follows: The large-scale facial attribute dataset of minors, which has been cleaned and labeled, is imported into the RetNeXt network for training. During the training process, three strategies are adopted. The first approach: Warm start strategy: A strategy called "warm start" is first implemented, which uses the Adam optimizer to set the learning rate to 0.03 during the first 10 epochs of training; The second method is cosine annealing learning rate adjustment: As training progresses, a cosine annealing strategy is used to dynamically adjust the learning rate. When the value of the loss function tends to stabilize, the learning rate is gradually reduced and stopped when it is reduced to 5e-6. This strategy is based on the observation that in the later stages of training, the learning rate is finely adjusted to precisely optimize the parameters of the model. The third approach is to introduce new data for fine-tuning: new datasets are introduced during training to improve the model's generalization ability, while the learning rate is increased to three times the minimum learning rate and kept constant. This new data accounts for 10% of the total original dataset.

4. A method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks according to claim 1, characterized in that, The specific content of S400 is as follows: After the image is input into the network, it passes through the Ret attention layer, which utilizes a unique QKVD matrix. This matrix better captures the correlation between local and global features, enabling the network to more effectively understand the relationship between different parts of the image, thereby improving the feature representation ability. The ConvNeXt layer performs general feature map extraction based on different label attributes, flexibly adapting to different attribute recognition tasks, making the model more universal and generalizable. At the end of the model, four classifiers are designed to realize the recognition of gender, age, race and expression respectively.

5. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks according to claim 1, characterized in that, The data collection methods are any one or more of the following: image search engines, social media platforms, and other legitimate methods.

6. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks according to claim 2, characterized in that, The attribute labels include gender, age group labels, and race.

7. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt networks according to claim 4, characterized in that, The specific details of the four classifiers are as follows: Age classifier: This process involves a detailed analysis of a range of key features, including facial wrinkles, skin tone, and facial proportions. Race Classifier: The core task of a race classifier is to identify the race of people in an image. It relies on features extracted from advanced RetNeXt networks. These features include a range of facial attributes closely related to race, such as skin color, facial structure, and the shape of the eyes and nose. By analyzing these features, the classifier can categorize people in an image into a specific race category. Facial Expression Classifier: A facial expression classifier identifies facial expressions from images. This task covers a range of basic human emotional expressions, including happiness, sadness, anger, and surprise. It focuses on analyzing various key facial features. A facial expression classifier includes a predictor and a scorer. The predictor makes an initial prediction of the expression by processing facial features to infer the expression of a person in the image. The scorer intervenes, evaluating and scoring the output of the predictor. It helps to identify and correct any possible errors or inaccuracies, thereby optimizing the entire facial expression recognition process.

Citation Information

Patent Citations

  • Multi-attribute identification and model training method and device, equipment and storage medium

    CN116129214A

  • Flow-by-flow multi-mode network flow prediction method

    CN117155808A