Face recognition method and intelligent computer all-in-one machine applying face recognition method

By performing image descriptor extraction and deep semantic feature extraction on face images, combined with multi-task recognition and fusion of importance coefficients, the instability problem of face recognition in the prior art in specific scenarios is solved, and the accuracy and reliability of recognition are improved.

CN119559685APending Publication Date: 2025-03-04HUILIAN CLOUD TECH(SHENZHEN) CO LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411964149.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-30
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The existing multi-task facial recognition method cannot adaptively adjust the importance of each task in the final recognition results, resulting in unsatisfactory recognition results in certain specific scenarios and unstable reliability of facial recognition.

Method used

By extracting image descriptors and extracting deep semantic feature of target face images that treat the recognition face, multiple recognition tasks are determined, and face recognition inference is performed on the target semantic descriptors based on each task, combining the recognition results of the importance coefficients of each task.

Benefits of technology

Adaptively determine the importance coefficients of each recognition task, and fuse the face recognition inference results of multi-tasks, improving the accuracy and reliability of face recognition.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119559685A_ABST
    Figure CN119559685A_ABST
Patent Text Reader

Abstract

The invention provides a face recognition method and an intelligent computer all-in-one machine applying the face recognition method, and the method comprises the steps: carrying out the image descriptor extraction of a target face image of a to-be-recognized face, and obtaining a face descriptor corresponding to the target face image; and performing deep semantic feature extraction on the face descriptor to obtain a target semantic descriptor. And determining A recognition tasks corresponding to the target face image, and performing face recognition reasoning on the target semantic descriptor by adopting each recognition task to obtain a face recognition reasoning result corresponding to each recognition task. And carrying out influence evaluation on the face descriptors to obtain an importance coefficient corresponding to each recognition task. And in combination with the face recognition reasoning result corresponding to each recognition task and the importance coefficient corresponding to each recognition task, the face recognition result of the face to be recognized is determined, and by adopting the face recognition method and device, the reliability of face recognition can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a face recognition method and an intelligent computer all-in-one machine using the face recognition method. Background Art

[0002] Traditional face recognition methods usually rely on a single recognition task, such as identity matching based only on facial features. This method often has problems with low recognition accuracy and insufficient robustness when dealing with complex and changeable practical application scenarios. In order to improve the accuracy and reliability of face recognition, researchers have begun to explore multi-task learning methods. In the field of face recognition, multi-task learning can enrich the feature representation of the model by introducing multiple recognition tasks (such as shooting environment recognition, lighting condition recognition, facial expression recognition, etc.), thereby improving recognition performance. Most existing multi-task face recognition methods use a fixed weight method to fuse the results of different tasks. This method cannot adaptively adjust the importance of each task in the final recognition result, resulting in unsatisfactory recognition results in certain specific scenarios and unstable reliability of face recognition. Summary of the invention

[0003] In view of this, the present application provides a face recognition method and a smart computer all-in-one machine using the face recognition method. The technical solution of the present application is implemented as follows: On the one hand, the present application provides a face recognition method, which includes: extracting image descriptors for a target face image of a face to be recognized, and obtaining a face descriptor corresponding to the target face image; performing deep semantic feature extraction on the face descriptor, and obtaining a target semantic descriptor corresponding to the face descriptor; determining A recognition tasks corresponding to the target face image, and performing face recognition inference on the target semantic descriptor based on each recognition task, and obtaining a face recognition inference result corresponding to each recognition task, where A is a natural number greater than 0; performing influence evaluation on the face descriptor, and obtaining an importance coefficient corresponding to each recognition task; and determining a face recognition result for the face to be recognized based on the face recognition inference result corresponding to each recognition task and the importance coefficient corresponding to each recognition task.

[0004] On the other hand, the present application provides an intelligent computer all-in-one machine that applies a face recognition method, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the above-mentioned method are implemented.

[0005] This application extracts image descriptors from the target face image to obtain a face descriptor, and determines A recognition tasks at the same time. When the target semantic descriptor is obtained based on the face descriptor, the face recognition reasoning result corresponding to each recognition task is obtained through the target semantic descriptor, and the importance coefficient corresponding to each recognition task is determined based on the face descriptor, and then the face recognition reasoning results corresponding to each recognition task are integrated to obtain the face recognition result. This application can integrate the face recognition capabilities of each recognition task, adaptively determine the importance coefficient of the target face image for each recognition task, obtain the most appropriate distribution of importance coefficients of the current target face image on each recognition task, and obtain the most appropriate face recognition result of the recognition task corresponding to the current target face image. In this way, the face recognition reasoning results of multiple recognition tasks can be combined to obtain accurate face recognition results. It is not limited to face recognition of one recognition task. Accurate face recognition can be performed for each recognition task to improve the reliability of face recognition. BRIEF DESCRIPTION OF THE DRAWINGS

[0006] Figure 1 A schematic diagram of the implementation flow of a face recognition method provided in an embodiment of the present application.

[0007] Figure 2 A hardware entity schematic diagram of a smart all-in-one computer provided in an embodiment of the present application. DETAILED DESCRIPTION

[0008] The embodiment of the present application provides a face recognition method, which can be executed by a processor of a smart all-in-one computer. A smart all-in-one computer is a computer device that integrates multiple functions and technologies. It integrates the host, display, keyboard, mouse and other components of a traditional desktop computer to form a compact and efficient computing platform. This design not only saves space, but also improves the usability and aesthetics of the device.

[0009] Figure 1 A schematic diagram of the implementation flow of a face recognition method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method includes: Step S110: extracting image descriptors from the target face image to be recognized, and obtaining face descriptors corresponding to the target face image.

[0010] Image descriptor extraction usually relies on machine learning models, especially deep learning models such as convolutional neural networks (CNNs). These models are trained on a large number of face images and can learn the key features in face images and encode them into vectors or arrays, namely image descriptors. These descriptors contain geometric features of the face (such as the position and shape of the eyes, nose, and mouth), texture features (such as skin texture, shadows, and lighting changes), and global features (such as the overall shape and size of the face).

[0011] Taking the convolutional neural network as an example, the model consists of multiple convolutional layers, pooling layers, and fully connected layers. In the process of image descriptor extraction, the target face image is first input into the convolutional layer, and the local features of the image are extracted by convolution operation between the convolution kernel and the local area of ​​the image. These local features are then passed to the pooling layer, and the dimension of the features is reduced and the most significant feature information is retained through operations such as maximum pooling or average pooling. After alternating processing of multiple convolutional layers and pooling layers, the model can gradually extract facial features from low-level to high-level.

[0012] Finally, these high-level features are input into the fully connected layer and mapped into a fixed-length vector, the face descriptor, through a combination of linear transformation and nonlinear activation function. This vector contains the key feature information of the target face image and can be used for subsequent tasks such as face recognition, classification or retrieval. For example, suppose there is a trained face recognition convolutional neural network whose input is a 224×224 pixel RGB image and output is a 128-dimensional vector as a face descriptor. When the all-in-one computer receives a target face image of a face to be recognized, the image is first preprocessed, such as resizing and normalizing pixel values, to ensure that it meets the input requirements of the model. Then, the preprocessed image is input into the convolutional neural network. In the first convolutional layer, suppose there are 32 3×3 convolution kernels, which slide on the image with a stride of 1 and perform convolution operations on each local area. Each convolution kernel generates a feature map representing the local features of the image at different positions. After being processed by an activation function (such as ReLU), these feature maps are passed to the first pooling layer, where a 2x2 maximum pooling operation is performed to halve the dimension of the feature map while retaining the most significant feature information.

[0013] This process is repeated in subsequent convolutional layers and pooling layers. After each convolutional layer, the number of feature maps (also called the number of channels) increases, while the size of the feature maps gradually decreases. At the same time, as the network goes deeper, the extracted features gradually transition from low-level features (such as edges and textures) to high-level features (such as facial parts and overall shape).

[0014] Finally, after the last convolutional layer, one or more fully connected layers are usually connected. In the fully connected layer, each neuron is connected to all neurons in the previous layer, and the feature map is mapped to a vector of fixed length through linear transformation of the weight matrix and the bias vector. This vector is the face descriptor corresponding to the target face image.

[0015] Step S120: performing deep semantic feature extraction on the face descriptor to obtain a target semantic descriptor corresponding to the face descriptor.

[0016] Step S120 performs deep semantic feature extraction on the face descriptor generated in step S110, thereby obtaining a target semantic descriptor with more abstraction and discrimination. The core of this step is to use a deep learning model, especially a neural network, to further process and transform the face descriptor to dig out the deep semantic information hidden therein.

[0017] This step is achieved through the semantic mining layer, which receives the face descriptor from step S110 as input and maps it to a higher-dimensional or lower-dimensional semantic space through a series of complex nonlinear transformations to generate the target semantic descriptor. In this process, the model learns the complex relationship between the various features in the face descriptor and the correspondence between these features and specific semantic concepts.

[0018] Taking the convolutional neural network (CNN) as an example, the semantic mining layer is a combination of one or more fully connected layers, or a more complex structure, such as a recurrent neural network (RNN), a long short-term memory network (LSTM) or a Transformer, etc. These network structures have powerful nonlinear modeling capabilities and can capture subtle feature differences in face descriptors and map them to different points in the semantic space.

[0019] In the semantic mining layer, each neuron is connected to each feature in the input face descriptor, and an intermediate representation is generated through linear transformation of the weight matrix and bias vector. This intermediate representation is then processed through a nonlinear activation function (such as ReLU, Sigmoid, or Tanh) to increase the nonlinear ability and expressiveness of the model. This process is repeated in each neuron in the semantic mining layer until the final target semantic descriptor is generated.

[0020] For example, suppose there is a convolutional neural network whose semantic mining layer consists of a fully connected layer containing 1024 neurons. When the face descriptor generated in step S110 (assuming a 128-dimensional vector) is input into this layer, each neuron will perform a weighted summation with each feature in the face descriptor and process it through a nonlinear activation function. This process can be expressed as: ; where x is the input face descriptor (128-dimensional vector), W is the weight matrix (1024×128), and b is the bias vector (1024-dimensional). is a nonlinear activation function and h is an intermediate representation (1024-dimensional vector).

[0021] After being processed by the semantic mining layer, the intermediate representation h will be further mapped to the target semantic space to generate the target semantic descriptor. This mapping process may be a simple linear transformation or a more complex nonlinear transformation, depending on the design and training objectives of the model. Ultimately, the target semantic descriptor will contain more abstract and discriminative semantic information in the face descriptor, providing strong support for subsequent face recognition tasks.

[0022] Step S130: determine A recognition tasks corresponding to the target face image, perform face recognition inference on the target semantic descriptor based on each recognition task, and obtain the face recognition inference result corresponding to each recognition task, where A is a natural number greater than 0.

[0023] Step S130 performs multi-task recognition processing on the target face image to obtain a more comprehensive and accurate face recognition result. In this step, the computer determines A recognition tasks related to the target face image, which may include but are not limited to the shooting environment, lighting conditions, facial expressions, posture angles, etc. Then, based on each recognition task, the system performs face recognition reasoning on the target semantic descriptor generated in step S120 to obtain the face recognition reasoning results corresponding to each task. These results are expressed in the form of probability, reflecting the degree of match between the face to be recognized and the facial features under the specific recognition task.

[0024] For example, this step relies on a neural network module called the "second task agent". This module consists of multiple domain-adapted agents (also called expert networks) for different recognition tasks, each of which is specially trained to perform face recognition reasoning under a specific recognition task. These domain-adapted agents can be independent neural networks or multi-task learning models that share some network structures.

