Juvenile face attribute analysis method based on Ret attention and ConvNeXt network
By using the fusion method of Ret attention and ConvNeXt network in facial attribute recognition for minors, the RetNeXt network model is constructed, and the problem of insufficient accuracy and generalization capabilities in the prior art is solved, and high accuracy and adaptive facial attribute recognition is achieved.
Patent Information
- Application Number
- CN202411390998.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-08
- Publication Date
- 2025-03-11
- Estimated Expiration
- 2044-10-08
AI Technical Summary
The prior art has problems with insufficient accuracy and generalization ability in facial attribute recognition for minors, especially when dealing with facial recognition at different angles and light conditions.
The RetNeXt network model is constructed using a fusion method based on Ret attention and ConvNeXt network. In the model, the Ret attention mechanism is used to enhance attention to important areas of the image, and the ConvNeXt network improves feature extraction capabilities through multi-path feature extraction.
It significantly improves the accuracy and generalization ability of facial attribute recognition for minors, and can accurately identify gender, age, race and expression attributes at different angles and light conditions.
Smart Images

Figure CN119600657A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer vision technology, and in particular to a facial attribute analysis method for minors based on Ret attention and ConvNeXt network. Background Art
[0002] Minor attribute recognition is a highly concerned issue in the field of computer vision. It aims to infer the gender, age, expression and race of minors by analyzing their facial images. This task has a wide range of applications, covering various fields from child protection to targeted advertising. In order to achieve minor attribute recognition, researchers continue to explore various methods and technologies, among which deep learning-based methods have made significant progress in recent years. Minor attribute recognition is a challenging task that requires computer systems to automatically infer minors' gender, age, expression and race from facial images. This task has important application value in many fields, such as: Child protection: In the Internet age, children have become the target of bad information and potential threats on the Internet. By identifying minors, it can help monitor and protect them from potential risks. Targeted advertising: Many advertising companies want to deliver advertisements to audiences of specific age and gender. Minor attribute recognition can help advertising companies target their advertisements more accurately. Education: In the field of education, identifying students' age and emotional state can help educators better understand their needs and emotional state, 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 decision-making.
[0003] The Ret Attention Network is a deep learning-based visual processing network inspired by the fact that the human visual system pays different attention to different regions in an image. This network combines the attention mechanism and residual connections to improve the perception and utilization of important information in an image. In the attribute recognition of minors, the application of the Ret Attention Network can help the model better understand the information of different regions in a facial image, thereby improving the accuracy of attribute recognition. The Ret Attention Network achieves attention to different regions of an image by introducing the 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 can help the network determine which regions are more important. Value calculation: Next, the Value vector is calculated for each pixel, which contains the information of the pixel. Dependency calculation: By calculating the correlation between the Query and Key, a Dependency matrix is generated to measure the dependency 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 of each pixel to adjust the importance of the pixel. This process can be seen as weighting the image to focus more attention on important areas. Through the above steps, the Ret Attention network can better capture the information of different areas in the image and improve the accuracy of attribute recognition.
[0004] The ConvNeXt network is a deep convolutional neural network structure that improves the extraction ability of feature maps by combining multiple branch networks. This network structure is inspired by the multi-path information transmission of the network, which can effectively capture features of different scales and levels in the image. The core idea of the ConvNeXt network is to combine different convolution branches to obtain more representative features. Its working principle is as follows: Multi-branch structure: The ConvNeXt network contains multiple convolution branches, each of which can extract features of different levels and scales. Weight parameters are shared between these branches to effectively learn features. Feature fusion: The feature maps extracted by different branches are integrated through the feature fusion layer to generate more representative features. This process helps the network better understand the information in the image. Multi-label classification: Finally, the ConvNeXt network predicts different attribute labels through multiple classifiers. This enables the network to perform recognition tasks of multiple attributes at the same time.
[0005] The present invention proposes a method for identifying attributes of minors based on Ret Attention and ConvNeXt network and combines attention mechanism and multi-path feature extraction, which has high accuracy and generalization ability. Summary of the invention
[0006] In response to the above technical problems, the present invention provides a facial attribute analysis method for minors based on Ret Attention and ConvNeXt network, a facial attribute analysis method for minors that integrates Ret Attention and ConvNeXt network, which only requires input of facial images of minors to obtain gender, age, race and expression attributes, thereby providing auxiliary information for the education of minors.
[0007] To achieve the above object, the technical solution of the present invention is as follows:
[0008] A facial attribute analysis method for minors based on Ret attention and ConvNeXt network, the specific steps 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 a variety of acquisition methods. Images that do not show faces are filtered out, and only images that can clearly identify faces are retained. The acquired image data needs to be cleaned. During the cleaning process, a certain proportion of images with larger deflection angles are retained to ensure that the model can recognize faces at different angles. At the same time, some images with too high or too low light quality are retained to increase data diversity. The cleaned images need to be annotated with attributes, and in order to ensure the balance of model training, oversampling or undersampling techniques are used to balance the data set to ensure that the number of samples in each attribute category is similar.
[0011] S200: Build a deep convolutional neural network model, and build a RetNeXt network by fusing Ret Attention and ConvNeXt networks to recognize facial attributes;
[0012] The original ConvNeXt structure is expanded to increase the depth of the network. At the same time, Retina Attention components are embedded in the 1st, 3rd, and 5th blocks. The number of layers of the original ConvNeXt is increased to 4 to increase the network depth. There will be 4 convolutional layer blocks, each of which contains multiple convolutional layers and branches. Retina Attention components are embedded in the 1st, 3rd, and 5th convolutional blocks. Retina Attention modules are inserted in specific blocks to enhance the perception ability of the model and form a RetNeXt network model. Among them, the Ret structure simulates the retention phenomenon of the human retina with its powerful retention mechanism. It is specifically evolved based on the original transformer structure. In the original Transformer model, the output is calculated as follows: the input matrix X is multiplied by three weight matrices W Q , W K and W V To create the query matrix Q, key matrix K and 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 with 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 loop and parallel processing mechanism is integrated in the Ret structure by introducing so-called "reserved" blocks in the loop pattern. These blocks process each "n" element of the input data separately. Subsequently, in order to improve efficiency, these loop reserved blocks are converted into vectorized form, as follows:
[0018]
[0019] In addition, the Ret structure also adds causal masking and exponential decay. The D-matrix serves as both a causal mask and an exponential decay weighting scheme for past positions, as follows:
[0020]
[0021] When processing sequence data, in order to maintain the consistency of time order and prevent the early leakage of future information, causal masking is applied to the self-attention mechanism, introducing a state vector S, which is passed from one time step to the next time step, carrying time or position information. At each time step, this S n-1 is multiplied by an exponential decay or discount factor v, which 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 setting T , now the first operation is K T V, while the query matrix Q is calculated in the later steps. The calculation order is different in the parallel training phase and the inference phase, as follows:
[0022]
[0023] Ret(x n )=Q n S n ; n=1,2,....,|X|,
[0024] S300: Use the cleaned dataset to train the RetNeXt model, adopt strategies to supervise fine-tuning during the training process, optimize the performance of the model and improve its generalization ability, and ensure that the model can accurately recognize facial expressions, age, gender, and race;
[0025] There are three strategies adopted. The first one is the warm start strategy. First, a strategy called "warm start" is implemented. The Adam optimizer is used 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, thereby accelerating the entire learning process, helping the model to quickly adapt to the basic characteristics of the data set, and achieve significant performance improvements in the early stages of training. The second one is cosine annealing learning rate adjustment: As the training progresses, the cosine annealing strategy is used to dynamically adjust the learning rate. When the loss (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 adjusted. The learning rate is slightly adjusted to accurately optimize the model's parameters. In this way, the model can be more finely "fine-tuned" when it is close to the optimal solution, thereby avoiding fluctuations caused by excessive learning rates and ensuring a smooth and efficient training process. The third type. Introducing new data for fine-tuning: New data sets are introduced during training to improve the generalization ability of the model. At the same time, the learning rate is increased to 3 times the minimum learning rate and remains unchanged. These new data account for 10% of the total original data set. The purpose of this step is to enable the model to adapt to and learn data samples that it has never encountered before. By introducing these new samples for fine-tuning in the later stages of training, the model's recognition ability for unseen data is significantly improved.
[0026] S400: Input the face image to be detected into the trained model, which uses the unique attention mechanism of Ret Attention and the powerful feature extraction method of ConvNeXt to extract key features from the face image;
[0027] After being processed by the RetNeXt network, the image data is converted into a set of rich feature vectors that capture the key visual information in the image. These feature vectors are then used to drive four independent attribute task classifiers, each of which classifies a specific facial attribute. The classifier focuses on determining the gender of the person in the image. It analyzes the features extracted from the RetNeXt network and identifies gender-related patterns and features, including differences in facial structure, hairstyle, etc., and finally outputs a judgment on the gender of the person in the image. The four classifiers are as follows:
[0028] Age Classifier: This process is a detailed analysis of a range of key features, including facial wrinkles, skin tone, and facial proportions.
[0029] Race Classifier: The core task of the race classifier is to identify the race of people in an image. It relies on features extracted from an advanced RetNeXt network. These features include a series of facial attributes that are closely related to race, including skin color, facial structure, and the shape of eyes and nose. By analyzing these features, the classifier is able to classify the people in the image into a specific racial category.
[0030] Expression classifier: Expression classifier identifies facial expressions of people 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. Expression classifier includes predictor and scorer. The predictor performs preliminary expression prediction and infers the expression of the person in the image by processing facial features. The scorer intervenes and evaluates and scores the output of the predictor. It helps to identify and correct any possible errors or inaccuracies, thereby optimizing the entire expression recognition process.
[0031] S500. Using the trained model, infer attributes of the face, including expression, age, gender, and race.
[0032] Specifically, the acquisition method is any one or more of the following: image search engines, social media platforms, and other legal methods.
[0033] Specifically, the attribute labeling includes gender, age group labels and ethnic attributes, which can be completed through manual labeling or using advanced computer vision technology.
[0034] Specifically, the Retina Attention is an attention mechanism that is typically used to enhance the model's focus on important areas in an image. This technology may be particularly effective in identifying facial features of minors and adults because there are significant differences in facial texture between these two age groups. Generally, minors have more delicate skin texture, while adults' faces may show more lines and wrinkles. Using such technology can help improve the accuracy of facial recognition systems, especially in application scenarios that require accurate distinction between people of different age groups.
[0035] Specifically, for any two positions n and m in the sequence of the D matrix in step S200, when n>m, the corresponding elements 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 the information at position m (any position after n), thereby ensuring the causality of 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 γ, which represents that as time goes by, the importance of past marks to the current time step gradually decreases. In other words, the farther a mark is from the current step in time, the smaller its influence on the current step.
[0036] Specifically, the three strategies in step S300 are used in any combination. The combination of these strategies can not only accelerate the training process of the model, but also significantly improve the generalization ability of the model and its performance in real-world scenarios. In addition, through this comprehensive training method, the RetNeXt network is effectively adjusted and optimized to meet the needs of specific tasks, namely, accurately identifying and processing the facial attributes of minors.
[0037] Specifically, the age classifier is composed of three fully connected layers. The first fully connected layer has 128 neurons, which is responsible for extracting preliminary features from the input data. It is followed by a larger 256-dimensional fully connected layer, which further strengthens the processing and integration of these features in order to capture more complex age-related patterns. Finally, the third fully connected layer is an 18-dimensional layer, whose purpose is to compress these complex patterns into a more concise representation, so that the model can output a specific age range prediction.
[0038] Specifically, the ethnic classifier consists of two fully connected layer structures. The first fully connected layer has 1024 neurons. The large-scale dimension 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, which is specially designed to convert this rich information into the final ethnic classification.
[0039] Beneficial effects of the present invention:
[0040] The present invention designs a facial attribute analysis method for minors that integrates Ret Attention and ConvNeXt networks. Only by inputting the facial image of the minor, the gender, age, race and expression attributes can be obtained, providing auxiliary information for the education of minors.
[0041] ConvNeXt in the present invention adopts a modified convolution block design, which uses layer normalization (Layer Normalization) similar to Transformer instead of traditional batch normalization (Batch Normalization). ConvNeXt widely uses deep separable convolution in its architecture, which is an efficient convolution method that can significantly reduce the number of model parameters and computational complexity. ConvNeXt simplifies the network design and removes some complex structures commonly found in traditional CNNs. This simplification helps the scalability and flexibility of the model. This technology has a special effect in identifying facial features of minors and adults because there are significant differences in facial textures between these two age groups. Generally, the skin texture of minors is more delicate, while the face of an adult may show more lines and wrinkles. Using such a technology can help improve the accuracy of facial recognition systems, especially in application scenarios where it is necessary to accurately distinguish between people of different age groups;
[0042] The RetNeXt network of the core extractor designed by the present invention converts image data into a set of rich feature vectors when processing data, and these feature vectors are then used to drive four independent attribute task classifiers. Through these four classifiers, a comprehensive and detailed face attribute analysis is provided, which is crucial for applications such as face recognition, social media analysis, and crowd monitoring. This method not only improves the accuracy of classification, but also has good adaptability and scalability because it is based on a deep learning method. The combined use of these classifiers enables the system to accurately and deeply analyze face attributes in a variety of different environments and conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 A Ret structure diagram of a facial attribute analysis method for minors based on Ret attention and ConvNeXt network of the present invention;
[0044] Figure 2 A RetNeXt structure diagram of a 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 facial attribute analysis method for minors based on Ret attention and ConvNeXt network of the present invention. DETAILED DESCRIPTION
[0046] The technical solution of the present invention will be described clearly and completely below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0047] Example 1
[0048] The present invention proposes a method for analyzing facial attributes of minors by integrating Ret Attention and ConvNeXt networks. Only by inputting facial images of minors, gender, age, race and expression attributes can be obtained, providing auxiliary information for minors' education. The model of the present invention is mainly divided into a model training part and a model reasoning part. The model training part mainly collects a large number of facial images of minors, and then sends them into the RetNeXt network according to attributes such as gender, age, expression and race. The model training part specifically includes the following steps:
[0049] S100: Collect a large amount of image data of minors for cleaning, classification and labeling. This can be obtained through various channels, 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, and only images that can clearly identify faces will be retained. During the data cleaning process, a certain proportion of images with larger deflection angles will be retained to ensure that the model can recognize faces at different angles. At the same time, some images with too high and too low light quality will be retained to increase the diversity of the data. The cleaned images need to be attributed. This includes labeling each image with information such as gender, age group, expression, and ethnic attributes. This information can be done manually or using advanced computer vision technology. In order to ensure the balance of model training, the number of samples in each attribute category needs to be kept as close as possible. This means that techniques such as oversampling or undersampling may need to be used to balance the dataset.
[0050] S200: Build a RetNeXt deep convolutional neural network model that combines Ret attention and ConvNeXt to recognize face attributes.
[0051] The original ConvNeXt structure is expanded to increase the depth of the network, while Retina Attention components are embedded in the 1st, 3rd, and 5th blocks. To increase the depth of the network, the number of layers of the original ConvNeXt can be increased to 4. This means that there will be 4 convolutional layer blocks, each containing multiple convolutional layers and branches. In the 1st, 3rd, and 5th convolutional blocks, Retina Attention components are embedded. Retina Attention is an attention mechanism that is often used to enhance the model's attention to important areas in an image. This technique may be particularly effective in identifying facial features of minors and adults because there are significant differences in facial texture between these two age groups. Typically, minors have more delicate 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 people of different age groups. In these specific blocks, Retina Attention modules can be inserted to enhance the model's perception capabilities. The Ret structure simulates the retention phenomenon of the human retina with its powerful retention mechanism. Specifically, it evolved based on the original transformer structure. In the original Transformer model, the output is calculated as follows: the input matrix X is multiplied by three weight matrices W Q , W K and W V To create the query matrix Q, key matrix K, and value matrix V. Calculate the dot product of the query matrix Q and the key matrix K, and then apply the softmax function to get the attention weights. These attention weights are multiplied with 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 loop and parallel processing mechanism is integrated in the Ret structure. This is achieved by introducing so-called "reserved" blocks in the loop pattern, which process each "n" element in the input data separately. Subsequently, in order to improve efficiency, these loop reserved blocks are converted into vectorized form, as follows:
[0057]
[0058] In addition, the Ret structure also incorporates causal masking and exponential decay. The D-matrix serves as both a causal mask and an exponential decay weighting scheme for past positions.
[0059]
[0060] When processing sequence data, causal masking is applied to the self-attention mechanism in order to maintain the consistency of the time order and prevent the early leakage of future information. Specifically, for any two positions n and m in the sequence, if n>m, then in the calculation of Q·K T , the corresponding element will be set to 0. This is done to ensure that when processing position n, the model will not be affected by the information at position m (any position after n), thereby ensuring the causal nature of sequence processing. For the case of n ≤ m, that is, when processing current or past information, Q·K T The result is weighted by an exponential decay factor γ. This represents the decreasing importance of past marks to the current time step as time goes by. In other words, the farther a mark is from the current step in time, the less influence it has 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 time step, carrying time or position information. At each time step, this S n-1 is multiplied by an exponential decay or discount factor v, which 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 setting T , now the first operation is K T V, while the query matrix Q is calculated in the later steps. This calculation order is different in the parallel training phase and the inference phase.
[0062]
[0063] Ret(x n )=Q n S n ; n=1,2,....,|X|
[0064] ConvNeXt adopts a modified convolutional block design that uses layer normalization similar to Transformer instead of traditional batch normalization.
[0065] ConvNeXt widely uses depthwise separable convolution in its architecture, which is an efficient convolution method that can significantly reduce the number of model parameters and computational complexity. ConvNeXt simplifies the network design and removes some complex structures commonly found in traditional CNNs, such as dense connections and residual connections. This simplification helps the scalability and flexibility of the model. On this basis, the number of layers of the convolutional block is deepened, so that it has the ability to extract features of four tasks at the same time, such as Figure 2 As shown,
[0066] The number of convolution blocks is changed to 4 at the 1st, 3rd, and 5th stages. On this basis, the Ret structure is embedded to form the RetNeXt network model.
[0067] S300: Use the cleaned dataset to train the RetNeXt model and supervise fine-tune the training process to ensure that the model can accurately recognize facial expressions, age, gender, and race.
[0068] During the training process, several key strategies were adopted to optimize the performance of the model and improve its generalization ability: 1. Warm start strategy: First, 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, thereby accelerating the entire learning process. This approach is particularly helpful for the model to quickly adapt to the basic characteristics of the dataset and achieve significant performance improvements in the early stages of training. 2. Cosine annealing learning rate adjustment: As the training progresses, a cosine annealing strategy is adopted to dynamically adjust the learning rate. Specifically, this means that when the loss (the value of the loss function) tends to stabilize, the learning rate will be gradually reduced. Stop when it is reduced to 5e-6. This strategy is based on the observation that in the later stages of training, subtle adjustments to the learning rate can more accurately optimize the parameters of the model. In this way, the model can be more finely "fine-tuned" when it is close to the optimal solution, thereby avoiding fluctuations caused by excessive learning rates and ensuring a smooth and efficient training process. 3. Introducing new data for fine-tuning: In order to further improve the generalization ability of the model, new data sets were introduced during the training process, and the learning rate was increased to 3 times the minimum learning rate and remained unchanged. These new data accounted for 10% of the total original data set. The purpose of this step is to enable the model to adapt and learn data samples that it has never encountered before. By introducing these new samples for fine-tuning in the later stages of training, the model's recognition ability for unseen data can be significantly improved, which is crucial for various unknown situations faced in practical applications. The combined use of these strategies not only speeds up the training process of the model, but also significantly improves the generalization ability of the model and its performance in real-world scenarios. Through this comprehensive training method, the RetNeXt network is effectively adjusted and optimized to meet the needs of specific tasks, namely accurately identifying and processing the facial attributes of minors.
[0069] The model reasoning part specifically includes the following steps:
[0070] S400: Input the face image to be detected into the trained model, which uses the unique attention mechanism of Ret Attention and the powerful feature extraction method of ConvNeXt 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 is able to effectively extract robust features from the image, which reflect the deep information of the image and are key to further analysis and classification. After being processed by the RetNeXt network, the image data is converted into a set of rich feature vectors that capture the 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 the person in the image. It analyzes the features extracted from the RetNeXt network and identifies gender-related patterns and features. This may include differences in facial structure, hairstyle, etc., and ultimately outputs 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 color, and facial proportions. In this specific age classifier, a structure of three fully connected layers is used. The first fully connected layer has 128 neurons, which 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 in order 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 compact representation, allowing the model to output a specific age range prediction. Race Classifier: The core task of the race classifier is to identify the race of the person in the image. To accomplish this task, it relies on features extracted from the advanced RetNeXt network. These features include a series of facial attributes that are closely related to race, such as skin color, facial structure, and the shape of the eyes and nose. By analyzing these features, the classifier is able to classify the person in the image into a specific race category, such as Asian, African, or Caucasian. In terms of its structure, this race classifier consists of two fully connected layers. The first fully connected layer has 1024 neurons. The large dimensionality of this layer allows the model to capture rich information from the complex features extracted by the RetNeXt network. The second fully connected layer that follows is a 7-dimensional layer, which is specifically designed to transform this rich information into the final race classification. Expression Classifier: The main responsibility of the expression classifier is to identify the facial expressions of people from images. This task covers a range of basic human emotional expressions such as happiness, sadness, anger, and surprise. In order to perform this task accurately, the classifier focuses on analyzing various key facial features, such as the movement of facial muscles, the position of eyes and mouth, etc. These features are key to understanding and recognizing human expressions. Technically, the expression classifier consists of two main parts: predictor and scorer. The role of the predictor is to make preliminary expression predictions. It processes facial features to infer the expression of the person in the image.Then, the scorer comes in to evaluate and score the output of the predictor. This scoring process helps to identify and correct any possible errors or inaccuracies, thereby optimizing the entire expression recognition process. Through these four specialized classifiers, the system is able to provide a comprehensive and detailed analysis of facial attributes, which is critical for applications such as face recognition, social media analysis, and crowd monitoring. This approach not only improves the accuracy of classification, but also has good adaptability and scalability because it is based on a deep learning method. The combination of these classifiers enables the system to accurately and deeply analyze facial attributes in a variety of different environments and conditions.
[0072] S500. Use the model to infer attributes of the face, including expression, age, gender, and race.
[0073] The above shows and describes the basic principles and main features of the present invention and the advantages of the present invention. The present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A facial attribute analysis method for minors based on Ret attention and ConvNeXt network, the specific steps are as follows: S100: Collect a large amount of image data of minors, clean it, and classify and label the image data; S200: Build a deep convolutional neural network model, and build a RetNeXt network by fusing Ret Attention and ConvNeXt networks to recognize facial attributes; S300: Use the cleaned dataset to train the RetNeXt model, and supervise fine-tuning during the training process 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, which uses the unique attention mechanism of Ret Attention and the powerful feature extraction method of ConvNeXt to extract key features from the face image; S500. Using the trained model, infer attributes of the face, including expression, age, gender, and race.
2. According to claim 1, a facial attribute analysis method for minors based on Ret attention and ConvNeXt network is characterized in that: The specific contents of step S100 are as follows: images are acquired through a variety of acquisition methods, images that do not show faces are filtered out from the acquired images, and only pictures that can clearly identify faces are retained. The acquired image data needs to be cleaned. During the cleaning process, a certain proportion of images with larger deflection angles are retained to ensure that the model can recognize faces at different angles. At the same time, some images with too high or too low light quality are retained to increase data diversity. The cleaned images need to be annotated with attributes, and in order to ensure the balance of model training, oversampling or undersampling techniques are used to balance the data set to ensure that the number of samples in each attribute category is similar.
3. The facial attribute analysis method for minors based on Ret attention and ConvNeXt network according to claim 1, characterized in that: The specific content of step S200 is as follows: integrating the unique QKVD (Query, Key, Value, Dynamic) attention mechanism in Ret Attention into the ConvNeXt network to further improve the performance of the model, enhance the network's capabilities, and increase the sensitivity to the characteristics of minors, and modifying and expanding the original ConvNeXt structure to increase the depth of the network. At the same time, Retina Attention components are embedded in the 1st, 3rd, and 5th blocks, and the original ConvNeXt network is modified. The modifications include optimizing the layer normalization (LN) layer and adjusting the network depth. The number of layers of the original ConvNeXt is increased to 4 to increase the network depth, so there will be 4 convolution layer blocks, each block contains multiple convolution layers and branches, and Retina Attention components are embedded in the 1st, 3rd, and 5th convolution blocks. RetinaAttention modules are inserted in specific blocks to enhance the perception ability of the model and form a RetNeXt network model.
4. The facial attribute analysis method for minors based on Ret attention and ConvNeXt network according to claim 1, characterized in that: The specific contents of step S300 are as follows: a large-scale facial attribute dataset of minors that has been cleaned and labeled is imported into the RetNeXt network for training. During the training process, three strategies are adopted. The first one is the warm start strategy: first, a strategy called "warm start" is implemented. The Adam optimizer is used to set the learning rate to 0.03 during the first 10 epochs of training. This relatively high initial learning rate helps the model to converge quickly in the early stages of training, thereby accelerating the entire learning process, helping the model to quickly adapt to the basic characteristics of the dataset, and achieve significant performance improvements in the early stages of training. The second one is the cosine annealing learning rate adjustment: as the training progresses, the cosine annealing strategy is used to dynamically adjust the learning rate. When the loss (the value of the loss function) tends to be stable, the learning rate is gradually reduced. When the loss is reduced, the learning rate is gradually reduced. Stop when it is as low as 5e-6. This strategy is based on the observation that in the later stages of training, the learning rate is slightly adjusted to accurately optimize the model's parameters. In this way, the model can be more finely "fine-tuned" when it is close to the optimal solution, thereby avoiding fluctuations caused by excessive learning rates and ensuring a smooth and efficient training process. The third type. Introducing new data for fine-tuning: New data sets are introduced during training to improve the generalization ability of the model, while the learning rate is increased to 3 times the minimum learning rate and remains unchanged. These new data account for 10% of the total original data set. The purpose of this step is to enable the model to adapt to and learn data samples that it has never encountered before. By introducing these new samples for fine-tuning in the later stages of training, the model's recognition ability for unseen data is significantly improved.
5. The facial attribute analysis method for minors based on Ret attention and ConvNeXt network according to claim 1, characterized in that: The specific contents of S400 are as follows: after the image is input into the network, it passes through the Ret Attention layer, in which this layer utilizes a unique QKVD matrix, which better captures the correlation between local and overall features, so that the network can more effectively understand the connection between different parts of the image, thereby improving the feature representation capability; the ConvNeXt layer extracts common feature maps according to different label attributes, flexibly adapts to different attribute recognition tasks, and makes the model more versatile and generalizable; four classifiers are designed at the end of the model to respectively realize the recognition of gender, age, race, and expression.
6. The facial attribute analysis method for minors based on Ret attention and ConvNeXt network according to claim 2, characterized in that: The acquisition channels are any one or more of the following: image search engines, social media platforms, and other legal channels.
7. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt network according to claim 2, characterized in that: The attribute labels include gender, age group labels, and ethnicity.
8. The method for analyzing facial attributes of minors based on Ret attention and ConvNeXt network according to claim 5, characterized in that: The specific contents of the four classifiers are as follows: Age Classifier: This process is a detailed analysis of a range of key features, including facial wrinkles, skin tone, and facial proportions. Race Classifier: The core task of the race classifier is to identify the race of people in an image. It relies on features extracted from an advanced RetNeXt network. These features include a series of facial attributes that are closely related to race, including skin color, facial structure, and the shape of eyes and nose. By analyzing these features, the classifier is able to classify the people in the image into a specific racial category. Expression classifier: Expression classifier is to identify the facial expressions of people from images. This task covers a series of basic human emotional expressions, including happiness, sadness, anger and surprise, etc. It focuses on analyzing various key facial features. Expression classifier includes predictor and scorer. The predictor performs preliminary expression prediction and infers the expression of the person in the image by processing facial features. The scorer is involved and its function is to evaluate and score the output results of the predictor, which helps to identify and correct any possible errors or inaccuracies, thereby optimizing the entire expression recognition process.
Citation Information
Patent Citations
Face age estimation method and system fusing gender and racial information
CN113920413A
Multi-attribute identification and model training method and device, equipment and storage medium
CN116129214A
Flow-by-flow multi-mode network flow prediction method
CN117155808A
Student real-time emotion recognition method based on fusion attention mechanism
CN118537907A
Cited By
Network access identity auditing method and system based on multi-modal data fusion
CN122133085A
Network access identity auditing method and system based on multi-modal data fusion
CN122133085B