[0025] Taking the shooting environment recognition task as an example, suppose there is a domain-adaptive agent that is specifically used to recognize face images in different shooting environments. The agent may contain multiple convolutional layers, pooling layers, and fully connected layers to extract environmental features (such as background, light direction, shadows, etc.) in face images. When the target semantic descriptor is input to the agent, it will map the descriptor to the feature space related to the shooting environment through a series of nonlinear transformations and generate a probability value representing the degree of face matching in the environment.

[0026] Similarly, for other recognition tasks such as lighting conditions, facial expressions, and posture angles, there are corresponding domain-adaptive agents to handle them. These agents may adopt different network structures, parameter settings, and training strategies to adapt to the needs and characteristics of their respective tasks. For example, the lighting condition recognition agent may focus more on capturing the brightness, contrast, and color information in the image; the facial expression recognition agent may require more sophisticated local feature extraction and expression classification capabilities; and the posture angle recognition agent needs to be able to handle facial deformation and occlusion problems at different angles.

[0027] In the actual execution process, the all-in-one computer inputs the target semantic descriptor into all A domain-adapted agents in parallel, and each agent processes it independently and generates the corresponding face recognition inference results. These results are represented in the form of probability vectors or arrays, where each element corresponds to the probability value of a specific category or label. For example, in the lighting condition recognition task, the result may be a probability vector containing labels such as "strong light", "weak light", and "shadow"; in the facial expression recognition task, it may be a probability vector containing expressions such as "smile", "anger", and "sadness".

[0028] For example, it can be assumed that there is a system with three recognition tasks (shooting environment, lighting conditions, and facial expressions). For each task, there is a corresponding domain adaptation agent, and these agents have been trained and integrated into the second task agent. When the computer-in-one receives a target face image, it first generates the target semantic descriptor through steps S110 and S120, and then inputs it into the second task agent.

[0029] Inside the second task agent, the target semantic descriptor will be input into the three domain adaptation agents in parallel. Taking the shooting environment recognition agent as an example, it may extract environmental features in the image through a series of convolutional layers and pooling layers, and then map these features to a probability vector containing labels such as "indoor", "outdoor", and "night" through a fully connected layer. Similarly, the lighting condition recognition agent will generate a probability vector containing labels such as "strong light", "weak light", and "shadow"; the facial expression recognition agent will generate a probability vector containing expressions such as "smile", "anger", and "sadness".

[0030] Finally, the all-in-one computer collects the output results of all domain adaptation agents and combines them into a larger probability matrix or array. Each row of this matrix or array corresponds to the result of a recognition task, and each column corresponds to the probability value of a specific category or label. Through this matrix or array, we can fully understand the matching degree of the face to be recognized under different recognition tasks, and make more accurate face recognition decisions based on this.

[0031] Since there may be correlation or complementarity between different recognition tasks, the results of these tasks can be further integrated and optimized in practical applications. For example, the results of multiple tasks can be fused through weighted summation, Bayesian network, conditional random field and other methods to improve the accuracy and robustness of overall face recognition. Step S130 determines multiple recognition tasks related to the target face image and performs face recognition reasoning on the target semantic descriptor based on each task, thereby achieving a comprehensive analysis and recognition of facial features. This step provides a powerful multi-task processing capability for the face recognition method, enabling the system to accurately identify face images in different scenarios and provide strong support for its subsequent applications.

[0032] Step S140: Evaluate the influence of the face descriptor to obtain the importance coefficient corresponding to each recognition task.

[0033] Step S140 performs influence evaluation on the face descriptor to determine the importance coefficient of each recognition task in the final face recognition result, which can help the computer-in-one machine better understand the contribution of different recognition tasks to face recognition, so as to more reasonably integrate the results of these tasks in subsequent steps and improve the accuracy and robustness of overall face recognition.

[0034] For example, step S140 relies on the third task agent, which receives the face descriptor from step S110 as input and generates a vector or array representing the importance coefficient of each recognition task through a series of complex nonlinear transformations. This process can be seen as an extension of deep learning and feature extraction of face descriptors, aiming to mine the task relevance information hidden in the descriptor.

[0035] The design of the third task agent may include multiple components, such as a path selector and a threshold controller. The path selector is responsible for extracting feature information related to different recognition tasks from the face descriptor and mapping it into a shared feature space. The threshold controller evaluates the importance of each recognition task based on this feature information and generates a corresponding importance coefficient.

[0036] Specifically, the path selector may use structures such as convolutional neural networks (CNN) or recurrent neural networks (RNN) to perform deep feature extraction on face descriptors. These features may include the geometric shape, texture information, expression features, etc. of the face, which have certain correlations with different recognition tasks. By learning the complex relationships between these features, the path selector can map them to a higher-dimensional or lower-dimensional feature space for subsequent processing and evaluation.

[0037] The threshold controller evaluates the importance of each recognition task based on the feature information extracted by the path selector. This process may involve a variety of calculation methods and strategies, such as weighted summation, attention mechanism, conditional random field, etc. Taking weighted summation as an example, the threshold controller may assign a weight value to each recognition task, which reflects the contribution of the task to the final face recognition result. This weight value can be obtained through learning or set based on prior knowledge or experience.

[0038] Step S150: Determine the face recognition result of the face to be recognized based on the face recognition inference result corresponding to each recognition task and the importance coefficient corresponding to each recognition task.

[0039] Step S150 combines the face recognition inference results and importance coefficients generated in the previous steps to determine the final recognition result of the face to be recognized. The core of this step is how to effectively integrate the results of multiple recognition tasks to fully utilize their respective advantages while avoiding potential conflicts and interference.

[0040] In the all-in-one computer, step S150 is implemented by a fusion algorithm, which receives the face recognition inference result corresponding to each recognition task from step S130 (for example, a probability vector or array, indicating the probability that the face to be recognized belongs to different categories) and the importance coefficient corresponding to each recognition task from step S140 (a scalar value or vector indicating the importance of the task), and then generates the final recognition result based on these inputs.

[0041] The design of the fusion algorithm considers the following key factors: There may be correlation or complementarity between different recognition tasks. For example, the shooting environment and lighting conditions may affect the appearance characteristics of the face, while facial expressions and postures may provide more information about the identity. Therefore, in the fusion process, the correlation between these tasks needs to be fully considered in order to more accurately evaluate their contribution to the final recognition results.

[0042] The importance coefficients generated in step S140 reflect the importance of each recognition task in the final recognition result. These coefficients can be obtained through learning or set based on prior knowledge or experience. In the fusion process, these coefficients need to be used as weights to perform weighted summation or other forms of combination on the face recognition reasoning results of the corresponding tasks to obtain the final recognition result.

[0043] When fusing the results of multiple recognition tasks, it is necessary to ensure their consistency. If the results of some tasks are significantly different from other tasks, additional verification or adjustment may be required to avoid misleading the final recognition decision.

[0044] The fusion algorithm needs to ensure recognition accuracy while improving computational efficiency as much as possible. This can be achieved by optimizing the algorithm structure, reducing the amount of computation, or using parallel computing and other technologies.

[0045] In practical applications, the specific implementation of the fusion algorithm may include a variety of methods, such as weighted summation, Bayesian network, conditional random field, deep learning model, etc. Taking weighted summation as an example, it can be implemented by the following formula: ; where A is the number of recognition tasks, w i is the importance coefficient of the i-th task, p i is the face recognition inference result of the ith task (i.e., the probability that the face to be recognized belongs to a certain category). This formula obtains the final recognition result by weighted summing the results of each task.

[0046] In one implementation, the target semantic descriptor is obtained by extracting deep semantic features from the face descriptor using the semantic mining layer in the first task agent; the first task agent is a neural network configured to perform face recognition on the face to be recognized. The method also includes a training process of the first task agent, including: Step S10: obtaining a first image sample set; the first training face images covered by the first image sample set are training face images that do not contain face supervision information; Step S20: Obtain B training branches for the first task agent to be trained; B is a natural number greater than 0; Step S30: using the first task agent to be trained to process the first training face image, obtaining a sample semantic descriptor related to each training branch, and determining B training costs corresponding to B training branches according to the sample semantic descriptors, where one training branch corresponds to one training cost; Step S40: Determine a first target training cost based on the B training costs, modify the internal configuration variables of the first task agent to be trained based on the first target training cost, and determine the modified first task agent to be trained as the first task agent.

[0047] In step S10, the computer collects a large number of training face images from various data sources to form a first image sample set. These images are, for example, unlabeled, that is, they do not contain supervisory information that clearly indicates the identity of the face or other specific attributes. This is because in practical applications, it is often costly and difficult to obtain face image data with accurate labels, and unsupervised learning methods can alleviate this problem to a certain extent.

[0048] For example, the all-in-one computer can filter out facial images from image data collected by web crawlers, public facial datasets (such as LFW, CelebA, etc.) through legal and compliant channels, or generate a large number of facial images through simulation generation technology (such as GANs). These images may contain a variety of facial postures, expressions, lighting conditions, and occlusions, thereby providing rich training samples for the model.

[0049] After having the first set of image samples, the computer-in-one machine designs multiple training branches for the first task agent to be trained, so as to improve the performance of the model from multiple angles and levels. These training branches can train different parts or functions of the model, such as feature extraction ability, semantic understanding ability, robustness, etc.

[0050] Assuming B is equal to 4, the following four training branches can be designed: 1. Image patch mask detection branch: This branch aims to train the model to be robust when some areas in the image are masked. By randomly masking certain areas in the image, the model needs to learn to infer the complete facial features from the remaining information.

[0051] 2. Image block forgery detection branch: This branch focuses on the model's ability to detect forged or tampered areas in the image. By randomly replacing certain areas in the image with other image blocks, the model needs to be able to identify these unnatural areas.

[0052] 3. Image block enhancement branch: This branch trains the model's adaptability to image changes by randomly enhancing certain attributes of image blocks (such as brightness, contrast, color, etc.). The model needs to learn to extract unchanged facial features from these enhanced images.

[0053] 4. Label generation branch: Although the initial image samples are unlabeled, this branch attempts to use the model's own prediction ability to generate pseudo labels, thereby simulating the effect of supervised learning to a certain extent. By comparing the model's prediction results for the same image at different training stages, a "soft label" can be generated to guide further training of the model.

[0054] In step S30, the computer uses the first task agent to be trained to process the first training face image to extract sample semantic descriptors. These descriptors contain high-level semantic features of the face in the image and are the basis for the model to perform face recognition.

[0055] For each training branch, the computer all-in-one uses different strategies to process images and extract sample semantic descriptors. For example, in the image patch mask detection branch, the system randomly masks certain areas in the image and observes how the model extracts facial features from these masked images. In the image patch forgery detection branch, the system randomly replaces certain areas in the image and evaluates the model's ability to detect these forged areas.

[0056] After extracting the sample semantic descriptors, the training cost of each training branch is calculated based on these descriptors. The training cost is an indicator that measures the performance of the model in the current training state. It is usually related to the difference between the model's prediction results and the true results (or pseudo labels). For example, in the image block mask detection branch, the training cost may be calculated based on the model's prediction accuracy for the masked area; in the label generation branch, the training cost may be calculated based on the consistency of the model's prediction results at different training stages.

[0057] In step S40, the computer all-in-one considers the training costs of the B training branches and calculates a first target training cost. This cost reflects the overall performance of the model in the current training state and is an important basis for guiding the correction of model parameters.

[0058] The calculation of the first objective training cost may involve multiple factors, such as the weights of different training branches, the normalization of training costs, etc. For example, if a training branch is particularly important for improving model performance, it can be assigned a higher weight; if the training costs of different training branches vary greatly in magnitude, they can be normalized to ensure that their contributions to the final cost are balanced.

[0059] After calculating the first target training cost, the back propagation algorithm is used to correct the internal configuration variables of the first task agent to be trained (such as the weights and biases of the neural network). This process is an iterative process. By continuously adjusting the model parameters and calculating the new training cost, the performance of the model can be gradually optimized until the predetermined training target or convergence condition is reached.

[0060] Finally, after multiple iterations of training, the corrected first task agent to be trained will be determined as the first task agent. This model has the ability to extract useful semantic features from unlabeled face images and can realize the function of face recognition to a certain extent. Although it may not be able to achieve a very high recognition accuracy like the supervised learning model, in practical applications, this unsupervised or weakly supervised learning method is often more flexible and practical, and can alleviate the problem of data labeling to a certain extent.

[0061] In one implementation, the B training branches include an image block mask detection branch. In step S30, a first training face image is processed by a first task agent to be trained to obtain a sample semantic descriptor related to each training branch, and B training costs corresponding to the B training branches are determined according to the sample semantic descriptors, including: Step S31: using a first task agent to be trained to perform an image block operation on a first training face image to obtain a first training image block matrix of the first training face image; the first training image block matrix includes training image blocks on a plurality of matrix elements; Step S32: randomly selecting a first matrix element to be used for image block masking from a plurality of matrix elements corresponding to the first training image block matrix; Step S33: performing image block masking processing on the training image blocks on the first matrix elements in the first training image block matrix based on the image block masking identifier to obtain a first sample image block matrix; Step S34: using the first task agent to be trained to extract image descriptors from the first sample image block matrix to obtain a first sample face descriptor of the first sample image block matrix, performing deep semantic feature extraction on the first sample face descriptor to obtain a first sample semantic descriptor corresponding to the first sample face descriptor, where the first sample semantic descriptor belongs to a sample semantic descriptor; Step S35: using the detection network layer corresponding to the image block mask detection branch, performing mask image block detection on the first sample semantic descriptor to obtain an estimated image block corresponding to the image block mask identifier in the first sample image block matrix; Step S36: Determine the training cost corresponding to the image block mask detection branch according to the training image blocks and the estimated image blocks on the first matrix elements in the first training image block matrix.

[0062] In step S31, the first training face image is processed by the image segmentation module in the first task agent to be trained. Image segmentation is a method of dividing the entire image into multiple small blocks (or image blocks), which helps the model better capture the local features of the image. The size and shape of the blocks can be set according to the requirements of the specific task. For example, in the face recognition task, smaller blocks may be selected to capture finer features.

[0063] Assuming that the first training face image is divided into 8x8 image blocks of the same size, the first training image block matrix will be an 8x8 matrix, where each matrix element corresponds to an image block. This matrix not only contains the data of the image block itself, but may also contain some additional information, such as the position and size of the image block.

[0064] In step S32, after obtaining the first training image block matrix, one or more matrix elements are randomly selected as the target for the image block masking to be performed. This process is random and is intended to simulate the random occlusion that may be encountered in face images in the real world. The masked image blocks can be of any size and shape, but some key areas (such as eyes, nose, mouth, etc.) are usually selected to test the robustness of the model. For example, an image block located at the center of the matrix can be randomly selected as the masking target, and its corresponding matrix element is marked as a state to be masked. In this process, the position information of the selected matrix elements is recorded for subsequent masking processing and result evaluation.

[0065] In step S33, after determining the image blocks to be masked, the computer will use the image block masking identifier to mask these image blocks. The image block masking identifier is a special mark used to indicate which image blocks need to be masked and the masking method (such as complete masking, partial masking, etc.). In actual operation, the masking process may involve replacing the image blocks with black blocks, white blocks, random noise or other forms of masks.

[0066] Taking full masking as an example, the image block to be masked can be replaced with a black block of the same size as the original image block. The first sample image block matrix obtained after this processing will contain the masked image block and other unmasked image blocks. This matrix will be used as input in subsequent steps to test the performance of the model when part of the image area is masked.

[0067] In step S34, after obtaining the first sample image block matrix, the computer all-in-one will use the image descriptor extraction module and the deep semantic feature extraction module in the first task agent to be trained to process it. The image descriptor extraction module is responsible for extracting low-level or mid-level features that can characterize facial features from the image block, such as edges, textures, shapes, etc. These features are usually represented in the form of vectors and are called image descriptors.

[0068] Subsequently, the deep semantic feature extraction module will further process the image descriptor to extract more advanced and abstract semantic features. These features not only contain the local information of the image block, but also reflect the correlation and overall structure between the image blocks. Through the nonlinear transformation and feature fusion operation of the deep neural network (such as the convolutional neural network), the first sample semantic descriptor corresponding to the first sample face descriptor can be obtained. This descriptor is a high-dimensional vector that contains the deep semantic information of the face image after the image block is masked.

[0069] In step S35, after obtaining the first sample semantic descriptor, it will be processed using the detection network layer corresponding to the image block mask detection branch. This detection network layer is a specially designed neural network module for detecting masked image blocks in an image and trying to restore their original content. It may contain multiple convolutional layers, pooling layers, fully connected layers and other components, as well as specific loss functions and optimization algorithms.

[0070] During the detection process, the detection network layer will try to extract information related to the masked image block from the first sample semantic descriptor, and generate an estimated image block based on this information. This estimated image block is an approximate restoration of the masked image block. It may be different from the original image block, but the key features of the original image block should be retained as much as possible.

[0071] In step S36, the training cost of the image block mask detection branch is calculated. The training cost is an indicator to measure the performance of the model, which reflects the difference between the predicted results and the actual results of the model on a specific task. In the image block mask detection branch, the training cost is usually calculated based on the difference between the original content of the masked image block and the estimated image block.

[0072] Specifically, the all-in-one computer can calculate the pixel-level difference between the original image block and the estimated image block (such as mean square error MSE, peak signal-to-noise ratio PSNR, etc.), or calculate the difference based on more advanced semantic features (such as cosine similarity, Euclidean distance, etc.). Then, a loss function (such as cross entropy loss, mean square error loss, etc.) is defined based on these difference values, and its average value over the entire training set is calculated as the training cost.

[0073] The calculation formula of training cost may vary depending on the specific task and network structure. For example, in the calculation based on pixel-level difference, mean square error MSE can be expressed as: ; where N is the total number of pixels in the image block, y i is the value of the i-th pixel in the original image block, is the value of the corresponding pixel in the estimated image patch. This formula calculates the average of the sum of squares of the differences between each pixel in the original image patch and the estimated image patch.

[0074] After obtaining the training cost, the back-propagation algorithm is used to update the internal configuration variables of the first task agent to be trained (such as the weights and biases of the neural network) to minimize the training cost and improve the performance of the model. This process is an iterative process. Through multiple iterative training, the model will gradually learn to extract useful features from the masked image blocks and generate more accurate estimated image blocks.

[0075] In another implementation, the B training branches include an image block forgery detection branch; step S30, using the first task agent to be trained to process the first training face image, obtain a sample semantic descriptor related to each training branch, and determine B training costs corresponding to the B training branches according to the sample semantic descriptors, including: Step S30A: using the first task agent to be trained to perform an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; the first training image block matrix includes training image blocks on a plurality of matrix elements; Step S30B: randomly selecting a second matrix element for performing image block forgery from a plurality of matrix elements corresponding to the first training image block matrix; Step S30C: using random pixels to perform image block forging on the training image blocks on the second matrix elements in the first training image block matrix to obtain a second sample image block matrix, wherein the random pixels are different from the training image blocks on the second matrix elements; Step S30D: using the first task agent to be trained to extract image descriptors from the second sample image block matrix to obtain a second sample face descriptor of the second sample image block matrix, performing deep semantic feature extraction on the second sample face descriptor to obtain a second sample semantic descriptor corresponding to the second sample face descriptor, where the second sample semantic descriptor belongs to the sample semantic descriptor; Step S30E: using the detection network layer corresponding to the image block forgery detection branch, performing forgery element detection on the second sample semantic descriptor, and obtaining image block forgery estimation elements corresponding to a plurality of matrix elements; Step S30F: determining the training cost corresponding to the image block forgery detection branch according to the second matrix element and the image block forgery estimation elements corresponding to the plurality of matrix elements.

[0076] In step S30A, the computer uses the image segmentation module in the first task agent to be trained to segment the first training face image. Similar to the image block mask detection branch, the image segmentation operation helps the model better capture the local features of the image and provides a basis for subsequent forgery detection and feature extraction. The size and shape of the segment can be set according to the requirements of the specific task to ensure that the model can learn sufficiently fine features.

[0077] In step S30B, after obtaining the first training image block matrix, one or more matrix elements are randomly selected as targets for image block forgery. This process is random and is intended to simulate the random forgery or tampering that may occur in real-world face images. The forged image blocks can be of any size and shape, but some key areas (such as eyes, nose, mouth, etc.) are usually selected to test the robustness of the model.

[0078] For example, an image block located at the center of the matrix can be randomly selected as a forgery target, and its corresponding matrix element can be marked as a to-be-forged state. In this process, the position information of the selected matrix element is recorded for subsequent forgery processing and result evaluation.

[0079] In step S30C, after the image blocks to be forged are determined, the computer all-in-one will use random pixels to forge these image blocks. Random pixels can be any value, but usually have a large difference from the pixel value of the original image block to ensure the obviousness of the forgery effect. The forgery process may involve replacing the image blocks with completely random pixel values, randomly selected pixel blocks from other images, or other forms of forgery operations.

[0080] Taking completely random pixel replacement as an example, each pixel in the image block to be forged can be replaced with a randomly selected integer value between 0 and 255 (for 8-bit grayscale images) or a randomly selected RGB color value (for color images). The second sample image block matrix obtained after this processing will contain the forged image blocks and other non-forged image blocks. This matrix will be used as input in subsequent steps to test the performance of the model when part of the image area is forged.

[0081] In step S30D, after obtaining the second sample image block matrix, the computer all-in-one will use the image descriptor extraction module and the deep semantic feature extraction module in the first task agent to be trained to process it. Similar to the image block mask detection branch, these modules are responsible for extracting low-level or mid-level features that can represent facial features from the image blocks, and further extracting higher-level and more abstract semantic features.

[0082] The image descriptor extraction module will generate a second sample face descriptor, which is a vector or matrix containing the feature information of all image blocks in the second sample image block matrix. Subsequently, the deep semantic feature extraction module will further process the second sample face descriptor to extract more advanced semantic features. These features not only contain the local information of the image block, but also reflect the correlation and overall structure between the image blocks. Through the nonlinear transformation and feature fusion operations of the deep neural network (such as the convolutional neural network), the second sample semantic descriptor corresponding to the second sample face descriptor can be obtained. This descriptor is a high-dimensional vector that contains the deep semantic information of the face image after the image block is forged.

[0083] In step S30E, after obtaining the second sample semantic descriptor, the all-in-one computer will process it using the detection network layer corresponding to the image block forgery detection branch. This detection network layer is a specially designed neural network module for detecting forged image blocks in an image and trying to identify their forgery features. It may include multiple convolutional layers, pooling layers, fully connected layers and other components, as well as specific loss functions and optimization algorithms.

[0084] During the detection process, the detection network layer will try to extract information related to the forged image block from the second sample semantic descriptor, and generate an image block forgery estimation element based on this information. This estimation element is an approximate description of the forged image block, which may contain information such as the features, location, and size of the forged image block. Although the estimation element may be different from the original forged image block, it should reflect the key features of the forged image block as accurately as possible.

[0085] In step S30F, the last step is to calculate the training cost of the image block forgery detection branch. The training cost is an indicator to measure the performance of the model, which reflects the difference between the predicted results and the actual results of the model on a specific task. In the image block forgery detection branch, the training cost is usually calculated based on the difference between the original information of the forged image block and the image block forgery estimation element.

[0086] Specifically, the difference between the second matrix element (i.e., the position of the original forged image block) and the image block forgery estimation element can be compared. This difference may be reflected in multiple aspects such as the consistency of the forged features, the accuracy of the position, the matching degree of the size, etc. In order to quantify these differences, the computer all-in-one can define a series of evaluation indicators, such as forged feature similarity, position error, size error, etc., and calculate a comprehensive loss value as the training cost based on these indicators.

[0087] The calculation formula of the training cost may vary depending on the specific task and network structure. For example, in the calculation based on the similarity of forged features, cosine similarity can be used as an effective evaluation indicator. Cosine similarity measures the similarity between two vectors by calculating the cosine value of the angle between them. Its value range is [-1, 1]. The larger the value, the higher the similarity. In the image block forgery detection branch, the cosine similarity between the original forged image block feature corresponding to the second matrix element and the image block forgery estimation element can be calculated and used as part of the training cost.

[0088] In addition to cosine similarity, other evaluation indicators and loss functions can also be considered to calculate the training cost. For example, position error and size error can be measured by calculating the Euclidean distance; the comprehensive loss value can be combined into a single loss value by weighted summation or other combinations. After obtaining the training cost, the computer-in-one will use the back-propagation algorithm to update the internal configuration variables of the first task agent to be trained (such as the weights and biases of the neural network) to minimize the training cost and improve the performance of the model.

[0089] In summary, the implementation process of the image block forgery detection branch involves multiple steps, including image segmentation, random selection of forged targets, image block forgery processing, image descriptor extraction, deep semantic feature extraction, forged element detection, and training cost calculation. Through the organic combination and iterative optimization of these steps, the all-in-one computer can gradually improve the model's feature extraction and semantic understanding capabilities when part of the image area is forged, thereby enhancing the model's robustness to image tampering.

[0090] In another implementation, the B training branches include an image block enhancement branch; step S30, using the first task agent to be trained to process the first training face image, obtain a sample semantic descriptor related to each training branch, and determine B training costs corresponding to the B training branches according to the sample semantic descriptors, including: Step S301: randomly enhancing the image block pixel channels of the first training face image to obtain an enhanced training face image, performing an image block operation on the enhanced training face image to obtain an enhanced image block matrix of the enhanced training face image; Step S302: performing an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; Step S303: using the first task agent to be trained to extract image descriptors from the enhanced image block matrix to obtain a third sample face descriptor of the enhanced image block matrix, performing deep semantic feature extraction on the third sample face descriptor to obtain a third sample semantic descriptor corresponding to the third sample face descriptor, where the third sample semantic descriptor belongs to the sample semantic descriptor; Step S304: using the first task agent to be trained to extract image descriptors from the first training image block matrix to obtain a fourth sample face descriptor of the first training image block matrix, performing deep semantic feature extraction on the fourth sample face descriptor to obtain a fourth sample semantic descriptor corresponding to the fourth sample face descriptor, where the fourth sample semantic descriptor belongs to the sample semantic descriptor; Step S305: Determine the training cost corresponding to the image block enhancement branch according to the third sample semantic descriptor and the fourth sample semantic descriptor.

[0091] In step S301, the computer first performs random enhancement processing on the pixel channels of each image block of the first training face image. Random enhancement can be a noise addition operation, which can add random noise to each pixel channel of the image block to simulate image quality degradation or sensor noise. The type and intensity of noise can be set according to the requirements of the specific task, for example, Gaussian noise, salt and pepper noise or other types of noise can be used.

[0092] The enhanced image is called the enhanced training face image. Subsequently, the computer-in-one machine performs image block operation on the enhanced training face image to obtain an enhanced image block matrix. This matrix has the same structure as the first training image block matrix, but contains the enhanced image block data. The size and shape of the blocks should be consistent with the first training image block matrix to ensure consistency in feature extraction and semantic understanding in subsequent steps.

[0093] While processing the enhanced training face image in step S301, the computer all-in-one also needs to perform an image segmentation operation on the original first training face image to obtain a first training image block matrix. This matrix will serve as a benchmark for feature extraction and semantic understanding in subsequent steps, and will be used to compare with the processing results of the enhanced training face image. Similar to step S301, the image segmentation operation divides the first training face image into multiple image blocks of the same size and generates a matrix containing the image block data. The size and shape of the blocks should be set according to the requirements of the specific task to ensure that the model can learn sufficiently fine features.

[0094] In step S303, after obtaining the enhanced image block matrix, the computer all-in-one will use the image descriptor extraction module in the first task agent to be trained to process it. This module is responsible for extracting low-level or mid-level features that can represent facial features from the image block, such as edges, textures, shapes, etc. For the enhanced training face image, since the pixel channels of the image block are randomly enhanced, the extracted features will contain more noise information.

[0095] The image descriptor extraction module will generate a third sample face descriptor, which is a vector or matrix containing the feature information of all image blocks in the enhanced image block matrix. Subsequently, the deep semantic feature extraction module will further process the third sample face descriptor to extract higher-level semantic features. These features not only contain the local information of the image blocks, but also reflect the correlation and overall structure between the image blocks. Although the enhancement process introduces noise, the deep semantic feature extraction module should be able to learn feature representations that are robust to noise.

[0096] Through the nonlinear transformation and feature fusion operation of a deep neural network (such as a convolutional neural network), a third sample semantic descriptor corresponding to the third sample face descriptor can be obtained. This descriptor is a high-dimensional vector that contains deep semantic information of the enhanced training face image.

[0097] In step S304, while the enhanced image block matrix is ​​processed in step S303, the first training image block matrix also needs to be processed in the same process. This includes extracting the fourth sample face descriptor using the image descriptor extraction module and generating the fourth sample semantic descriptor using the deep semantic feature extraction module. Since the first training image block matrix contains the original, unenhanced image block data, the extracted features and semantic descriptors will more accurately reflect the true features of the face. This process provides a benchmark for subsequent training cost calculations, which is used to evaluate the performance changes of the model after the enhancement process.

[0098] In step S305, the training cost of the image block enhancement branch is calculated. The training cost is an indicator to measure the performance of the model, which reflects the difference between the predicted result and the actual result of the model on a specific task. In the image block enhancement branch, the training cost is usually calculated based on the difference between the enhanced semantic descriptor (the third sample semantic descriptor) and the original semantic descriptor (the fourth sample semantic descriptor).

[0099] Specifically, the computer-in-one machine can compare the difference between the third sample semantic descriptor and the fourth sample semantic descriptor. This difference may be reflected in various dimensions of the feature vector, reflecting the impact of the enhancement processing on the model feature extraction and semantic understanding. In order to quantify these differences, the computer-in-one machine can define a series of evaluation indicators, such as the Euclidean distance and cosine similarity between feature vectors, and calculate a comprehensive loss value as the training cost based on these indicators.

[0100] The calculation formula for the training cost may vary depending on the specific task and network structure. For example, in the calculation based on Euclidean distance, the square root of the sum of the squares of the differences in each dimension between the third sample semantic descriptor and the fourth sample semantic descriptor can be calculated, that is, the Euclidean distance. The larger the distance value, the greater the difference between the two semantic descriptors, and the greater the performance loss of the model.

[0101] In addition to the Euclidean distance, the all-in-one computer can also consider other evaluation indicators and loss functions to calculate the training cost. For example, cosine similarity can measure the directional consistency between two vectors, and its value range is [-1, 1]. The larger the value, the more consistent the direction. In the image block enhancement branch, the cosine similarity between the third sample semantic descriptor and the fourth sample semantic descriptor can be calculated and used as part of the training cost.

[0102] After obtaining the training cost, the all-in-one computer will use the back-propagation algorithm to update the internal configuration variables of the first task agent to be trained (such as the weights and biases of the neural network) to minimize the training cost and improve the performance of the model. Through multiple iterations of training, the model will gradually learn to extract useful features and generate accurate semantic descriptors when the pixel channels of the image blocks are randomly enhanced.

[0103] In summary, the implementation process of the image block enhancement branch involves multiple steps, such as random enhancement of image block pixel channels, image segmentation, image descriptor extraction, deep semantic feature extraction, and training cost calculation. Through the organic combination and iterative optimization of these steps, the robustness of the model to image noise can be gradually improved, thereby enhancing the performance of the model in the case of degraded face image quality in the real world.

[0104] In other implementations, the B training branches include a label generation branch; step S30, using the first task agent to be trained to process the first training face image to obtain a sample semantic descriptor related to each training branch, and determining B training costs corresponding to the B training branches according to the sample semantic descriptors, including: Step S30a: performing an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; Step S30b: using the first task agent to be trained to extract image descriptors from the first training image block matrix to obtain a fourth sample face descriptor of the first training image block matrix, performing deep semantic feature extraction on the fourth sample face descriptor to obtain a fourth sample semantic descriptor corresponding to the fourth sample face descriptor, where the fourth sample semantic descriptor belongs to the sample semantic descriptor; Step S30c: performing face recognition on the fourth sample semantic descriptor through the detection network layer corresponding to the label generation branch to obtain a training face recognition result corresponding to the first training face image; Step S30d: obtaining a past agent corresponding to the first task agent to be trained, performing face recognition on the first training face image according to the past agent, and obtaining a label corresponding to the first training face image to generate a face recognition inference result; Step S30e: Determine the training cost corresponding to the label generation branch based on the training face recognition result and the label generation face recognition inference result.

[0105] In step S30a, the first training face image is first divided into blocks.

[0106] In step S30b, after obtaining the first training image block matrix, the computer all-in-one will process it using the image descriptor extraction module in the first task agent to be trained. This module is responsible for extracting low-level or mid-level features that can represent facial features, such as edges, textures, shapes, etc., from the image blocks.

[0107] For the first training image block matrix, the image descriptor extraction module will generate a fourth sample face descriptor, which is a vector or matrix containing the feature information of all image blocks. Subsequently, the deep semantic feature extraction module will further process the fourth sample face descriptor to extract higher-level and more abstract semantic features. These features not only contain the local information of the image blocks, but also reflect the correlation and overall structure between the image blocks. Through the nonlinear transformation and feature fusion operations of a deep neural network (such as a convolutional neural network), the fourth sample semantic descriptor corresponding to the fourth sample face descriptor can be obtained. This descriptor is a high-dimensional vector that contains the deep semantic information of the first training face image.

[0108] In step S30c, after obtaining the fourth sample semantic descriptor, the computer all-in-one will process it using the detection network layer corresponding to the tag generation branch. This detection network layer is a specially designed neural network module for performing face recognition tasks. It may include multiple convolutional layers, pooling layers, fully connected layers and other components, as well as specific face recognition algorithms and loss functions.

[0109] During the detection process, the detection network layer will try to extract information related to facial features from the fourth sample semantic descriptor and generate a training face recognition result based on this information. This result is usually expressed in the form of a probability vector, where each element corresponds to a probability value of a predefined face category. For example, if the system predefines 1000 face categories, then the training face recognition result will be a probability vector containing 1000 elements, each element representing the probability that the first training face image belongs to the corresponding category.

[0110] In step S30c, the current first task agent to be trained is used to generate training face recognition results. However, in order to simulate the effect of supervised learning and calculate the training cost, a past agent is also needed to generate pseudo labels or mark the generated face recognition inference results. The past agent can be the state of the first task agent to be trained in the previous training stage, or it can be a completely different but trained face recognition model. In this step, the computer all-in-one will use the past agent to perform face recognition on the first training face image, and generate a marked generated face recognition inference result. This result has the same format as the training face recognition result generated in step S30c, that is, a probability vector containing predefined face category probability values.

[0111] Step S30e calculates the training cost of the label generation branch. The training cost is an indicator to measure the performance of the model, which reflects the difference between the prediction result of the model on a specific task and the pseudo label (or the label generation face recognition inference result). In the label generation branch, the training cost is usually calculated based on the difference between the training face recognition result and the label generation face recognition inference result.

[0112] Specifically, the computer can compare the difference in the probability vector between the two results. This difference can be quantified in many ways, such as calculating the Euclidean distance between the vectors, cosine similarity, cross entropy loss, etc. Taking cross entropy loss as an example, it can be expressed as: ;

[0113] Where C is the number of predefined face categories, is the probability value (pseudo label) of the i-th category in the face recognition inference result generated by the marker, is the probability value of the i-th category in the training face recognition results. This formula calculates the cross-entropy loss between the pseudo-label and the model prediction result, which reflects the degree of difference between the model prediction result and the true label (pseudo-label in this case). In addition to the cross-entropy loss, the all-in-one computer can also consider other loss functions to calculate the training cost, such as mean square error loss (MSE), mean absolute error loss (MAE), etc. After obtaining the training cost, the back-propagation algorithm is used to update the internal configuration variables of the first task agent to be trained (such as the weights and biases of the neural network) to minimize the training cost and improve the performance of the model. Through multiple iterative training, the model will gradually learn to generate accurate pseudo-labels without explicit supervision information and optimize itself accordingly.

[0114] In one implementation, the target semantic descriptor is obtained by performing deep semantic feature extraction on the face descriptor using the semantic mining layer in the first task agent; the first task agent is a neural network configured to perform face recognition on the face to be recognized, and the neural network also includes a second task agent connected to the semantic mining layer; step S130, based on each recognition task, face recognition reasoning is performed on the target semantic descriptor respectively to obtain the face recognition reasoning result corresponding to each recognition task, including: Step S131: determining a second task agent from the neural network, where the second task agent includes a domain adaptation agent corresponding to each recognition task; Step S132: Use the domain adaptation agent corresponding to each recognition task to perform face recognition reasoning on the target semantic descriptor to obtain the face recognition reasoning result corresponding to each recognition task. One domain adaptation agent is used to determine the face recognition reasoning result corresponding to one recognition task.

[0115] In step S131, the position and structure of the second task agent are first determined from the neural network constructed inside. The second task agent is a key component in the neural network, which is responsible for processing the target semantic descriptor from the semantic mining layer and generating corresponding face recognition inference results according to different recognition tasks.

[0116] The second task agent is composed of multiple domain adaptation agents, each of which is responsible for handling a specific recognition task. For example, if the recognition task includes shooting environment, lighting conditions, facial expressions and posture angles, the second task agent will contain four corresponding domain adaptation agents.

[0117] Domain-adaptive agents are, for example, independent neural network modules that can share some network structures (such as convolutional layers or pooling layers), but may also contain unique network layers and parameter settings to adapt to the needs of their respective tasks. These agents are specially trained to learn feature representations and reasoning rules related to specific recognition tasks, thereby generating accurate face recognition reasoning results given the target semantic descriptor.

[0118] In actual operation, the computer-in-one may need to determine the specific location and structure of the second task agent by consulting the architecture definition or configuration file of the neural network. This includes identifying the number of domain adaptation agents, the connection relationship between them, the design of the input and output layers, etc. Once the structure of the second task agent is determined, the computer-in-one can prepare it for the subsequent face recognition reasoning process.

[0119] In step S132, after the second task agent and the domain adaptation agents included in it are determined in step S131, the computer all-in-one will then use these agents to perform face recognition reasoning on the target semantic descriptor. This process involves inputting the target semantic descriptor into each domain adaptation agent respectively, and obtaining the face recognition reasoning results generated by each of them.

[0120] Specifically, for each recognition task, the all-in-one PC performs the following operations: 1. Select the corresponding domain adaptation agent: According to the current recognition task, select the corresponding domain adaptation agent from the second task agent. For example, if the current task is to recognize the shooting environment, select the domain adaptation agent specifically responsible for this task.

[0121] 2. Input target semantic descriptor: The target semantic descriptor is passed as input to the selected domain adaptation agent. The target semantic descriptor is a high-dimensional vector containing deep semantic features extracted from face images, which are essential for performing face recognition reasoning.

[0122] 3. Perform face recognition reasoning: After receiving the target semantic descriptor, the domain adaptation agent will use its internally trained network structure and parameters to perform a series of complex nonlinear transformations and feature fusion operations to generate face recognition reasoning results related to the current recognition task. This process may involve multi-layer convolution, pooling, full connection and other operations, as well as the application of activation functions and normalization techniques.

[0123] 4. Output the inference result: Finally, the domain adaptation agent will output a vector or scalar representing the face recognition inference result. This result is usually expressed in the form of probability, reflecting the degree of match between the face to be recognized and the facial features under the specific recognition task. For example, in the shooting environment recognition task, the result may be a probability vector containing labels such as "indoor", "outdoor", and "night"; in the lighting condition recognition task, it may be a continuous value or classification label representing the light intensity.

[0124] For each recognition task, the computer will repeat the above process to obtain the corresponding face recognition inference results. These results will be used as inputs in subsequent steps to determine the final face recognition results and the importance coefficient of each task.

[0125] There may be certain correlation or complementarity between different domain adaptation agents. Therefore, when performing face recognition reasoning, it is also possible to consider using ensemble learning, multi-task learning, or transfer learning techniques to further improve the accuracy and robustness of reasoning. For example, the reasoning results of multiple domain adaptation agents can be fused through weighted summation, Bayesian networks, or conditional random fields; or transfer learning techniques can be used to transfer knowledge learned from one task to another related task to accelerate model convergence and improve performance.

[0126] In one implementation, the method further includes a training process of a second task agent, specifically including: Step S101: obtaining a second image sample set, wherein the second training face images covered by the second image sample set include task supervision information, wherein the task supervision information includes A task identifiers corresponding to A recognition tasks, wherein one recognition task corresponds to one task identifier, and the A task identifiers are determined according to the recognition tasks to which the second training face images belong; Step S102: obtaining a converged first task agent, using the first task agent to extract image descriptors for the second training face image, obtaining a fifth sample face descriptor for the second training face image, performing deep semantic feature extraction on the fifth sample face descriptor, and obtaining a fifth sample semantic descriptor corresponding to the fifth sample face descriptor; Step S103: obtaining A initial domain adaptation agents corresponding to A recognition tasks, performing task recognition on the fifth sample semantic descriptors according to the A, and obtaining A task support corresponding to the A initial domain adaptation agents; one recognition task corresponds to one initial domain adaptation agent, and one initial domain adaptation agent is used to determine one task support; Step S104: Determine the second target training cost based on A task supports and A task identifiers, modify the internal configuration variables of the A initial domain adaptation agents based on the second target training cost, determine the modified A initial domain adaptation agents as A domain adaptation agents, and determine the second task agent based on the A domain adaptation agents.

[0127] In step S101, the computer-in-one collects a second image sample set containing task supervision information from various data sources. These image samples not only contain facial image data, but also come with task identifiers related to A recognition tasks. Task supervision information is a label indicating the recognition task to which the image belongs. For example, assuming that A is equal to 4, and the recognition tasks include shooting environment, lighting conditions, facial expressions, and posture angles. Then each image in the second image sample set will be accompanied by a four-dimensional task identification vector, in which each element corresponds to a recognition task, and the value is 0 or 1, indicating whether the image belongs to the corresponding recognition task. For example, the task identification vector of a smiling face image taken indoors may be [1, 0, 1,0], indicating that it belongs to the shooting environment and facial expression recognition tasks, but not to the lighting conditions and posture angle recognition tasks.

[0128] In step S102, the computer uses the trained and converged first task agent to process the second training face image. The first task agent is a neural network specifically used for face recognition, which includes key components such as a semantic mining layer and can extract deep semantic features from face images.

[0129] For each second training face image, the all-in-one computer first uses the image descriptor extraction module in the first task agent to generate the corresponding fifth sample face descriptor. This is a high-dimensional vector that contains low-level or mid-level features of the face in the image. Subsequently, the fifth sample face descriptor is further processed using the deep semantic feature extraction module to generate the fifth sample semantic descriptor. This descriptor contains higher-level and more abstract semantic features and is the basis for subsequent task recognition. Through this process, the all-in-one computer generates a descriptor containing rich semantic information for each second training face image, providing a powerful input for the training of the domain adaptation agent.

[0130] In step S103, the computer obtains A initial domain adaptation agents corresponding to A recognition tasks. These agents are the initial state of the domain adaptation agents and have not been fully trained. Their task is to receive the fifth sample semantic descriptor as input and output the task support of the corresponding recognition task.

[0131] Task support is an indicator that indicates the confidence of a domain-adapted agent that a given image belongs to a certain recognition task. It is expressed in the form of probability, ranging from 0 to 1. For example, in the shooting environment recognition task, an initial domain-adapted agent may output a probability value indicating that the image belongs to the "indoor" environment as task support.

[0132] For each second training face image and the corresponding fifth sample semantic descriptor, the computer all-in-one inputs them into A initial domain adaptation agents and obtains the task support generated by each of them. In this way, for each image, a vector containing A task supports will be obtained, in which each element corresponds to a recognition task.

[0133] In step S104, the computer uses the A task supports and the corresponding task identifiers to calculate the second target training cost. The training cost is an indicator to measure the performance of the model, which reflects the difference between the model prediction result and the real task identifier.

[0134] Specifically, for each second training face image, the computer can calculate the loss value between its task support vector and the task identification vector. This loss value can be calculated in a variety of ways, such as cross entropy loss, mean square error loss, etc.

[0135] For the entire second image sample set, the average cross entropy loss of all images can be calculated as the second target training cost. Then, the internal configuration variables (such as the weights and biases of the neural network) of the A initial domain adaptation agents are modified according to the second target training cost using the back propagation algorithm.

[0136] Through multiple iterations of training, the performance of the domain adaptation agents will gradually improve, and they will be able to more accurately generate task support based on the fifth sample semantic descriptor. Finally, when the training process converges, the revised A initial domain adaptation agents will be determined as the final domain adaptation agents and form part of the second task agent.

[0137] In one implementation, the face descriptor is obtained by extracting the image descriptor from the image block matrix using the feature extraction network in the first task agent, the image block matrix is ​​obtained by performing an image block operation on the target face image using the input network in the first task agent, the first task agent is a neural network configured to perform face recognition on the face to be recognized; the neural network also includes a third task agent connected to the feature extraction network; step S140, evaluating the influence of the face descriptor to obtain the importance coefficient corresponding to each recognition task, including: Step S141: determining a third task agent in the neural network; Step S142: Use the third task agent to evaluate the influence of the face descriptor to obtain the importance coefficient corresponding to each recognition task.

[0138] In step S141, the position and structure of the third task agent is first determined in the neural network constructed internally. The third task agent is a key component in the neural network, which is responsible for receiving the face descriptor from the feature extraction network and evaluating its influence to generate the importance coefficient corresponding to each recognition task.

[0139] The third task agent is, for example, an independent neural network module, which may contain multiple network layers and parameter settings to meet the needs of the impact assessment task. This module may be closely connected to the feature extraction network, or it may communicate through some form of interface or protocol. In actual operation, the computer-in-one machine may need to determine the specific location and structure of the third task agent by consulting the architecture definition or configuration file of the neural network.

[0140] It is worth noting that the design of the third task agent varies depending on the specific application scenario and requirements. For example, it may be a simple fully connected network that performs linear transformation and nonlinear activation on the face descriptor to generate importance coefficients; it may also be a more complex convolutional neural network or recurrent neural network to capture spatial or temporal dependencies in the face descriptor. Regardless of the design, the core goal of the third task agent is to accurately evaluate the importance of each recognition task in the face recognition process.

[0141] After the position and structure of the third task agent are determined in step S141, the agent is used to evaluate the influence of the face descriptor. This process involves passing the face descriptor as input to the third task agent and obtaining the importance coefficient vector of its output.

[0142] Specifically, for each face descriptor, the following operations are performed: 1. Input face descriptor: Pass the face descriptor as input to the third task agent. The face descriptor is a high-dimensional vector that contains deep semantic features extracted from the target face image. These features are crucial for evaluating the importance of the recognition task.

[0143] 2. Execute influence evaluation: After receiving the face descriptor, the third task agent will use its internally trained network structure and parameters to perform a series of complex nonlinear transformations and feature fusion operations to generate importance coefficients related to each recognition task. This process may involve multi-layer convolution, pooling, full connection and other operations, as well as the application of activation functions and normalization techniques.

[0144] 3. Output importance coefficient: Finally, the third task agent will output a vector representing the importance coefficient of each recognition task. Each element in this vector corresponds to the importance coefficient of a recognition task, which reflects the contribution of the task to the final recognition result. The value range of the importance coefficient is usually between 0 and 1, and the larger the value, the more important the task.

[0145] In practical applications, the third task agent can use a variety of methods to evaluate the importance of the recognition task. For example, the importance coefficient can be determined based on the frequency or intensity of specific features in the face descriptor; or it may use technologies such as attention mechanisms or gating networks to dynamically adjust the importance of different tasks.

[0146] In one implementation, the neural network further includes a second task agent configured to determine a face recognition reasoning result corresponding to each recognition task; the method further includes a training process of a third task agent, specifically including: Step S1401: obtaining a third image sample set, wherein the third training face images covered by the third image sample set are associated with face supervision information; Step S1402: obtaining a converged first task agent, using the first task agent to extract image descriptors for the third training face image, obtaining a sixth sample face descriptor for the third training face image, performing deep semantic feature extraction on the sixth sample face descriptor, and obtaining a sixth sample semantic descriptor corresponding to the sixth sample face descriptor; Step S1403: Obtain the converged second task agent, use A domain adaptation agents in the second task agent to perform face recognition reasoning on the sixth sample semantic descriptor, and obtain a sample face recognition reasoning result corresponding to each recognition task, and a domain adaptation agent is configured to determine a sample face recognition reasoning result corresponding to a recognition task; Step S1404: using the third task agent to be trained to evaluate the influence of the sixth sample face descriptor to obtain the sample importance coefficient corresponding to each recognition task; Step S1405: determining a training face recognition result of a training user associated with the third training face image according to the sample face recognition inference result corresponding to each recognition task and the sample importance coefficient corresponding to each recognition task; Step S1406: Determine the third target training cost based on the face supervision information and the training face recognition result, modify the internal configuration variables of the third task agent to be trained based on the third target training cost, determine the modified third task agent to be trained as the third task agent, and determine the neural network based on the first task agent, the second task agent and the third task agent.

[0147] In step S1401, a third set of image samples containing face supervision information is collected from various data sources. These image samples not only contain face image data, but also come with face supervision information associated with each image, such as face identity labels or attribute labels. Face supervision information is crucial for training the third task agent because it provides clear indications about the true identity of the face in the image, which helps the model learn how to accurately assess the importance of the recognition task.

[0148] For example, suppose the third image sample set contains 1,000 different face images, each of which is accompanied by a unique face identity label. These labels may be expressed in numbers, strings, or other forms, and are used to indicate the face identity corresponding to each image during training. By collecting such an image sample set containing rich face supervision information, the all-in-one computer provides a solid foundation for the training of the third task agent.

[0149] In step S1402, the third training face image is processed using the trained and converged first task agent. The first task agent is a neural network specifically used for face recognition, which includes key components such as feature extraction network and semantic mining layer, and can extract deep semantic features from face images.

[0150] For each third training face image, the all-in-one computer first uses the feature extraction network in the first task agent to generate the corresponding sixth sample face descriptor. This is a high-dimensional vector that contains low-level or mid-level features of the face in the image, such as edges, textures, shapes, etc. Subsequently, the sixth sample face descriptor is further processed using the semantic mining layer to generate the sixth sample semantic descriptor. This descriptor contains higher-level and more abstract semantic features, which is the basis for subsequent face recognition reasoning and influence evaluation.

[0151] Through this process, the all-in-one computer generates a descriptor containing rich semantic information for each third training face image, providing powerful input for the training of the third task agent.

[0152] In step S1403, the computer obtains the trained and converged second task agent, and uses A domain adaptation agents therein to perform face recognition reasoning on the sixth sample semantic descriptor. The second task agent is a multi-task learning model, which includes multiple domain adaptation agents for different recognition tasks, each of which is specially trained to perform face recognition reasoning under a specific task.

[0153] For each third training face image and the corresponding sixth sample semantic descriptor, input them into A domain adaptation agents in the second task agent, and obtain the sample face recognition inference results generated by each of them. These results are usually expressed in the form of a probability vector, where each element corresponds to the probability value of a predefined face category. For example, if the system predefines 1000 face categories, then each domain adaptation agent will output a probability vector containing 1000 elements, indicating the probability that the image belongs to each category.

[0154] Through this process, the computer-in-one machine generates A sample face recognition inference results for each third training face image, and each result corresponds to a recognition task. These results will serve as the basis for subsequent impact evaluation and training face recognition result generation.

[0155] In step S1404, the computer uses the third task agent to be trained to evaluate the influence of the sixth sample face descriptor to generate a sample importance coefficient corresponding to each recognition task. The third task agent to be trained is a neural network module that has not been fully trained and is responsible for evaluating the relative importance of different recognition tasks in the face recognition process.

[0156] For each third training face image and the corresponding sixth sample face descriptor, the computer all-in-one inputs it into the third task agent to be trained and obtains the sample importance coefficient vector output by it. Each element in this vector corresponds to the importance coefficient of a recognition task, which reflects the contribution of the task to the final recognition result. The value range of the importance coefficient is usually between 0 and 1, and the larger the value, the more important the task.

[0157] In the process of influence evaluation, the third task agent to be trained may use a variety of methods to determine the sample importance coefficient. For example, it may determine the importance coefficient based on the frequency or intensity of specific features in the sixth sample face descriptor; it may also use technologies such as attention mechanism or gated network to dynamically adjust the importance of different tasks.

[0158] In step S1405, the computer determines the training face recognition result of the training user associated with the third training face image based on the sample face recognition reasoning result and the sample importance coefficient corresponding to each recognition task. This process involves weighted fusion of the reasoning results of multiple recognition tasks to generate a final recognition result that comprehensively considers the contributions of all tasks.

[0159] Specifically, the sample face recognition inference results of each recognition task are first weighted and summed, and the weight is the corresponding sample importance coefficient. In this way, the contribution of each task to the final recognition result will be dynamically adjusted according to its importance coefficient. Then, the result of the weighted summation is used as the training face recognition result for the training user. This result is usually expressed in the form of a probability vector, where each element corresponds to a probability value of a predefined face category, indicating the comprehensive probability that the image belongs to each category. Through this process, the all-in-one computer generates a more accurate and robust training face recognition result, which comprehensively considers the contribution of multiple recognition tasks and dynamically adjusts the importance of different tasks.

[0160] In step S1406, the third target training cost is calculated based on the face supervision information and the training face recognition result, and the internal configuration variables of the third task agent to be trained are corrected using the cost. The training cost is an indicator to measure the performance of the model, which reflects the difference between the model prediction result and the real face supervision information.

[0161] Specifically, the cross entropy loss between the training face recognition result and the face supervision information can be calculated as the third objective training cost. By minimizing the cross entropy loss, the all-in-one computer can gradually optimize the internal configuration variables (such as the weights and biases of the neural network) of the third task agent to be trained to improve the accuracy of its influence evaluation.

[0162] In actual operation, the back propagation algorithm is used to update the parameters of the third task agent. Through multiple iterations of training, the performance of the third task agent will gradually improve. It can more accurately evaluate the importance of each recognition task and generate reasonable training face recognition results. Finally, when the training process converges, the revised third task agent will be determined as the final third task agent and become an important part of the neural network.

[0163] In one implementation, the third task agent includes a path selector and a threshold controller; step S142, using the third task agent to evaluate the influence of the face descriptor to obtain the importance coefficient corresponding to each recognition task, including: Step S1421: using a path selector to extract path depth semantic features from the face descriptor to obtain a path semantic descriptor corresponding to the face descriptor; Step S1422: Use a threshold controller to perform weight detection on the path semantic descriptor to obtain the importance coefficient corresponding to each recognition task.

[0164] In step S1421, the face descriptor is passed as input to the path selector. The face descriptor is a high-dimensional vector that contains deep semantic features extracted from the target face image. These features are crucial for evaluating the importance of different recognition tasks.

[0165] The path selector is a complex neural network module that contains multiple network layers and parameter settings to adapt to the needs of path deep semantic feature extraction. After receiving the face descriptor, the path selector will perform a series of nonlinear transformations and feature fusion operations to extract deep semantic features related to different recognition tasks.

[0166] Specifically, the path selector may be implemented using architectures such as convolutional neural networks (CNN), recurrent neural networks (RNN), or transformers. It may contain multiple convolutional layers, pooling layers, fully connected layers, and attention mechanisms. These components work together to process the face descriptors step by step to extract more abstract and advanced feature representations.

[0167] For example, in a CNN architecture, the path selector may first extract local features from face descriptors through a convolutional layer, and then reduce and aggregate the features through a pooling layer. Next, the features are further fused and transformed through a fully connected layer to generate path semantic descriptors related to different recognition tasks. These descriptors may be represented in the form of vectors, each of which corresponds to a deep semantic feature of a recognition task.

[0168] Through the processing of the path selector, a set of path semantic descriptors can be generated for each face descriptor, which contain deep semantic features related to different recognition tasks. These features will provide powerful input for the subsequent threshold controller to generate the importance coefficient of each recognition task.

[0169] In step S1422, the computer all-in-one passes the path semantic descriptor as input to the threshold controller. The threshold controller is a gated network that is responsible for weight detection of these descriptors to determine the importance coefficient of each recognition task.

[0170] The threshold controller may be implemented using architectures such as a fully connected network, an attention mechanism, or a gated recurrent unit (GRU). It contains multiple network layers and parameter settings to adapt to the needs of weight detection. After receiving the path semantic descriptor, the threshold controller will perform a series of nonlinear transformations and feature fusion operations to generate the importance coefficients for each recognition task.

[0171] Specifically, the threshold controller first performs global feature extraction on the path semantic descriptor to capture the overall information in the descriptor. Then, each descriptor is weighted through an attention mechanism or a gating mechanism to determine its contribution to the final importance coefficient calculation. Finally, the weighted descriptors are fused and transformed to generate the importance coefficient for each recognition task.

[0172] For example, in the attention mechanism, the threshold controller assigns an attention weight to each path semantic descriptor, which reflects the relevance between the descriptor and the corresponding recognition task. Then, the descriptors are fused by weighted summation to generate the importance coefficient of each recognition task. These coefficients can be expressed in the form of scalars, usually ranging from 0 to 1, with larger values ​​indicating more important tasks.

[0173] It is worth noting that the network layers and parameter settings in the threshold controller may also vary depending on the specific application scenarios and requirements. For example, when dealing with face recognition problems that involve multiple interrelated recognition tasks, the threshold controller needs to adopt a more complex attention mechanism or gating mechanism to capture the dependencies between tasks. In addition, the threshold controller may also use techniques such as ensemble learning or transfer learning to improve its performance.

[0174] Through the processing of the threshold controller, the computer all-in-one can generate an importance coefficient for each recognition task. These coefficients reflect the relative importance of different tasks in the face recognition process, providing strong support for subsequent multi-task fusion and decision-making.

[0175] In one implementation, the A recognition tasks include a target recognition task; and the method further includes: Step S160: obtaining a neural network for performing face recognition on a face to be recognized, and obtaining an original adaptation network for performing knowledge extraction and learning from the neural network; Step S170: acquiring a fourth image sample set corresponding to the target recognition task, the fourth image sample set including a fourth training face image; Step S180: using a neural network to process the fourth training face image to obtain a face recognition result corresponding to the fourth training face image, and using the face recognition result corresponding to the fourth training face image as a generation mark for training the original adaptation network; Step S190: using the original adaptation network to process the fourth training face image to obtain an adapted face recognition result corresponding to the fourth training face image; Step S200: modify the internal configuration variables of the original adaptation network according to the adaptation face recognition result and the generated mark, and determine the modified original adaptation network as the target adaptation network of the neural network. The target adaptation network is configured to perform face recognition on the target face image under the target recognition task.

[0176] In the above implementation, through a series of carefully designed steps, it is possible to extract knowledge from the trained neural network and transfer it to a new original adaptation network to build a target adaptation network specifically for target recognition tasks. This process not only improves the performance of target recognition tasks, but also enhances the generalization ability and adaptability of the model.

[0177] In step S160, a neural network that has been trained and used to perform face recognition on a face to be recognized is first obtained. This neural network is, for example, a complex model including multiple task agents (such as a first task agent, a second task agent, and a third task agent), which can extract deep semantic features from an input face image and perform multi-task face recognition based on these features.

[0178] At the same time, an original adaptation network is also obtained. The original adaptation network is a migration network that aims to extract knowledge from a trained neural network and transfer it to a new task or domain. The structure of the original adaptation network may be similar to that of a neural network, but its internal configuration variables (such as weights and biases) have not been fully trained.

[0179] In step S170, a fourth image sample set related to the target recognition task is obtained. This set contains a large number of training face images related to the target recognition task, and these images will be used in the subsequent knowledge extraction and model training process. For example, suppose the target recognition task is to recognize the faces of specific groups of people (such as the elderly, children, or a specific race). Then the fourth image sample set will contain a large number of face images belonging to these specific groups of people, and a small number of face images that do not belong to these groups of people but have similar features as negative samples. These images will help the computer-in-one better understand the needs and challenges of the target recognition task.

[0180] In step S180, the fourth training face image is processed using the trained neural network. For each image, the neural network will output a face recognition result, which may be a probability vector or a scalar value, indicating the probability or confidence that the image belongs to different face categories. These face recognition results are then used as generated labels (or pseudo labels) to train the original adaptation network. Since the neural network has been fully trained and has good performance, the face recognition results it outputs can be used as reliable supervisory information to guide the learning process of the original adaptation network.

[0181] In step S190, the fourth training face image is input into the original adaptation network, and the adapted face recognition result outputted by the network is obtained. These results represent the original adaptation network's ability to understand and recognize the input image. Since the original adaptation network has not been fully trained, the adapted face recognition result outputted by the network may differ from the face recognition result of the neural network. These differences reflect the deficiencies and challenges of the original adaptation network in the target recognition task.

[0182] In step S200, the training cost of the original adaptation network is calculated based on the difference between the adapted face recognition result and the generated mark, and the internal configuration variables of the original adaptation network are corrected using the back propagation algorithm. This process is an iterative process. Through multiple iterative training, the performance of the original adaptation network will gradually improve and gradually approach the performance level of the neural network. Finally, when the training process converges, the corrected original adaptation network will be determined as the target adaptation network. The target adaptation network is a neural network model specifically used for target recognition tasks. It inherits the useful knowledge in the neural network and is optimized and adjusted for target recognition tasks. Therefore, the target adaptation network has better performance and generalization ability in target recognition tasks.

[0183] In the specific implementation process, a variety of strategies can be used to optimize the training process of the original adaptation network. For example, transfer learning technology can be used to accelerate the convergence speed of the original adaptation network; data enhancement technology can be used to increase the diversity and number of training samples; ensemble learning technology can be used to improve the robustness and accuracy of the model, etc.

[0184] In addition, the structure and parameters of the target adaptation network can be further optimized and adjusted. For example, the number and type of network layers can be adjusted according to the requirements of the target recognition task; the weight initialization method and strategy can be adjusted according to the distribution of training data; the learning rate and regularization parameters can be adjusted according to the performance of the model, etc.

[0185] Through the implementation of this series of steps, a target adaptation network specifically for target recognition tasks was constructed. This target adaptation network not only inherits the useful knowledge in the neural network, but also optimizes and adjusts it for target recognition tasks, thereby showing better performance and generalization ability in target recognition tasks. This provides strong support for subsequent face recognition applications.

[0186] In one implementation, the fourth training face image includes a task training face image under the target recognition task, and step S170, obtaining a fourth image sample set corresponding to the target recognition task, includes: Step S171: Acquire a task training face image under a target recognition task; Step S172: arbitrarily selecting a training face image to be identified from the training face image set; Step S173: using an enhancer to perform similarity calculation on the training face image to be identified and the task training face image, to obtain a similarity score between the task training face image and the training face image to be identified; Step S174: when the similarity score reaches the strengthening requirement, the training face image to be recognized is used as the strengthening training face image corresponding to the target recognition task; Step S175: taking the enhanced training face image and the task training face image as the fourth training face image corresponding to the target recognition task.

[0187] In step S171, task training face images directly related to the target recognition task are first obtained. These images are collected specifically for this task and contain a large number of face samples that fall within the scope of the target recognition task. For example, if the target recognition task is to recognize faces of a specific age group (such as the elderly), then the task training face images will contain a large number of facial images of the elderly. The quality and quantity of the task training face images are crucial for subsequent steps. They not only provide reference standards for the enhancer, but also directly affect the representativeness and diversity of the enhanced training face images that are finally screened. Therefore, when collecting task training face images, ensure the clarity, completeness, and label accuracy of the images.

[0188] In step S172, a training face image to be identified is randomly selected from a training face image set containing a large number of face images. This image will be used as a candidate sample and similarity calculation will be performed with the task training face image to determine whether it is suitable as a reinforcement training face image. The training face image set may be a large and diverse data set, including face images from different age groups, genders, races, and lighting conditions. By randomly selecting training face images to be identified, the all-in-one computer can increase the diversity of samples and reduce the impact of selection bias on the final result.

[0189] In step S173, an enhanced network called a reinforcer is used to calculate the similarity between the training face images to be identified and the task training face images. The reinforcer is a specially trained neural network model that can learn and capture the subtle differences and similarities between face images. The process of similarity calculation may involve a variety of feature extraction and matching algorithms. For example, the reinforcer may first use a convolutional neural network (CNN) to extract deep semantic features from the training face images to be identified and the task training face images. Then, the similarity between the images is evaluated by calculating the cosine similarity, Euclidean distance or other metrics between these feature vectors. Finally, the reinforcer will output a similarity score that reflects the degree of similarity between the training face images to be identified and the task training face images. The higher the score, the more similar the two images are; the lower the score, the greater the difference between the two images.

[0190] In step S174, it is determined whether the training face image to be identified is suitable as a reinforcement training face image according to a preset reinforcement requirement. The reinforcement requirement is a threshold or condition used to screen image samples that are sufficiently similar to the task training face image.

[0191] Specifically, if the similarity score is higher than or equal to the threshold set by the reinforcement requirement, the computer-in-one machine will consider the training face image to be highly relevant to the target recognition task and retain it as a reinforcement training face image. These images will form part of the fourth image sample set together with the task training face images for subsequent knowledge extraction and model training. On the contrary, if the similarity score is lower than the threshold set by the reinforcement requirement, the computer-in-one machine will consider the training face image to be insufficiently relevant to the target recognition task and remove it from the candidate samples. This process helps to reduce the impact of sample noise and redundant information on the final result.

[0192] In step S175, the selected reinforcement training face images are combined with the task training face images to form a fourth training face image set corresponding to the target recognition task. This set contains a large number of face image samples that are highly relevant to the target recognition task, which will be used in the subsequent knowledge extraction and model training process.

[0193] Through the implementation of this series of steps, a high-quality and highly relevant fourth training face image set is constructed. This set not only contains rich sample diversity, but also ensures a high relevance between the samples and the target recognition task. This provides strong support for subsequent knowledge extraction and model training, and helps to improve the performance and generalization ability of the target adaptation network in the target recognition task.

[0194] In one implementation, step S150, based on the face recognition inference result corresponding to each recognition task and the importance coefficient corresponding to each recognition task, determines the face recognition result of the face to be recognized, including: Step S151: The importance coefficient corresponding to each recognition task is multiplied by the face recognition inference result corresponding to each recognition task to obtain an adjusted recognition result corresponding to each recognition task; Step S152: Determine the face recognition result of the face to be recognized according to the adjusted recognition result corresponding to each recognition task.

[0195] In step S151, the importance coefficient and face recognition inference result corresponding to each recognition task are first obtained. The importance coefficient is a scalar value that reflects the contribution of the task to the final recognition result; the face recognition inference result is a probability vector or scalar value that indicates the probability or confidence that the face to be recognized belongs to different face categories.

[0196] Then, the computer all-in-one machine multiplies the importance coefficient of each recognition task with its corresponding face recognition inference result. The purpose of this operation is to weight the face recognition inference result according to the importance coefficient to highlight the contribution of important tasks to the final result and suppress the influence of unimportant tasks.

[0197] Specifically, suppose there are A recognition tasks, and the importance coefficient corresponding to each task is w i (where i=1,2,...,A), the face recognition inference result is p i Then, adjust the recognition result r i It can be calculated by the following formula: ; This formula represents the importance coefficient w i Compared with the face recognition inference result p i Multiply them to get the adjusted recognition result r i Adjusting the recognition result not only retains the probability or confidence information in the original reasoning result, but also incorporates the importance weight of the task, making the final result more in line with actual needs.

[0198] In step S152, the computer determines the final face recognition result of the face to be recognized based on the adjusted recognition result of each recognition task. This process may involve the fusion and decision-making of multiple adjusted recognition results. Specifically, a variety of strategies can be used to determine the final recognition result. For example, a weighted summation method can be used to fuse multiple adjusted recognition results, where the weight can be set according to the importance coefficient of the task or other factors. The formula for weighted summation can be expressed as: ; Among them, r iis the adjusted recognition result of each recognition task, and Final Result is the final recognition result. This formula means that all the adjusted recognition results are summed to obtain the final recognition probability or confidence. In addition, voting mechanism, maximum probability selection or conditional random field can also be used to determine the final recognition result. These methods have their own advantages and disadvantages. The specific method to be selected depends on the requirements of the task and the distribution characteristics of the data.

[0199] Through the implementation of steps S151 and S152, the all-in-one computer can comprehensively consider the face recognition reasoning results of each recognition task and its corresponding importance coefficient, so as to determine a more accurate and robust final recognition result.

[0200] Figure 2 A hardware entity diagram of a smart all-in-one computer provided in an embodiment of the present application, such as Figure 2 As shown, the hardware entity of the smart computer all-in-one 1000 includes: a processor 1001 and a memory 1002, wherein the memory 1002 stores a computer program that can be run on the processor 1001, and the processor 1001 implements the steps in the method of any of the above embodiments when executing the program.

[0201] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A face recognition method, characterized in that: The method comprises: Extracting image descriptors from the target face image to be recognized to obtain face descriptors corresponding to the target face image; Performing deep semantic feature extraction on the face descriptor to obtain a target semantic descriptor corresponding to the face descriptor; Determine A recognition tasks corresponding to the target face image, perform face recognition reasoning on the target semantic descriptor based on each recognition task, and obtain face recognition reasoning results corresponding to each recognition task, where A is a natural number greater than 0; Performing influence evaluation on the face descriptor to obtain the importance coefficient corresponding to each recognition task; The face recognition result of the face to be recognized is determined according to the face recognition inference result corresponding to each recognition task and the importance coefficient corresponding to each recognition task.

2. The method according to claim 1, characterized in that: The target semantic descriptor is obtained by performing deep semantic feature extraction on the face descriptor using the semantic mining layer in the first task agent; the first task agent is a neural network configured to perform face recognition on the face to be recognized; The method further comprises: Acquire a first image sample set; the first training face images covered by the first image sample set are training face images that do not contain face supervision information; Obtain B training branches for the first task agent to be trained; B is a natural number greater than 0; Using the first task agent to be trained to process the first training face image, obtain a sample semantic descriptor related to each training branch, and determine B training costs corresponding to the B training branches according to the sample semantic descriptors, where one training branch corresponds to one training cost; A first target training cost is determined based on the B training costs, an internal configuration variable of the first task agent to be trained is modified based on the first target training cost, and the modified first task agent to be trained is determined as the first task agent.

3. The method according to claim 2, characterized in that The B training branches include an image block mask detection branch, the first training face image is processed by the first task agent to be trained to obtain a sample semantic descriptor related to each training branch, and B training costs corresponding to the B training branches are determined according to the sample semantic descriptors, including: Using the first task agent to be trained to perform an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; the first training image block matrix includes training image blocks on a plurality of matrix elements; Randomly selecting a first matrix element to be used for image block masking from a plurality of matrix elements corresponding to the first training image block matrix; Performing image block masking processing on the training image blocks on the first matrix elements in the first training image block matrix based on the image block masking identifier to obtain a first sample image block matrix; Using the first task agent to be trained to extract image descriptors from the first sample image block matrix to obtain a first sample face descriptor from the first sample image block matrix, performing deep semantic feature extraction on the first sample face descriptor to obtain a first sample semantic descriptor corresponding to the first sample face descriptor, wherein the first sample semantic descriptor belongs to the sample semantic descriptor; Using a detection network layer corresponding to the image block mask detection branch, perform mask image block detection on the first sample semantic descriptor to obtain an estimated image block corresponding to the image block mask identifier in the first sample image block matrix; The training cost corresponding to the image block mask detection branch is determined according to the training image blocks on the first matrix elements in the first training image block matrix and the estimated image blocks.

4. The method according to claim 2, characterized in that: The B training branches include an image block forgery detection branch; the first training face image is processed by the first task agent to be trained to obtain a sample semantic descriptor related to each training branch, and B training costs corresponding to the B training branches are determined according to the sample semantic descriptors, including: Using the first task agent to be trained to perform an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; the first training image block matrix includes training image blocks on a plurality of matrix elements; Randomly selecting a second matrix element to perform image block forging from a plurality of matrix elements corresponding to the first training image block matrix; Performing image block forgery on the training image blocks on the second matrix elements in the first training image block matrix using random pixels, wherein the random pixels are different from the training image blocks on the second matrix elements, to obtain a second sample image block matrix; Using the first task agent to be trained to perform image descriptor extraction on the second sample image block matrix to obtain a second sample face descriptor of the second sample image block matrix, performing deep semantic feature extraction on the second sample face descriptor to obtain a second sample semantic descriptor corresponding to the second sample face descriptor, wherein the second sample semantic descriptor belongs to the sample semantic descriptor; Using the detection network layer corresponding to the image block forgery detection branch, perform forgery element detection on the second sample semantic descriptor to obtain image block forgery estimation elements corresponding to the multiple matrix elements; The training cost corresponding to the image block forgery detection branch is determined according to the second matrix element and the image block forgery prediction elements corresponding to the plurality of matrix elements.

5. The method according to claim 2, characterized in that: The B training branches include an image block enhancement branch; the first training face image is processed by the first task agent to be trained to obtain a sample semantic descriptor related to each training branch, and B training costs corresponding to the B training branches are determined according to the sample semantic descriptors, including: Randomly enhancing the image block pixel channels of the first training face image to obtain an enhanced training face image, and performing an image block operation on the enhanced training face image to obtain an enhanced image block matrix of the enhanced training face image; Performing an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; Using the first task agent to be trained to extract image descriptors from the enhanced image block matrix to obtain a third sample face descriptor of the enhanced image block matrix, performing deep semantic feature extraction on the third sample face descriptor to obtain a third sample semantic descriptor corresponding to the third sample face descriptor, wherein the third sample semantic descriptor belongs to the sample semantic descriptor; Using the first task agent to be trained to extract image descriptors from the first training image block matrix to obtain a fourth sample face descriptor of the first training image block matrix, performing deep semantic feature extraction on the fourth sample face descriptor to obtain a fourth sample semantic descriptor corresponding to the fourth sample face descriptor, wherein the fourth sample semantic descriptor belongs to the sample semantic descriptor; The training cost corresponding to the image block enhancement branch is determined according to the third sample semantic descriptor and the fourth sample semantic descriptor.

6. The method according to claim 2, characterized in that The B training branches include a label generation branch; the first training face image is processed by the first task agent to be trained to obtain a sample semantic descriptor related to each training branch, and B training costs corresponding to the B training branches are determined according to the sample semantic descriptors, including: Performing an image block operation on the first training face image to obtain a first training image block matrix of the first training face image; Using the first task agent to be trained to extract image descriptors from the first training image block matrix to obtain a fourth sample face descriptor of the first training image block matrix, performing deep semantic feature extraction on the fourth sample face descriptor to obtain a fourth sample semantic descriptor corresponding to the fourth sample face descriptor, wherein the fourth sample semantic descriptor belongs to the sample semantic descriptor; Performing face recognition on the fourth sample semantic descriptor through the detection network layer corresponding to the tag generation branch to obtain a training face recognition result corresponding to the first training face image; Acquire a past agent corresponding to the first task agent to be trained, perform face recognition on the first training face image based on the past agent, and obtain a label corresponding to the first training face image to generate a face recognition inference result; The training cost corresponding to the label generation branch is determined according to the training face recognition result and the label generation face recognition inference result.

7. The method according to claim 1, characterized in that The target semantic descriptor is obtained by performing deep semantic feature extraction on the face descriptor using the semantic mining layer in the first task agent; the first task agent is a neural network configured to perform face recognition on the face to be recognized, and the neural network also includes a second task agent connected to the semantic mining layer; the face recognition reasoning is performed on the target semantic descriptor based on each recognition task, and the face recognition reasoning result corresponding to each recognition task is obtained, including: Determining a second task agent from the neural network, wherein the second task agent includes a domain adaptation agent corresponding to each recognition task; Using a domain adaptation agent corresponding to each recognition task to perform face recognition reasoning on the target semantic descriptor to obtain a face recognition reasoning result corresponding to each recognition task, wherein one domain adaptation agent is used to determine a face recognition reasoning result corresponding to one recognition task; The method further comprises: Acquire a second image sample set, where the second training face images covered by the second image sample set include task supervision information, where the task supervision information includes A task identifiers corresponding to the A recognition tasks, where one recognition task corresponds to one task identifier, and the A task identifiers are determined based on the recognition tasks to which the second training face images belong; Acquire a converged first task agent, use the first task agent to extract image descriptors for the second training face image, obtain a fifth sample face descriptor for the second training face image, perform deep semantic feature extraction on the fifth sample face descriptor, and obtain a fifth sample semantic descriptor corresponding to the fifth sample face descriptor; Acquire A initial domain adaptation agents corresponding to the A recognition tasks, perform task recognition on the fifth sample semantic descriptors according to the A agents, and obtain A task support corresponding to the A initial domain adaptation agents; one recognition task corresponds to one initial domain adaptation agent, and one initial domain adaptation agent is used to determine one task support; A second target training cost is determined based on the A task supports and the A task identifiers. Based on the second target training cost, the internal configuration variables of the A initial domain adaptation agents are corrected, the corrected A initial domain adaptation agents are determined as the A domain adaptation agents, and the second task agent is determined based on the A domain adaptation agents.

8. The method according to claim 1, characterized in that The face descriptor is obtained by extracting the image descriptor from the image block matrix using the feature extraction network in the first task agent, the image block matrix is ​​obtained by performing an image block operation on the target face image using the input network in the first task agent, the first task agent is a neural network configured to perform face recognition on the face to be recognized; the neural network also includes a third task agent connected to the feature extraction network; the influence evaluation of the face descriptor to obtain the importance coefficient corresponding to each recognition task includes: determining a third task agent in the neural network; Using the third task agent to evaluate the influence of the face descriptor to obtain the importance coefficient corresponding to each recognition task; The neural network also includes a second task agent configured to determine the face recognition reasoning result corresponding to each recognition task; the method also includes: Acquire a third image sample set, wherein third training face images covered by the third image sample set are associated with face supervision information; Acquire a converged first task agent, use the first task agent to extract image descriptors for the third training face image, obtain a sixth sample face descriptor of the third training face image, perform deep semantic feature extraction on the sixth sample face descriptor, and obtain a sixth sample semantic descriptor corresponding to the sixth sample face descriptor; Acquire a converged second task agent, use A domain adaptation agents in the second task agent to perform face recognition reasoning on the sixth sample semantic descriptor, and obtain a sample face recognition reasoning result corresponding to each recognition task, wherein a domain adaptation agent is configured to determine a sample face recognition reasoning result corresponding to a recognition task; Using the third task agent to be trained to evaluate the influence of the sixth sample face descriptor to obtain the sample importance coefficient corresponding to each recognition task; Determining a training face recognition result of a training user associated with the third training face image according to the sample face recognition inference result corresponding to each recognition task and the sample importance coefficient corresponding to each recognition task; Determine a third target training cost according to the face supervision information and the training face recognition result, modify the internal configuration variables of the third task agent to be trained according to the third target training cost, determine the modified third task agent to be trained as the third task agent, and determine the neural network according to the first task agent, the second task agent and the third task agent; The third task agent includes a path selector and a threshold controller; The adopting the third task agent to evaluate the influence of the face descriptor to obtain the importance coefficient corresponding to each recognition task includes: Using the path selector to extract path depth semantic features from the face descriptor to obtain a path semantic descriptor corresponding to the face descriptor; The threshold controller is used to perform weight detection on the path semantic descriptor to obtain the importance coefficient corresponding to each recognition task.

9. The method according to claim 1, characterized in that: The A recognition tasks include a target recognition task; the method further includes: Acquire a neural network for performing face recognition on a face to be recognized, and acquire an original adaptation network for performing knowledge extraction and learning from the neural network; Acquire a fourth image sample set corresponding to the target recognition task, wherein the fourth image sample set includes a fourth training face image; Processing the fourth training face image using the neural network to obtain a face recognition result corresponding to the fourth training face image, and using the face recognition result corresponding to the fourth training face image as a generation mark for training the original adaptation network; Processing the fourth training face image using the original adaptation network to obtain an adapted face recognition result corresponding to the fourth training face image; The internal configuration variables of the original adaptation network are modified according to the adapted face recognition result and the generated mark, and the modified original adaptation network is determined as the target adaptation network of the neural network, and the target adaptation network is configured to perform face recognition on the target face image under the target recognition task.

10. An intelligent computer all-in-one machine using a face recognition method, comprising a memory and a processor, wherein the memory stores a computer program that can be run on the processor, characterized in that: When the processor executes the program, the steps in the method according to any one of claims 1 to 9 are implemented.

Citation Information

Cited By

  • Face recognition method and device based on biological characteristics and time-space fusion

    CN120375439A

  • Automatic temperature and humidity regulation and control system and method based on silkworm growth stage

    CN121115963A