Face detection method and device based on deep neural network

Through the face detection method of deep neural network, the descriptor mining algorithm is used to extract features from face images and description texts, which solves the problem of traditional methods relying on a large number of prior labels for training data, and achieves efficient face recognition and description matching. , which improves the flexibility and response speed of the algorithm.

CN118470782BActive Publication Date: 2024-09-17MICRONET UNION TECH (CHENGDU) CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202410931068.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-12
Publication Date
2024-09-17
Estimated Expiration
2044-07-12

AI Technical Summary

Technical Problem

Traditional face recognition technology relies on a large amount of a priori labeled training data, resulting in data annotation that is time-consuming and costly, the training process is cumbersome, the response is delayed, and the flexibility is poor, making it difficult to adapt to scene changes.

Method used

A face detection method based on deep neural networks is adopted, and features are extracted from face images and description texts through descriptor mining algorithms. No prior information is used for training, which reduces the training difficulty and improves the flexibility and response speed of the algorithm.

Benefits of technology

It achieves the matching of face images and description texts without prior information, reduces training costs and time, improves the flexibility and response speed of the algorithm, and overcomes the cumbersomeness and delay problems of traditional methods.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118470782B
    Figure CN118470782B
Patent Text Reader

Abstract

The present invention provides a face detection method and device based on a deep neural network, which realizes face detection and text generation by using a descriptor mining algorithm. When the algorithm is trained, the first generation value is determined based on the acquisition of face training images and description training texts without prior information, and based on the facial descriptor and the corresponding true training text descriptor, and the second generation value is obtained based on the text descriptor and the corresponding true training face descriptor, so as to complete the training of the descriptor mining algorithm based on the first generation value and the second generation value, and the facial descriptor corresponding to the approximate face image mined by the descriptor mining algorithm can be adapted to the text descriptor corresponding to the approximate description text, and the descriptor mining algorithm is trained without prior information, so that the matching of the facial descriptor mined by the descriptor mining algorithm and the text descriptor is not too strict, the training difficulty is reduced, and the problems of high algorithm training cost, slow speed, and response delay are overcome.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of deep learning technology, and in particular to a face detection method and device based on a deep neural network. Background Art

[0002] In the field of image processing and artificial intelligence, the technology of associating images with text has always been a hot topic of research. Especially in the field of face recognition and description, how to accurately extract facial features from images and match them with corresponding text descriptions is a challenging technical problem. Traditional methods often rely on a large amount of prior information, that is, a large amount of training data with clear labels needs to be prepared in advance. These data need to contain not only facial images, but also detailed description texts corresponding to the images. Then, the algorithm is trained with this prior information so that it can recognize and describe facial features. However, this method has many disadvantages. First, preparing a large amount of training data with clear prior labels is a time-consuming and costly task. This not only requires professional labelers, but also takes a lot of time to ensure the accuracy of the labeling. In addition, due to the complexity and diversity of facial features, even with a large amount of training data, it is difficult to ensure that the algorithm can accurately recognize and describe all facial features. Secondly, the training process of traditional methods is often very cumbersome and time-consuming. Due to the need for a large amount of training data, the training time of the algorithm is often very long, which directly leads to the response delay of the algorithm and cannot meet the real-time requirements. Moreover, due to the reliance on a large amount of prior information, the flexibility of traditional methods is poor. Once the training data changes or needs to adapt to new scenarios, re-training is required, which undoubtedly increases the maintenance cost and difficulty of use of the algorithm. Summary of the invention

[0003] In view of this, the embodiments of the present disclosure at least provide a face detection method and device based on a deep neural network. The technical solution of the present disclosure is implemented as follows:

[0004] In a first aspect, the present disclosure provides a face detection method based on a deep neural network, comprising: obtaining a target face image and a face description text library; wherein the face description text library includes a plurality of candidate description texts; performing descriptor mining on the target face image and the plurality of candidate description texts respectively according to a target descriptor mining algorithm to obtain a target face descriptor corresponding to the target face image and a plurality of candidate text descriptors respectively corresponding to the plurality of candidate description texts; wherein the target descriptor mining algorithm is a descriptor mining algorithm determined based on joint learning of face training images and face description training texts, when a descriptor correlation cost value between a training face descriptor in the face training image and a training text descriptor in the face description training text meets a training cutoff index; determining a plurality of target description texts according to a descriptor matching score between the target face descriptor and the plurality of candidate text descriptors; and merging the plurality of target description texts to obtain a target face description text corresponding to the target face image.

[0005] In a second aspect, the present disclosure provides a computer device, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the above method when executing the program.

[0006] The beneficial effects of the present disclosure include at least: in the embodiment of the present disclosure, a plurality of training face descriptors mined from a face training image by a descriptor mining algorithm and a plurality of training text descriptors mined from a face description training text are used to obtain a training face descriptor set; if the training face descriptor obtained in the training face descriptor set is a training face descriptor, a true training text descriptor corresponding to the training face descriptor is obtained, and a first generation value paired with the training face descriptor is calculated; wherein the matching score between the first reference face image corresponding to the face description training text to which the true training text descriptor belongs and the face training image is greater than a first score threshold; if in the training face descriptor set, a training face descriptor obtained in the training face descriptor set is a training face descriptor, a true training text descriptor corresponding to the training face descriptor is obtained, and a first generation value paired with the training face descriptor is calculated; wherein the matching score between the first reference face image corresponding to the face description training text to which the true training text descriptor belongs and the face training image is greater than a first score threshold; The training face descriptor obtained from the face descriptor set is the training text descriptor, the true training face descriptor corresponding to the training text descriptor is obtained, and the second-generation value paired with the training text descriptor is calculated; wherein, the matching score between the first reference description text corresponding to the face training image to which the true training face descriptor belongs and the face description training text is greater than a second score threshold; based on the first-generation value of the training face descriptor and the second-generation value of the matching of the training text descriptor, the descriptor associated cost value is determined; when the descriptor associated cost value meets the training cutoff indicator, the target descriptor mining algorithm after the descriptor mining algorithm is trained is obtained, and the training process of the descriptor mining algorithm is realized. During the algorithm training process, the first generation value is determined based on the face training images and description training texts without prior information, and the facial descriptors and the corresponding true training text descriptors. The second generation value is obtained based on the text descriptors and the corresponding true training face descriptors, so that the descriptor mining algorithm is trained based on the first generation value and the second generation value. The facial descriptors corresponding to the approximate face images mined by the descriptor mining algorithm can be adapted to the text descriptors corresponding to the approximate description texts. In this way, the descriptor mining algorithm can be trained without prior information, so that the matching between the facial descriptors mined by the descriptor mining algorithm and the text descriptors is not too strict, thereby reducing the difficulty of training. At the same time, it overcomes the problem of high algorithm training cost, slow speed and response delay caused by the need to prepare a large amount of training data with clear prior labels before traditional training.

[0007] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.

[0009] Figure 1 A schematic diagram of the implementation flow of a training method for a descriptor mining algorithm provided in an embodiment of the present disclosure.

[0010] Figure 2 A schematic diagram of the implementation flow of a face detection method based on a deep neural network provided in an embodiment of the present disclosure.

[0011] Figure 3 A hardware entity schematic diagram of a computer device provided in an embodiment of the present disclosure.

[0012] Reference numerals: 1000 - computer device; 1001 - processor; 1002 - memory. DETAILED DESCRIPTION

[0013] The embodiments of the present disclosure provide a method for training a descriptor mining algorithm and a method for face detection based on a deep neural network, which can be executed by a processor of a computer device, wherein the computer device may refer to a device with data processing capabilities such as a server, a laptop, a tablet computer, and a desktop computer.

[0014] Figure 1 A schematic diagram of the implementation flow of a training method for a descriptor mining algorithm provided in an embodiment of the present disclosure is shown in FIG. Figure 1 As shown, the method includes:

[0015] Step S10, obtaining a training face descriptor set by mining multiple training facial descriptors from face training images and multiple training text descriptors from face description training texts through a descriptor mining algorithm.

[0016] The core task of step S10 is to extract features from two types of data sources, namely, face training images and face description training texts. In this step, the computer device uses a specific facial descriptor mining algorithm to operate. For the face training image part, these image samples are photos containing faces, for example, a large number of face data sets collected from various sources. The computer device analyzes and extracts features in the image through a facial descriptor mining algorithm, such as a convolutional neural network (CNN) in deep learning. These features may include the shape of the eyes, the height of the nose, the contour of the mouth, etc., which are encoded as training facial descriptors in numerical form. For example, a training facial descriptor can be a multi-dimensional feature vector, such as [0.8, 0.3, 0.5, ...], where each number represents the intensity or size of a specific feature in the image.

[0017] At the same time, face description training text is a text data sample that describes facial features, such as "male, middle-aged, square face, thick eyebrows and big eyes..." and other descriptive sentences. Computer devices convert these texts into training text descriptors in numerical form through natural language processing technologies such as word embedding or Transformer models. These descriptors capture the semantic information in the text and convert the text description into a mathematical expression that the computer can understand and operate. For example, "square face" may be converted into a vector [0.7, -0.2, 0.1, ...] representing facial features, while "thick eyebrows and big eyes" may correspond to another feature vector.

[0018] At the end of step S10, the computer device will obtain a set of multiple training face descriptors and training text descriptors, namely, a training face descriptor set. This set is used as input for subsequent steps to further train and optimize the descriptor mining algorithm. In this way, the computer device can fully understand and describe facial features from both image and text perspectives, providing a rich data foundation for subsequent face recognition, retrieval and other tasks.

[0019] Step S20, if the training face descriptor obtained in the training face descriptor set is a training face descriptor, obtain the true training text descriptor corresponding to the training face descriptor, and calculate the first generation value paired with the training face descriptor; wherein the matching score between the first reference face image corresponding to the face description training text to which the true training text descriptor belongs and the face training image is greater than a first score threshold.

[0020] In step S20, the degree of match between the training facial descriptor and the corresponding true training text descriptor is evaluated. When the computer device obtains a training facial descriptor from the training facial descriptor set, it will look for the true training text descriptor corresponding to this facial descriptor. The true training text descriptor here refers to a text description that highly matches the facial descriptor, which can also be understood as a positive sample or active sample. In order to find such a true training text descriptor, the computer device considers the degree of match between the first reference facial image corresponding to a facial description training text and the original facial training image.

[0021] Specifically, if a training facial descriptor is extracted from a photo of a middle-aged man, the corresponding true training text descriptor is, for example, a descriptive text such as "middle-aged male, with beard, wearing glasses". In order to ensure the accuracy of this correspondence, the computer device checks whether the face image described by this text (i.e., the first reference face image) is highly similar to the original face training image. Only when the matching score between the two exceeds a preset first score threshold, the text will be considered as a valid true training text descriptor. Next, the computer device calculates the first generation value between the training facial descriptor and the true training text descriptor. This value reflects the degree of match between the two and can be calculated by any feasible loss function. For example, cosine similarity can be used to measure the angle between the facial descriptor vector and the text descriptor vector. The smaller the angle, the more matched the two are, and the smaller the first generation value. In practical applications, this evaluation of the degree of match is crucial to improving the accuracy of the descriptor mining algorithm. By continuously optimizing the first generation value, the computer can learn how to extract and match features from images and texts more effectively, so as to perform better in future tasks such as face recognition, search or recommendation.

[0022] Step S30, if the training face descriptor obtained in the training face descriptor set is a training text descriptor, obtain the true training face descriptor corresponding to the training text descriptor, and calculate the second generation value paired with the training text descriptor; wherein the matching score between the first reference description text corresponding to the face training image to which the true training face descriptor belongs and the face description training text is greater than a second score threshold.

[0023] Step S30 focuses on how to find the corresponding true training face descriptor when the training text descriptor is obtained from the training face descriptor set, and calculate the matching degree between them, that is, the second generation value.

[0024] Specifically, when the computer device obtains a training text descriptor from the training face descriptor set, it will look for a true training face descriptor corresponding to the text descriptor. The true training face descriptor here refers to the face descriptor that best matches the text descriptor in a practical sense, which can also be understood as a positive sample or a negative sample. In order to determine this matching relationship, the computer device considers a key factor: the first reference description text corresponding to the face training image to which the true training face descriptor belongs must have a high degree of similarity with the original face description training text.

[0025] Taking a practical application as an example, suppose that a computer device is processing a series of training texts describing human faces, one of which is described as "a young woman with long hair and large, bright eyes". The computer device extracts a training text descriptor from this text. This descriptor is, for example, a series of numerical values ​​representing different features in the text. Next, the computer device needs to find the facial descriptor that best matches this text descriptor in the training facial descriptors, that is, the true training facial descriptor. This facial descriptor is, for example, extracted from an actual face image and contains facial features that match the text description.

[0026] In order to ensure that the found facial descriptor does match the text description, the computer device checks the degree of match between the first reference description text corresponding to the face image and the original face description training text. If the match score between the two exceeds the preset second score threshold, then the facial descriptor is considered to be a valid true training facial descriptor. Subsequently, the computer device calculates the second generation value between the training text descriptor and the true training facial descriptor. This value reflects the degree of match between the text descriptor and the facial descriptor, and can be calculated by any feasible loss function. For example, the cosine similarity loss can be used to measure the similarity between the two, or the mean square error loss can be used to measure the difference between the two. The smaller the second generation value, the higher the degree of match between the text descriptor and the facial descriptor; otherwise, the lower the degree of match. In this way, step S30 ensures the accurate match between the text descriptor and the corresponding facial descriptor during the training process, providing an important basis for subsequent optimization and algorithm performance improvement.

[0027] Step S40, determining a descriptor associated cost value based on the first generation value of the training facial descriptor and the second generation value matched with the training text descriptor.

[0028] The core task of step S40 is to determine the descriptor association cost. When executing step S40, the computer device first reviews the two key cost values ​​calculated in the previous steps: one is the first generation value of the trained facial descriptor, which reflects the uniqueness and recognition of facial features; the other is the second generation value of the trained text descriptor matching, which reflects the correlation and consistency between the text description and the facial features.

[0029] Specifically, the first generation value can be calculated by extracting features from facial images using a machine learning model, such as a deep learning neural network. The first generation value can quantify the uniqueness of a face, for example, by comparing the difference between a facial feature vector and other facial feature vectors in a database. The second generation value is calculated by comparing the similarity between a text description and facial features. For example, natural language processing technology can be used to convert a text description into a feature vector and compare it with the facial feature vector to obtain a match between the two. When determining the descriptor-associated cost value, the computer device comprehensively considers the two cost values. For example, the two are added or weighted together, or other variables are introduced for fusion, without specific limitation.

[0030] Step S50: If the descriptor association cost value meets the training cutoff index, stop training the descriptor mining algorithm to obtain a target descriptor mining algorithm.

[0031] In step S50, the descriptor-associated cost value calculated in the previous step is evaluated to determine whether it meets the preset training cutoff index, that is, the training stop condition. The training cutoff index can be a cost threshold. When the descriptor-associated cost value is lower than the cost threshold, it means that the algorithm training has achieved the expected effect and the training can be stopped. At this time, the computer device uses the algorithm obtained by the current training as the target descriptor mining algorithm.

[0032] In one implementation, the step S40, determining the descriptor associated cost value based on the first generation value of the training facial descriptor and the second generation value matched with the training text descriptor, includes:

[0033] Step S41, using a descriptor relationship evaluation algorithm to determine a descriptor similarity score between the training facial descriptor and the training text descriptor in the training face descriptor set.

[0034] The goal of step S41 is to determine the similarity between the training face descriptors and the training text descriptors in the training face descriptor set. To achieve this goal, the computer device uses a descriptor relationship evaluation algorithm, such as a deep learning algorithm based on the contrastive language-image pre-training model architecture. The contrastive language-image pre-training model is a multimodal learning algorithm that considers the information of both images and texts and learns the correspondence between them. In the scenarios of face recognition and text matching, it can help determine the similarity between a facial image and the text describing the face.

[0035] In a specific application, the computer device first extracts a facial descriptor and a corresponding text descriptor from a set of trained facial descriptors. A facial descriptor is usually a feature vector extracted from a facial image, such as facial features extracted by a deep learning model (such as a convolutional neural network CNN); while a text descriptor is a text describing a face (such as "male, wearing glasses, short hair", etc.) converted into a vector form by natural language processing technology. Subsequently, the computer device calculates the similarity score between the two types of descriptors using a contrastive language-image pre-training model. This score is actually a quantitative indicator used to measure the degree of match between the facial descriptor and the text descriptor. In the contrastive language-image pre-training model, this similarity is usually measured by calculating the cosine similarity of the two vectors or using the Euclidean distance. Taking the Euclidean distance as an example, the smaller the distance, the higher the similarity between the two descriptors.

[0036] Step S42, determining a reference face descriptor combination in the training face descriptor set based on the descriptor similarity score; wherein the reference face descriptor combination includes a reference training face descriptor and a reference training text descriptor, and the descriptor similarity score between the reference training face descriptor and the reference training text descriptor is greater than a similarity score threshold.

[0037] The main purpose of step S42 is to select a facial descriptor and text descriptor combination with high similarity from the training facial descriptor set as a reference facial descriptor combination. This combination is crucial for the subsequent training and evaluation process because it represents a high matching relationship between facial features and text descriptions.

[0038] In a specific application, the computer device performs this step according to the descriptor similarity score calculated in step S41. First, the computer device sets a similarity score threshold, which is a standard for judging whether the similarity between the facial descriptor and the text descriptor is high enough. The selection of the threshold is usually based on experimental data and actual needs to ensure that the screened combination is representative enough. Next, the computer device traverses each pair of facial descriptors and text descriptors in the training face descriptor set and compares their similarity scores with the set threshold. Only when the similarity score of a pair of descriptors is greater than this threshold will they be selected as part of the reference face descriptor combination. This combination is a binary group containing a reference training facial descriptor and a reference training text descriptor.

[0039] Step S43, determining the descriptor associated cost value according to the first generation value matched with the reference training facial descriptor and the second generation value matched with the reference training text descriptor.

[0040] In one implementation, the step S43, determining the descriptor associated cost value according to the first generation value matched with the reference training facial descriptor and the second generation value matched with the reference training text descriptor, includes:

[0041] Step S431, obtaining a fake training text descriptor corresponding to the reference training facial descriptor, and calculating a third-generation value paired with the reference training facial descriptor; wherein a matching score between a first reference facial image corresponding to a facial description training text to which the fake training text descriptor belongs and the facial training image is less than a third score threshold, and the third score threshold is less than the first score threshold.

[0042] In step S431, the computer device selects the description that best matches the given face image from the multiple text descriptions. To achieve this goal, the computer device needs to consider not only the text descriptions that truly match the image (positive samples), but also those that do not match the image (negative samples) to help the training model better distinguish between matches and mismatches.

[0043] In step S431, the computer device obtains the false training text descriptors corresponding to the reference training facial descriptors, i.e., negative samples. These false training text descriptors are selected from the face description training texts, but they do not match the reference training facial descriptors. In order to ensure that the selected negative samples do not match the reference training facial descriptors, the computer device uses a matching scoring mechanism. Specifically, the matching score between the first reference face image corresponding to the face description training text to which the false training text descriptors belong and the current face training image must be less than a set third score threshold. This third score threshold is smaller than the first score threshold used to determine the positive sample match, thereby ensuring that there is a clear degree of distinction between the selected negative samples and the positive samples.

[0044] For example, suppose that the computer device has a face image that shows a smiling middle-aged woman. A positive sample text description that matches this image is, for example, "a smiling middle-aged woman". In order to train the model to better identify matching and non-matching descriptions, the computer device needs to find some negative sample text descriptions, such as "a serious elderly man" or "a crying child", which are obviously inconsistent with the information in the image. Next, the computer device calculates the third generation value (third loss value) between these fake training text descriptors (negative samples) and the reference training face descriptors. This value is actually an indicator of the degree of mismatch between the two. The specific form of the loss function can be selected according to the actual situation. For example, the negative of the cosine similarity or the Euclidean distance can be used to measure the difference between the two descriptors.

[0045] Step S432, obtaining a fake training facial descriptor corresponding to the reference training text descriptor, and calculating a fourth generation value paired with the reference training text descriptor; wherein a matching score between a first reference description text corresponding to a face training image to which the fake training facial descriptor belongs and the face description training text is less than a fourth score threshold, and the fourth score threshold is less than the second score threshold.

[0046] Step S432 requires the computer device to obtain fake training face descriptors corresponding to the reference training text descriptors, which are essentially mismatched negative samples. In order to find these negative samples, the computer device needs to screen out the descriptors of the face training images that do not match the reference training text descriptors. The mismatch here means that the similarity or matching score between the first reference description text corresponding to the face training image and the face description training text currently under consideration is lower than a set fourth score threshold. This fourth score threshold is set lower than the second score threshold used to determine the positive sample match to ensure that the selected fake training face descriptor does not match the reference training text descriptor. For example, suppose there is a text description: "a young woman wearing glasses". The frontal face descriptor that matches this text description may come from a face image that does show a young woman wearing glasses. In order to train the model to better identify mismatched images and text descriptions, it is necessary to find some face descriptors that are face images but do not conform to the description of "young woman wearing glasses", such as a descriptor of a face image that does not wear glasses or is not a young woman. After finding these fake training facial descriptors, the computer device calculates the fourth generation value between them and the reference training text descriptors. This value reflects the degree of mismatch between the fake training facial descriptors and the reference training text descriptors. Similar to the third generation value, the calculation of the fourth cost value also depends on a loss function, the specific form of which is not limited, and can be the negative of cosine similarity, Euclidean distance or other functions that can measure the difference between two descriptors.

[0047] Through this step, the computer device can use these mismatched samples (i.e. negative samples) to further train and optimize the model, so that when faced with multiple possible facial descriptors, it can more accurately select the facial descriptor that best matches the given text description. This is crucial to improving the accuracy and robustness of image-to-text matching.

[0048] Step S433, based on the cost error between the first generation value and the third generation value, obtain the facial description sub-generation value corresponding to the reference training facial descriptor, and based on the cost error between the second generation value and the fourth generation value, obtain the text description sub-generation value corresponding to the reference training text descriptor.

[0049] In step S433, the computer device determines the value of the facial descriptor generation corresponding to the reference training facial descriptor based on the cost error between the first generation value and the third generation value calculated previously. Similarly, the computer device also needs to determine the value of the text descriptor generation corresponding to the reference training text descriptor based on the cost error between the second generation value and the fourth generation value.

[0050] Specifically, the first generation value reflects the degree of match between the reference training facial descriptor and the positive sample (i.e., the matching text descriptor), while the third generation value reflects the degree of match between the reference training facial descriptor and the negative sample (i.e., the mismatching text descriptor). The cost error between the two actually reflects the model's ability to distinguish between matching and mismatching text descriptors. Therefore, through this cost error, the computer device can calculate the facial descriptor generation value corresponding to the reference training facial descriptor, and this generation value will be used in the subsequent training and optimization process.

[0051] Similarly, the second generation value reflects the degree of match between the reference training text descriptor and the positive sample (i.e., the matching face descriptor), while the fourth generation value reflects the degree of match between the reference training text descriptor and the negative sample (i.e., the non-matching face descriptor). By calculating the cost error between the two, the computer device can determine the value of the text descriptor generation corresponding to the reference training text descriptor.

[0052] Step S434, determining the descriptor associated cost value according to the combined cost value of the facial descriptor cost value and the text descriptor cost value.

[0053] In step S434, the computer device determines a comprehensive descriptor association cost value by a certain merging method (such as addition or weighted summation) based on the facial description sub-value and text description sub-value calculated in the previous step. This association cost value is an important indicator for evaluating the degree of match between the image and the text description. Specifically, the facial description sub-value reflects the degree of match between the face image and the corresponding text description, while the text description sub-value reflects the degree of match between the text description and the corresponding face image. These two cost values ​​quantify the degree of match from the perspective of the image and the text, respectively.

[0054] In step S434, the computer device combines the two cost values ​​to obtain a more comprehensive matching degree evaluation. The merging method can be simple addition or weighted summation, depending on the computer device design and actual needs. The weighted summation method can more flexibly adjust the weights of the image and text in the matching evaluation to adapt to different application scenarios.

[0055] Let's take a specific example to illustrate: suppose there is a face image and a description text. Through the previous steps, the cost values ​​of these two elements have been obtained, namely the face description sub-cost value F and the text description sub-cost value T. Now, it is necessary to determine the association cost value between these two elements. If the weighted summation method is chosen, two weight coefficients w1 and w2 (w1+w2=1) can be set, and then the association cost value is calculated as w1F + w2T. This association cost value combines the matching degree information of both the image and the text.

[0056] In one implementation, the step S42, determining a reference face descriptor combination in the training face descriptor set according to the descriptor similarity score, includes:

[0057] Iteratively repeat the following operations, and stop when the training text descriptors corresponding to each of the multiple training facial descriptors in the training facial descriptor set are obtained, and obtain a plurality of reference facial descriptor combinations respectively according to the multiple training facial descriptors and the corresponding training text descriptors: determine a training facial descriptor from the multiple training facial descriptors as a target training facial descriptor; obtain a target training text descriptor corresponding to the target training facial descriptor from the training text descriptors according to the descriptor similarity score output by the descriptor relationship evaluation algorithm; wherein the descriptor similarity score between the target training facial descriptor and the target training text descriptor exceeds the descriptor similarity score between the target training facial descriptor and the remaining training text descriptors; and determine the target training facial descriptor and the target training text descriptor as the reference facial descriptor combination.

[0058] Specifically, the computer device iteratively performs a series of operations until a corresponding training text descriptor is found for each training facial descriptor in the training facial descriptor set. This iterative process is to ensure that each facial descriptor can form a pair with its most matching text descriptor, thereby constructing multiple reference facial descriptor combinations. Specifically, the computer device first selects a training facial descriptor from the training facial descriptor set, and then uses a descriptor relationship evaluation algorithm (such as calculating Euclidean distance, cosine similarity, etc.) to evaluate the similarity between the facial descriptor and all training text descriptors. The computer device selects the text descriptor with the highest similarity (i.e., the highest score or the shortest distance) as the corresponding text of the facial descriptor. Once a matching pair is found, the computer device saves them as a reference facial descriptor combination. This process is repeated continuously, and each iteration finds a corresponding text descriptor for a new facial descriptor until all facial descriptors have found matching text descriptors. At this point, the iterative process stops, and the computer device obtains multiple reference facial descriptor combinations.

[0059] For example, suppose that the training face descriptor set contains five face descriptors (Face1, Face2, Face3, Face4, Face5), and the computer device needs to find the best matching text descriptors for each of the five face descriptors. In the first iteration, the computer device can select Face1 and find the best matching text descriptor Text1 through the descriptor relationship evaluation algorithm. Thus, Face1 and Text1 constitute a reference face descriptor combination. Next, the computer device continues to find matching text descriptors for Face2, Face3, Face4, and Face5, respectively, until all face descriptors have found corresponding text descriptors. In this way, the computer device can construct a set containing multiple reference face descriptor combinations, which will be used in subsequent training or evaluation processes to improve the accuracy and efficiency of the model in the task of selecting appropriate descriptive texts based on images.

[0060] Specifically, the computer device selects one of the multiple training facial descriptors as a target training facial descriptor. This selection process can be random or based on a certain strategy or rule. The target training facial descriptor will be used in subsequent matching and evaluation processes to determine its corresponding training text descriptor.

[0061] For example, suppose that the computer device has extracted a set of training facial descriptors, each of which represents the characteristics of a different face image. Among these descriptors, the computer device needs to select one as the target training facial descriptor. This selection can be made in sequence, such as selecting the first or last descriptor each time; or it can be random to increase diversity and reduce bias. Once the target training facial descriptor is determined, the computer device will continue to perform subsequent steps to find the training text descriptor that best matches this target facial descriptor. This process is accomplished by calculating the similarity between descriptors (such as using a metric such as Euclidean distance, cosine similarity, etc.).

[0062] For example, if the fifth training face descriptor is selected as the target training face descriptor, then it will calculate the similarity between this descriptor and all training text descriptors to find the best matching text descriptor. This best matching text descriptor will form a reference face descriptor combination together with the target training face descriptor for subsequent training or evaluation process.

[0063] Next, the computer device finds the target training text descriptor corresponding to the target training facial descriptor in the training text descriptor set according to the descriptor similarity score output by the descriptor relationship evaluation algorithm. In this process, the descriptor relationship evaluation algorithm is responsible for quantifying the similarity between the facial descriptor and the text descriptor. Specifically, the computer device first calculates the similarity score between the target training facial descriptor and each training text descriptor. For example, it is obtained by calculating a certain distance or similarity between the two, such as Euclidean distance, cosine similarity, etc. Taking Euclidean distance as an example, the smaller the Euclidean distance between two descriptors, the more similar they are. After calculating all similarity scores, the computer device compares these scores to find the training text descriptor with the highest similarity score to the target training facial descriptor, that is, the target training text descriptor. The similarity between this text descriptor and the target training facial descriptor exceeds that of all other text descriptors.

[0064] For example, suppose there is a target training face descriptor Face_A and five training text descriptors Text1, Text2, Text3, Text4, and Text5. The computer device uses the descriptor relationship evaluation algorithm to calculate the similarity scores between Face_A and the five text descriptors. If the calculation result shows that the Euclidean distance between Face_A and Text3 is the smallest, that is, the similarity score is the highest, then Text3 will be selected as the target training text descriptor.

[0065] This process ensures that each target training face descriptor can find its best matching target training text descriptor, thus providing accurate data pairs for subsequent training or evaluation. In this way, the computer device can more effectively learn how to extract information from images and select the most appropriate description text.

[0066] Finally, the computer device combines the target training face descriptor with the target training text descriptor to form a reference face descriptor combination, which is based on the high similarity between the two determined by the descriptor relationship evaluation algorithm in the previous step.

[0067] Specifically, in the previous step, the computer device has used an algorithm to find the target training text descriptor with the highest similarity to the target training facial descriptor. The computer device formally pairs these two descriptors to form a reference face descriptor combination. This combination not only represents the correspondence between the face image and its most matching text description, but also provides accurate reference data for subsequent training or evaluation.

[0068] For example, if in the previous step, the computer device determines a target training facial descriptor Face_B and a target training text descriptor Text_X with the highest similarity thereto, then Face_B and Text_X will be combined into a reference facial descriptor combination.

[0069] This combination clearly defines the correspondence between a specific face image (represented by Face_B) and its most appropriate text description (represented by Text_X). Such a combination is very useful when training machine learning models because it provides the correct labels (i.e., text descriptions) to help the model learn how to extract features from face images and accurately match them to corresponding text descriptions.

[0070] In one implementation, the step S10, obtaining a set of training face descriptors by mining a plurality of training facial descriptors from face training images and a plurality of training text descriptors from face description training texts through a descriptor mining algorithm, comprises:

[0071] Step S11, based on the descriptor mining algorithm obtained after self-learning, descriptor mining is performed in the face training image and the face description training text respectively to obtain multiple reference face descriptors for the face training image and multiple reference text descriptors for the face description training text; wherein the descriptor mining algorithm includes a face descriptor mining operator and a text descriptor mining operator, the face descriptor mining operator is used to mine the reference face descriptor based on the face training image area included in the face training image, and the text descriptor mining operator is used to mine the reference text descriptor based on the face description training text paragraph included in the face description training text;

[0072] Step S12, using a dense affine operator to process the multiple reference facial descriptors and the multiple reference text descriptors to obtain the multiple training facial descriptors for the multiple reference facial descriptors and the multiple training text descriptors for the multiple reference text descriptors; wherein the training facial descriptors and the training text descriptors contain the same number of elements.

[0073] In step S11, the computer device uses the descriptor mining algorithm obtained through self-learning, that is, self-supervised pre-training, to perform deep feature extraction on the face training image and the face description training text. This process is an important prerequisite for constructing a training face descriptor set, which ensures that the features extracted from the image and text are representative and comparable. Specifically, the descriptor mining algorithm contains two core components: the facial descriptor mining operator and the text descriptor mining operator. These two operators process image and text data respectively.

[0074] The facial descriptor mining operator is usually a deep learning model, such as a convolutional neural network (CNN). The operator is trained to identify key features in facial images, such as the shape of the eyes, the outline of the nose, the position of the mouth, etc., and encodes these features into a high-dimensional vector, i.e., the reference facial descriptor. For example, for an image containing a clear face, the facial descriptor mining operator will output a vector similar to [0.23, -0.15, 0.47, ...], where each value represents the degree or intensity of the presence of a specific feature in the image.

[0075] The text descriptor mining operator is a natural language processing model, such as one based on word embedding technology or a more advanced Transformer model. The task of this operator is to understand the semantic content in the face description training text and convert these text descriptions into vector form, that is, refer to the text descriptor. For example, for a text describing "she has a pair of bright big eyes and a charming smile", the text descriptor mining operator will convert it into a vector that can capture the semantics of these key adjectives and nouns, such as [0.19, 0.35, -0.22, ...].

[0076] In step S12, the computer device further processes the multiple reference facial descriptors and reference text descriptors obtained in step S11 using a dense affine operator, that is, a fully connected layer. A fully connected layer is a common structure in a neural network, which can connect each neuron in the input layer to each neuron in the output layer, and obtains output data by linearly transforming the input data and adding a bias, and then processing it through an activation function.

[0077] Specifically, the computer device inputs each reference facial descriptor and reference text descriptor into the corresponding fully connected layer. The fully connected layer performs linear transformation on these descriptors, learns and extracts higher-level feature representations, and generates training facial descriptors and training text descriptors respectively. In this process, the weights and biases of the fully connected layer are adjusted through training to better capture and represent the characteristics of the input data. In order to ensure the comparability between the training facial descriptors and the training text descriptors, the computer device ensures that the output dimensions of the two after being processed by the fully connected layer are the same. This means that no matter what the original dimensions of the input reference facial descriptors and reference text descriptors are, they will be converted into vectors of the same dimension after being processed by the fully connected layer. For example, assume that the reference facial descriptor is a 1024-dimensional vector and the reference text descriptor is a 512-dimensional vector. The computer device can design a fully connected layer so that whether it is a 1024-dimensional reference facial descriptor or a 512-dimensional reference text descriptor, after being processed by this fully connected layer, it will be converted into a training facial descriptor and training text descriptor of, for example, 256 dimensions. In this way, the computer device can ensure the dimensional consistency of the trained facial descriptors and the trained text descriptors, facilitating subsequent descriptor matching and similarity calculations.

[0078] In one implementation, in step S11, before performing descriptor mining in face training images and face description training texts based on the descriptor mining algorithm obtained after self-learning, the method further includes:

[0079] Step S101, obtaining a set of pre-trained knowledge templates; wherein the set of pre-trained knowledge templates includes a plurality of pre-trained face images and a plurality of pre-trained description texts;

[0080] Step S102, performing self-learning on a reference facial descriptor mining operator in a reference descriptor mining algorithm based on the plurality of pre-trained face images, and performing self-learning on a reference text descriptor mining operator in the reference descriptor mining algorithm based on the plurality of pre-trained description texts;

[0081] Step S103: if the reference facial descriptor mining operator reaches a first training cutoff indicator and the reference text descriptor mining operator reaches a second training cutoff indicator, the reference descriptor mining algorithm is determined as the descriptor mining algorithm after self-learning.

[0082] In step S101, the computer device is responsible for obtaining a set of pre-trained knowledge templates. This set is the basis of the training process, and it contains multiple pre-trained face images and multiple pre-trained description texts. These materials will serve as training samples to help the machine learning model learn how to extract key features from images and texts. Pre-trained face images refer to a series of face photos used for training, which cover different facial expressions, angles, lighting conditions and occlusion situations to ensure that the trained model has a wide range of applicability. For example, this image set may include face images from multiple angles such as front, side, top and bottom, and may also include images of various expressions such as smiling, angry, surprised, etc. In addition, in order to enhance the robustness of the model, these images may also include some interference factors that are common in real environments, such as wearing glasses, hats or scarves.

[0083] The pre-training description text is a description of these face images, which records the characteristics of each face image in detail. These descriptions may include facial features such as eye size, nose shape, lip thickness, etc., and may also involve other information such as skin color and hairstyle. These text descriptions, together with the corresponding face images, constitute an important part of the training samples.

[0084] For example, a pre-trained knowledge template may contain a frontal photo of a smiling middle-aged man and a text describing him as "having deep eyes, a broad forehead, and a friendly smile." This combination enables the machine learning model to learn how to identify these features from the image and match them with the text description during the training process.

[0085] In step S102, the computer device uses the acquired pre-trained face images and pre-trained description texts to perform self-learning on the reference face descriptor mining operator and the reference text descriptor mining operator in the reference descriptor mining algorithm, respectively.

[0086] The reference facial descriptor mining operator can be a deep learning model, such as a convolutional neural network (CNN), which is specifically used to extract features from facial images. For example, it can be part of a classic image recognition neural network model such as VGG, ResNet or FaceNet. These models can automatically learn the hierarchical feature representation in the image through multi-layer convolution operations. In the self-learning process, the computer device inputs multiple pre-trained facial images into the operator, and adjusts the network parameters through the back-propagation algorithm, so that the network can automatically extract effective features in the facial image, such as the shape of the eyes, the outline of the nose, the position of the mouth, etc., to form a facial descriptor.

[0087] Referring to the text descriptor mining operator, word embedding models in natural language processing, such as Word2Vec, GloVe or BERT, can be used. These models can convert words in the text into vector representations in a high-dimensional space and capture the semantic relationship between words. The computer device inputs multiple pre-trained description texts into the operator and trains the model through unsupervised learning to enable it to generate vector representations of the description text, namely text descriptors. These descriptors can capture key information in the text, such as facial feature descriptions such as "big eyes" and "high nose bridge".

[0088] The goal of self-learning is to enable these two operators to extract representative and discriminative features for image and text data respectively. Through iterative optimization of a large amount of training data, computer equipment can continuously improve the feature extraction capabilities of these two operators, providing an accurate basis for subsequent descriptor matching and similarity calculation.

[0089] For example, assume that the computer device uses ResNet as a reference facial descriptor mining operator. During the self-learning process, the computer device inputs the pre-trained face image into the ResNet model, extracts the feature map in the image through the operation of the convolution layer, and then converts the feature map into a fixed-length feature vector, i.e., the facial descriptor, through the pooling layer. Similarly, for the reference text descriptor mining operator, the computer device can use the Word2Vec model to convert the vocabulary in the pre-trained description text into word vectors, and then obtain the vector representation of the entire text by averaging or weighted averaging, i.e., the text descriptor. In this way, the computer device obtains a descriptor mining operator that can effectively extract facial and text features through self-learning.

[0090] In step S103, the computer device monitors the training process of the reference facial descriptor mining operator and the reference text descriptor mining operator, and determines whether the training is completed according to the set training cutoff indicators. These cutoff indicators are the conditions for stopping training, which are used to ensure that the model stops training after reaching a certain performance level to avoid overfitting and save computing resources.

[0091] The first training cutoff indicator and the second training cutoff indicator can be various forms of evaluation criteria, such as the degree of reduction in training error, the improvement in accuracy on the validation set, the convergence of the loss function, etc. These indicators need to be set according to the specific application scenario and model characteristics.

[0092] When the reference face descriptor mining operator and the reference text descriptor mining operator reach their respective set training cutoff indicators, it means that they have fully learned how to extract features from images and texts, and their performance has stabilized. At this time, the computer device determines the self-learned reference descriptor mining algorithm as the final descriptor mining algorithm.

[0093] For example, suppose that the first training cutoff indicator is set to 95% accuracy on the validation set, and the accuracy does not increase by more than 0.5% in 5 consecutive training cycles. At the same time, the second training cutoff indicator is set to reduce the reconstruction error of the text descriptor to below a predetermined threshold, and the reduction in the reconstruction error is less than 1% in 3 consecutive training cycles. During the training process, the computer device continuously evaluates the performance of the two operators. When they meet the above cutoff indicators respectively, the training will stop, and the reference descriptor mining algorithm at this time is regarded as the descriptor mining algorithm after self-learning.

[0094] The key to this step is to reasonably set the training cutoff index to ensure that the model can stop training in time after reaching the ideal performance, thereby avoiding unnecessary waste of computing resources and ensuring the generalization ability of the model. By setting such training stop conditions, the computer equipment can automatically adjust and optimize the performance of the descriptor mining algorithm, providing an accurate and reliable basis for subsequent descriptor matching and similarity calculation.

[0095] In one implementation, in step S102, self-learning the reference facial descriptor mining operator in the reference descriptor mining algorithm based on the plurality of pre-trained facial images includes:

[0096] Step S1021, determining a first training face image region in the pre-training face image;

[0097] Step S1022, performing descriptor mining on the first training face image region according to the reference face descriptor mining operator to obtain a first image region descriptor, and performing descriptor mining on a second training face image region outside the first training face image region in the pre-training face image according to the reference face descriptor mining operator to obtain a second image region descriptor;

[0098] Step S1023, estimating the facial descriptor corresponding to the first training face image region according to the second image region descriptor to obtain an estimated image region descriptor;

[0099] Step S1024, if the descriptor difference between the estimated image region descriptor and the first image region descriptor is greater than the target estimated reference value, modifying the operator parameters of the reference facial descriptor mining operator;

[0100] Step S1025: If the descriptor difference between the estimated image region descriptor and the first image region descriptor is not greater than the target estimated reference value, it is determined that the reference facial descriptor mining operator reaches the first training cutoff indicator.

[0101] In step S1021, the computer device needs to determine a first training face image region in the pre-training face image. This step is intended to select a specific region in the image for subsequent feature learning and descriptor mining.

[0102] In a specific application scenario, the computer device can use image processing technology, such as edge detection, feature point location or face key point detection, to automatically identify and locate key areas in the face image. For example, the computer device can use image processing libraries such as OpenCV to detect key feature points such as the face contour, eyes, nose, mouth, etc., to determine a region containing these feature points as the first training face image region.

[0103] For example, if the computer device is training a descriptor mining operator focused on the eye region, it can automatically identify and locate the eye region in the pre-trained face image. This process can be achieved by detecting features such as the eye contour, pupil position, etc. Once the eye region is determined, the region is regarded as the first training face image region and used in the subsequent descriptor mining and self-learning process.

[0104] In this way, the computer device can accurately select a specific area in the image in order to more accurately learn and extract the features of that area.

[0105] In step S1022, the computer device uses the reference facial descriptor mining operator to perform descriptor mining on two different face image regions. First, the computer device mines the first training face image region determined in step S1021 to obtain a first image region descriptor. This descriptor is actually a feature vector that captures the unique visual features of the region, such as the shape of the eyes, the curvature of the eyebrows, or the texture of the skin.

[0106] At the same time, the computer device will also perform descriptor mining on the part of the pre-trained face image other than the first training face image area, that is, the second training face image area, to obtain the second image area descriptor. This second image area may include other parts of the face, such as the nose, mouth, chin or cheeks. Similarly, the second image area descriptor is also a feature vector that reflects the visual characteristics of these areas.

[0107] To illustrate with a specific example, suppose that the computer device is processing an image containing a complete face, and the first training face image region is selected as the area around the eyes. By referring to the processing of the facial descriptor mining operator, the computer device may obtain a first image region descriptor describing features such as eye shape, pupil size, and the contrast between the white of the eye and the pupil. This descriptor is, for example, a multidimensional vector, such as [0.8, 0.3, 0.5, ..., 0.2], in which the values ​​represent the intensity or presence of different features.

[0108] For the second training face image region, assuming it includes the nose and mouth, the computer device will extract the features of these regions through the mining operator, such as the length, width, shape of the nose, and the size and lip color of the mouth, and generate the corresponding second image region descriptor, which is also a multi-dimensional feature vector. In this process, the reference facial descriptor mining operator is, for example, a deep learning model, such as a convolutional neural network (CNN), which has been trained to extract meaningful features from face images. This model extracts information from the image layer by layer, from low-level features such as edges and textures to more complex shape and structural features, and finally generates a feature vector that can represent the unique visual attributes of the region.

[0109] In step S1023, the computer device uses the second image region descriptor to estimate the facial descriptor corresponding to the first training face image region, and this process is called generation of estimated image region descriptor. The purpose of estimation is to infer the features of the target region based on the features of other regions in the image, which usually involves the application of a machine learning model or algorithm.

[0110] Specifically, the computer device can use a regression model or a neural network to complete this estimation task. For example, a support vector machine (SVM), random forest regression or other deep learning models can be used to predict the descriptor of the first training face image region based on the second image region descriptor. In practical applications, it is assumed that the first training face image region is the eye, and the second image region includes the features of the nose. The computer device has obtained the descriptor of the nose (the second image region descriptor) through the previous steps, and now it uses this descriptor to estimate the descriptor of the eye region. This estimation process can be regarded as a function mapping, the input is the descriptor of the nose, and the output is the estimated eye descriptor. This function is learned through a large amount of training data, and it captures the potential relationship between the nose and eye features. For example, if the shape of the nose is a hooked nose, then based on the statistical relationship between the hooked nose and the eye shape in the training data, the model can estimate that the eye has a certain shape or feature. The result of estimating the image region descriptor is a feature vector, which should be similar in dimension and structure to the descriptor actually extracted directly from the eye region. This estimated descriptor will be used in the subsequent comparison and correction process to help optimize the performance of the reference facial descriptor mining operator.

[0111] In this way, the computer device can estimate the features of the target area through the features of the related areas without relying entirely on the directly extracted features, which is particularly useful when processing partially occluded or poorly quality face images.

[0112] In step S1024, the computer device compares the estimated image region descriptor with the first image region descriptor directly extracted from the first training face image region. The core purpose of this step is to verify the accuracy and performance of the reference facial descriptor mining operator so as to modify its operator parameters when necessary.

[0113] First, the computer device calculates the descriptor difference between the estimated image region descriptor and the first image region descriptor. This difference can be obtained by calculating the Euclidean distance, cosine similarity or other similarity metrics between the two descriptor vectors. For example, if the two descriptors are vectors A and B, the Euclidean distance can be obtained by calculating the square root of the sum of the squares of the differences between each corresponding element.

[0114] Next, the computer device compares this descriptor difference with the target estimated reference value. The target estimated reference value is a preset threshold used to determine whether the estimated accuracy has reached the expected level. If the descriptor difference is greater than the target estimated reference value, it means that there is a large deviation between the estimated descriptor and the actual extracted descriptor, which usually means that the performance of the reference facial descriptor mining operator needs to be improved.

[0115] In this case, the computer device modifies the operator parameters of the reference facial descriptor mining operator. The modification may include adjusting the weights of the neural network, changing the hyperparameters of the model, optimizing the architecture of the model, etc. These modifications are intended to enable the mining operator to more accurately estimate the descriptor of the image region in the next iteration.

[0116] For example, assuming that the first training face image region is the eye, the estimated image region descriptor is the eye descriptor estimated by the feature of the nose. If the difference between the two exceeds the target estimation reference value, the computer device can adjust the convolution layer parameters, the weight of the fully connected layer, etc. in the mining operator to improve the accuracy of the next estimation.

[0117] Through this correction process, the computer device can gradually optimize the performance of the reference facial descriptor mining operator, making it more accurate and reliable in subsequent descriptor mining and estimation tasks. This is crucial for application scenarios where appropriate descriptors are selected based on images, because accurate descriptors are the key to matching images with text descriptions.

[0118] In step S1025, the computer device evaluates the descriptor difference between the estimated image region descriptor and the first image region descriptor directly extracted from the first training face image region. If the difference is not greater than a preset target estimated reference value, the computer device determines that the reference face descriptor mining operator has reached the first training cutoff indicator.

[0119] Specifically, when the estimated image region descriptor is highly similar to the first image region descriptor, that is, the difference between them is within an acceptable range (not greater than the target estimated reference value), this means that the reference facial descriptor mining operator has good performance in estimating the image region descriptor. In this case, the computer device believes that the training of the mining operator has reached a satisfactory level, namely the first training cutoff indicator. This target estimated reference value is set based on actual application scenarios and requirements, and it represents the maximum acceptable deviation between the estimated descriptor and the actual descriptor. For example, in an application of selecting appropriate descriptive text based on an image, if the estimated descriptor is very close to the actual descriptor, it is more likely to accurately select a descriptive text that matches the image from the text library.

[0120] For example, suppose there is a text library for describing facial features, which includes descriptions of various facial regions such as eyes, nose, mouth, etc. When the computer device estimates the descriptor of the eye region by referring to the facial descriptor mining operator, and this estimated descriptor is very close to the descriptor directly extracted from the eye region (the difference is not greater than the target estimated reference value), the computer device can more confidently select the description text that matches the eye features from the text library.

[0121] Therefore, step S1025 is actually a self-evaluation mechanism of the computer device for the performance of the reference facial descriptor mining operator. When the estimated performance of the operator reaches a certain level (i.e., reaches the first training cutoff indicator), the computer device can stop further training and consider that the operator is ready for use in actual application scenarios.

[0122] In one implementation, in step S102, self-learning the reference text descriptor mining operator in the reference descriptor mining algorithm based on the multiple pre-trained description texts includes:

[0123] Step S1026, determining a first training description text paragraph in the pre-training description text;

[0124] Step S1027, performing descriptor mining on the first training description text paragraph according to the reference text descriptor mining operator to obtain a first text paragraph descriptor, and performing descriptor mining on a second training description text paragraph other than the first training description text paragraph in the pre-training description text according to the reference text descriptor mining operator to obtain a second text paragraph descriptor;

[0125] Step S1028, estimating the text descriptor corresponding to the first training description text paragraph according to the second text paragraph descriptor to obtain an estimated text paragraph descriptor;

[0126] Step S1029, if the descriptor difference between the estimated text paragraph descriptor and the first text paragraph descriptor is greater than the target estimated reference value, modifying the operator parameters of the reference text descriptor mining operator;

[0127] Step S1030: If the descriptor difference between the estimated text paragraph descriptor and the first text paragraph descriptor is not greater than the target estimated reference value, it is determined that the reference text descriptor mining operator reaches the second training cutoff indicator.

[0128] In step S1026, the computer device determines and selects the first training description text paragraph from the given pre-training description text. The pre-training description text is a collection of a large number of descriptive texts related to facial features, which describe various facial features in detail, such as the shape of the eyes, the outline of the nose, the size of the mouth, etc. In order to select the first training description text paragraph, the computer device selects it according to a certain strategy. This strategy can be based on factors such as the content, length, complexity of the text, or the degree of association with specific facial features. For example, the computer can give priority to text paragraphs that are detailed, have obvious features, and are representative.

[0129] In a specific application scenario, suppose there is a dataset containing multiple face images and their corresponding description texts. The goal is to train a system to automatically select appropriate description texts based on face images. In this scenario, the pre-trained description texts are the face description texts in the dataset.

[0130] Now, suppose that a description text paragraph about "deep eyes" is to be selected as the first training description text paragraph. The computer device traverses the pre-trained description text to find descriptions related to "deep eyes". Once a text paragraph that meets the conditions is found, such as "his eyes are deep and bright, as if he can see through people's hearts", the computer will determine it as the first training description text paragraph.

[0131] This selected paragraph will be used in the subsequent training process to help the computer device learn how to select appropriate description text based on the eye features in the face image. In this way, the computer device can gradually improve its accuracy in selecting description text based on the image.

[0132] It should be noted that the selection of the first training description text paragraph is crucial for the subsequent training and learning process, because it will directly affect the mapping relationship between the features and descriptions learned by the computer device. Therefore, when selecting the first training description text paragraph, it is necessary to ensure that it is representative and accurate.

[0133] In step S1027, the computer device uses a specific tool, namely, a reference text descriptor mining operator, to conduct an in-depth analysis of the text paragraph to extract descriptors that can represent the core features of the text. This mining operator is a key component in the entire processing flow. It can be an algorithm or model based on natural language processing (NLP) technology, such as a word embedding model (Word Embedding), a BERT (Bidirectional Encoder Representations from Transformers) model, or other advanced text feature extraction methods.

[0134] Take the BERT model as an example. It is a Transformer-based deep learning model that is particularly suitable for natural language understanding tasks. The BERT model has learned rich language representation capabilities through pre-training on a large-scale corpus and can effectively capture semantic information in text.

[0135] Now, let's concretize this scenario into an application of "selecting appropriate description text based on a face image". Assume that the computer device has selected the first training description text paragraph, which describes a person's eye features in detail, such as "her eyes are deep and bright, sparkling with wisdom". Next, the computer device uses the BERT model as a reference text descriptor mining operator to process this text.

[0136] Through the processing of the BERT model, the computer device can extract a high-dimensional feature vector, namely the first text paragraph descriptor, from the first training description text paragraph. This descriptor captures the deep semantic information about eye features in the text, such as the meaning of keywords such as "deep", "bright" and "wisdom" and their contextual relationships.

[0137] Similarly, the computer device also performs the same processing on other paragraphs in the pre-trained description text (i.e., the second training description text paragraphs other than the first training description text paragraphs). These paragraphs may describe other facial features, such as the nose, mouth, or face shape. Through the processing of the BERT model, the computer device generates a corresponding descriptor for each paragraph, i.e., the second text paragraph descriptor.

[0138] These descriptors exist in the form of high-dimensional vectors, which mathematically represent the semantic content of a text paragraph. For example, a descriptor is an array containing hundreds of floating-point numbers, each of which represents a feature of a specific aspect of the text. These features include, but are not limited to, the semantics of words, the structural information of sentences, and the sentiment of the text.

[0139] In summary, in step S1027, the computer device performs a deep analysis on the selected text paragraph by using a reference text descriptor mining operator (such as a BERT model) to extract descriptors representing text features. These descriptors will be used in subsequent text matching and image description tasks to achieve the goal of automatically selecting appropriate description text based on the face image.

[0140] In step S1028, the computer device uses the second text paragraph descriptor previously extracted from other text paragraphs (i.e., the second training description text paragraph) to estimate the text descriptor of the first training description text paragraph (i.e., the first text paragraph descriptor) to generate an estimated text paragraph descriptor.

[0141] The core of this step is to use the existing information to infer or simulate the descriptor of the target text paragraph. This usually involves machine learning models, especially those that can handle high-dimensional data and capture complex relationships, such as deep learning networks. Taking deep learning as an example, a computer device can use a well-trained neural network model that has learned how to extract key features from text descriptors and predict new descriptors. This model can be an autoencoder, a recurrent neural network (RNN), or a Transformer model, all of which are good at processing sequence data and can learn complex patterns in the data.

[0142] In a specific application scenario, assume that there is already a text dataset containing multiple facial feature descriptions, and the BERT model has been used to extract descriptors (i.e., text paragraph descriptors) from these texts. Now, we need to estimate the descriptor of a new text paragraph about facial feature descriptions.

[0143] The computer device uses the previously extracted second text paragraph descriptor as input and feeds it to the trained deep learning model. The model will learn the internal connections and rules between these descriptors, and try to predict or generate descriptors similar to the first training description text paragraph based on these input descriptors, that is, estimated text paragraph descriptors. This estimation process is based on the data distribution and feature relationships learned by the model. The model will try to find the feature space that is most similar to the input descriptor and generate a new descriptor in this space. This new descriptor is the estimated text paragraph descriptor.

[0144] The estimated text paragraph descriptor is usually in the form of a high-dimensional feature vector, which is similar in structure to the first text paragraph descriptor, but contains new information inferred by the model based on other text paragraph descriptors. This estimated descriptor can be used for subsequent text matching, classification or generation tasks, helping the computer device to more accurately select appropriate description text based on the face image.

[0145] In step S1029, the computer device compares the difference between the estimated text paragraph descriptor and the first text paragraph descriptor. This difference is measured by calculating the difference between the two descriptors, and the distance between vectors (such as Euclidean distance, cosine similarity, etc.) can usually be used as a difference indicator. If the calculated descriptor difference exceeds the preset target estimated reference value, it means that there is a large deviation between the estimated text paragraph descriptor and the actual first text paragraph descriptor.

[0146] In order to reduce this deviation, the computer device corrects the operator parameters of the reference text descriptor mining operator. The purpose of the correction is to adjust the behavior of the mining operator so that it can more accurately capture the characteristics of the text paragraph in the next estimation and generate an estimated text paragraph descriptor that is closer to the actual descriptor.

[0147] In this case, the computer device analyzes the reason for the difference, for example, it is due to improper setting of some parameters of the BERT model, or the model has not fully learned the relevant features during the training process. To improve this, the computer device adjusts the parameters of the BERT model based on the difference feedback, such as adjusting the model's weights, biases, or learning rates. These adjustments are intended to enable the model to more accurately extract text features and generate more accurate estimated text paragraph descriptors the next time it performs descriptor mining.

[0148] After correcting the operator parameters, the computer device reruns the descriptor mining process and compares the difference between the estimated text paragraph descriptor and the first text paragraph descriptor again until the difference meets the preset target estimated reference value. Through such an iterative optimization process, the computer device can continuously improve its ability to generate accurate descriptors based on text, thereby improving the accuracy of selecting appropriate descriptive text based on face images.

[0149] In step S1030, the computer device evaluates the similarity between the estimated text paragraph descriptor and the first text paragraph descriptor by comparing the difference between the two descriptors. If the difference is not greater than a preset target estimated reference value, it indicates that the estimated descriptor is very close to the actual descriptor, and the performance of the mining operator meets the requirements.

[0150] In specific application scenarios, this difference is usually measured by calculating a certain distance between two descriptors, such as Euclidean distance or cosine similarity. The target estimated reference value is a pre-set threshold used to determine whether the performance of the mining operator meets expectations.

[0151] For example, assume that the computer device has generated an estimated text paragraph descriptor through a reference text descriptor mining operator (such as a BERT model) and compared it with the actual first text paragraph descriptor. If the difference between the two descriptors is less than or equal to the target estimated reference value, such as the cosine similarity between the two reaches 0.9 (assuming that 1 represents exactly the same and -1 represents completely different), then the computer device will consider that the performance of the reference text descriptor mining operator has reached the expected second training cutoff indicator.

[0152] Reaching the second training cutoff indicator means that the mining operator has captured the characteristics of the text paragraph accurately enough and is able to generate an estimated descriptor that is highly similar to the actual descriptor. In this case, the computer device can stop further training or optimization of the mining operator and apply it to subsequent tasks, such as automatically selecting appropriate description text based on face images.

[0153] Step S1030 is a key step in evaluating the performance of the mining operator, which ensures the accuracy and reliability of the operator in practical applications. When the difference between the estimated text paragraph descriptor and the actual descriptor meets the preset conditions, the computer device can determine that the mining operator has achieved the expected performance index, so that it can be safely used in practical tasks.

[0154] To summarize, in the algorithm training process provided in the above embodiments of the present disclosure, the first generation value is determined based on obtaining face training images and description training texts without prior information, and based on the facial descriptors and the corresponding true training text descriptors, and the second generation value is obtained based on the text descriptors and the corresponding true training face descriptors, so as to complete the training of the descriptor mining algorithm based on the first generation value and the second generation value, and the facial descriptors corresponding to the approximate face images mined by the descriptor mining algorithm can be adapted to the text descriptors corresponding to the approximate description texts. In this way, the descriptor mining algorithm can be trained without prior information, so that the matching between the facial descriptors and text descriptors mined by the descriptor mining algorithm is not too strict, thereby reducing the difficulty of training. At the same time, the problem of high algorithm training cost, slow speed and response delay caused by the need to prepare a large amount of training data with clear prior labels before traditional training is overcome.

[0155] The above introduces a training scheme for a descriptor mining algorithm based on deep learning. The following introduces a face detection method based on a deep neural network. Please refer to Figure 2 , which may include the following steps:

[0156] Step S1, obtaining a target face image and a face description text library; wherein the face description text library includes a plurality of description texts to be selected.

[0157] In step S1, the first task of the computer device is to obtain the target face image and the facial description text library. This step is the basis for subsequent processing, which ensures that the computer device has enough information for analysis and matching.

[0158] First, the computer device obtains the target face image from various sources. These sources may include images captured by the camera in real time, historical images stored in the database, pictures downloaded from the Internet, etc. For example, in a smart album application, a user may upload a photo of himself, and this photo becomes the target face image that the computer device needs to process. Secondly, in addition to the target face image, the computer device also needs to obtain a facial description text library. This text library contains multiple description texts to be selected, and each text is a possible description of facial features. These descriptions may involve various aspects such as the shape of the eyes, the thickness of the eyebrows, the degree of the nose, the shape and size of the mouth, the outline of the face, etc. For example, the text library may contain description texts such as "big and bright eyes", "high nose bridge", and "bright smile".

[0159] In actual applications, this facial description text library can be pre-set or dynamically generated according to user needs. For example, in an intelligent beauty camera application, the computer device may dynamically generate a description text library that matches the user's characteristics based on the user's gender, age, skin color and other information, so as to provide users with more accurate personalized beauty suggestions and effect previews.

[0160] Step S2, performing descriptor mining on the target face image and the multiple candidate description texts respectively according to the target descriptor mining algorithm, to obtain a target face descriptor corresponding to the target face image and multiple candidate text descriptors corresponding to the multiple candidate description texts respectively; wherein the target descriptor mining algorithm is based on joint learning of face training images and face description training texts, and the descriptor mining algorithm is determined when the descriptor association cost value between the training face descriptor in the face training image and the training text descriptor in the face description training text meets the training cutoff index.

[0161] In step S2, the computer device will use the target descriptor mining algorithm to process the target face image and multiple candidate description texts. The core purpose of this process is to extract key features in the image and text and convert them into high-dimensional descriptors to facilitate subsequent matching and comparison.

[0162] First, the computer device performs descriptor mining on the target face image. This usually involves using a deep learning model, such as a convolutional neural network (CNN), to extract features from the image. For example, for a target face image showing a smiling woman, CNN can capture subtle features such as the shape of the eyes, the degree of the corners of the mouth, and the texture of the skin, and encode these features into a high-dimensional facial descriptor vector. This vector in a sense depicts the unique attributes of the image. Secondly, the computer device also performs descriptor mining on each candidate description text. This usually involves natural language processing (NLP) technology, especially word embedding models such as Word2Vec or BERT, which can convert text into high-dimensional vector representations. These vectors capture the semantic information in the text. For example, for the description text "her smile is as warm as the spring breeze", the word embedding model will convert it into a descriptor vector that reflects its semantic content. The target descriptor mining algorithm used here is not randomly selected, but carefully trained. It is obtained by jointly learning (i.e., joint training) on ​​a large number of face training images and corresponding face description training texts. During the training process, the algorithm continuously adjusts its parameters to minimize the difference between the face image descriptor and the corresponding text descriptor. When the correlation cost between the training face descriptor and the training text descriptor reaches a preset training cutoff indicator, the training process stops and the descriptor mining algorithm is considered to be optimal and can accurately extract key features from images and text.

[0163] This joint training method ensures that the descriptors of images and texts are semantically consistent, providing a solid foundation for subsequent descriptor matching and text selection. For example, in practical applications, a jointly trained descriptor mining algorithm may more accurately identify the description text that best matches an image of a smiling woman, such as "bright smile" or "smiling", rather than a description that does not match the image content.

[0164] Step S3, determining a plurality of target description texts according to the descriptor matching scores between the target facial descriptor and the plurality of candidate text descriptors.

[0165] In step S3, the computer device performs matching scores based on the target facial descriptor extracted in the previous step and the multiple candidate text descriptors to determine which text descriptors are most consistent with the target face image. This process is a key step to ensure that the selected description text can accurately reflect the characteristics of the face image.

[0166] First, the computer device calculates the degree of match between the target facial descriptor and each candidate text descriptor using a similarity metric, such as cosine similarity, Euclidean distance, etc. These similarity metrics quantify the closeness between two descriptors.

[0167] Taking cosine similarity as an example, the computer device calculates the cosine value of the angle between the target facial descriptor vector and each candidate text descriptor vector. The closer this value is to 1, the more similar the two descriptors are; the closer it is to -1, the less similar the two descriptors are. In this way, the computer device can score the degree of match between each candidate text descriptor and the target facial descriptor.

[0168] Next, the computer device sorts these scores and selects several candidate text descriptors with the highest matching degree with the target facial descriptor. The text corresponding to these selected text descriptors is the description text that best matches the target face image.

[0169] For example, assuming that the target face image is a smiling female face, after the descriptor mining in step S2, the computer device obtains a target face descriptor representing the features of this face. In step S3, the computer device matches and scores the target face descriptor with multiple candidate text descriptors in the facial description text library. Finally, the computer device can select the description text that best matches the target face image, such as "bright smile" or "smiling".

[0170] In this way, the computer device can accurately select the most suitable text for describing the target facial image from a large number of candidate description texts, thereby providing users with a more accurate and vivid description.

[0171] Step S4, merging the multiple target description texts to obtain a target facial description text corresponding to the target facial image.

[0172] In step S4, the computer device merges the multiple target description texts determined in step S3 to generate a complete and coherent target facial description text. The purpose of this step is to provide a comprehensive and accurate description to reflect multiple features of the target facial image.

[0173] The merging process is not simply to stitch together the selected description texts, but needs to consider the logical relationship and semantic coherence between the texts. The computer device can use natural language processing techniques, such as sentence fusion, synonym replacement or phrase reorganization, to ensure that the merged text is both comprehensive and fluent.

[0174] For example, assuming that the following three description texts are selected in step S3: "big and bright eyes", "high nose bridge", "warm and sincere smile". In step S4, the computer device can combine these descriptions into a complete sentence, such as: "her eyes are big and bright, her nose bridge is high, and her smile is warm and sincere".

[0175] In addition, the priority and importance of text can be considered during the merging process. Certain features may be more prominent or representative, and therefore can be given more weight when merging. For example, if the description "the smile is warm and sincere" is considered to be the most representative description of the target face image, it can be placed in a more prominent position or emphasized when merging text.

[0176] In summary, step S4 is a comprehensive text processing step, which requires the computer device to not only simply combine the selected description texts, but also ensure that the combined texts are semantically and logically coherent and accurate. In this way, the target facial description text finally generated can effectively convey the key features of the target face image.

[0177] As an implementation manner, the step S3, determining multiple target description texts according to the descriptor matching scores between the target facial descriptor and the multiple candidate text descriptors, includes:

[0178] Step S31, determining a candidate description text containing coherent semantics according to a descriptor matching score between every two candidate text descriptors among the plurality of candidate text descriptors; wherein the descriptor matching score between the candidate text descriptors corresponding to the candidate description text containing coherent semantics is not less than a coherence score threshold;

[0179] Step S32, projecting each of the plurality of description texts to be selected in the facial description text library into a text description point in the reference text description undirected graph;

[0180] Step S33, connecting the text description points corresponding to the two candidate description texts containing the coherent semantics to obtain a target text description undirected graph;

[0181] Step S34, determining the multiple target description texts according to the target text description undirected graph.

[0182] In step S31, the computer device performs a key task, namely determining which of the candidate text descriptors have coherent semantics. This step is to ensure that the final selected description text not only matches the target face image when viewed alone, but also forms a coherent and meaningful description as a whole.

[0183] Specifically, the computer device first calculates the descriptor matching score between each two of the multiple candidate text descriptors. This score reflects the semantic similarity and coherence of the two description texts. The score can be obtained by various similarity calculation methods, such as cosine similarity, Euclidean distance, etc., which can quantify the closeness between descriptors.

[0184] For example, suppose that the computer device has two candidate text descriptors, namely "deep eyes" and "sharp eyes". By calculating the matching score between the two descriptors, the computer device can determine whether they are semantically coherent. If the matching score of the two descriptors is high, it means that they have good coherence when describing the same facial features. Next, the computer device sets a coherence score threshold. This threshold is an important judgment criterion for screening out descriptive texts that are truly semantically coherent. Only when the matching score between the two candidate text descriptors is not less than this coherence score threshold, the computer device will consider that the two descriptive texts have coherent semantics.

[0185] For example, if the coherence score threshold is set to 0.8 (this value is determined based on actual application scenarios and experience), then only when the matching score of two descriptors reaches or exceeds 0.8, the two description texts will be considered coherent. In this way, the computer device can filter out those description texts that have a certain degree of match with the target face image but appear abrupt or incoherent in the overall description.

[0186] Finally, through the processing of step S31, the computer device can determine a group of candidate description texts containing coherent semantics, laying a solid foundation for subsequent text merging and generation of the final description text.

[0187] In step S32, the computer device performs a process of converting text data into graph data, that is, mapping multiple candidate description texts in the facial description text library to nodes in the reference text description undirected graph. This process is to facilitate subsequent analysis and processing using graph theory methods.

[0188] Specifically, the computer device first constructs an undirected graph of reference text descriptions, which is a data structure consisting of nodes and edges. In this graph, each node represents a text description point, that is, a candidate description text. The construction of the graph is based on the relationship between texts, but in this step, the focus is on the mapping process from text to nodes.

[0189] For example, suppose that the facial description text library contains the following candidate description texts: "big and bright eyes", "high nose bridge", "smiling face" and "fair skin color". When constructing the reference text description undirected graph, the computer device creates a node for each such description text. In this way, "big and bright eyes" will be mapped to a node in the graph, and similarly, "high nose bridge", "smiling face" and "fair skin color" will also be mapped to nodes in the graph respectively.

[0190] This mapping process can be seen as locating each candidate description text in the graph, so that the description information originally in the form of text is converted into a point in the graph structure. This conversion helps computer devices use graph algorithms to analyze and process the relationship between these description texts, such as finding the most relevant description text combination or identifying potential connections between description texts.

[0191] Through this step, the computer device lays the foundation for the subsequent construction of an undirected graph of target text description and graph-based data analysis, making the selected description text more accurate and coherent.

[0192] In step S33, the computer device performs a key operation, that is, connecting the text description points corresponding to the two candidate description texts containing coherent semantics in an undirected graph. This process is to construct an undirected graph of target text descriptions, so as to more intuitively show the relationship between the description texts and provide a basis for selecting the most appropriate target description text in subsequent steps.

[0193] Specifically, the computer device first identifies those candidate description texts that contain coherent semantics. These texts are determined by the matching scoring mechanism described in step S31, that is, their descriptor matching scores are not less than the set coherence score threshold. Once these coherent description texts are identified, the computer device will find their corresponding nodes in the reference text description undirected graph. Next, the computer device establishes connections between the nodes corresponding to these description texts with coherent semantics. In an undirected graph, the connection between nodes indicates that there is a certain association or similarity between them. In this application scenario, this association is semantic coherence. For example, suppose that "bright eyes" and "energetic" are two description texts identified as having coherent semantics. The computer device finds the nodes corresponding to the two description texts in the undirected graph and draws an edge between them, indicating that the two description texts are semantically coherent.

[0194] Through this step, the computer device constructs an undirected graph of the target text description, which contains multiple interconnected nodes, each of which represents a description text with coherent semantics. This undirected graph not only intuitively shows the relationship between the description texts, but also provides strong support for the subsequent selection of target description texts. The computer device can select the description texts that both match the target face image and are semantically coherent based on the connection relationship in the graph.

[0195] In step S34, the computer device determines multiple target description texts based on the previously constructed target text description undirected graph. This step is a key link in the entire process, which determines whether the description text finally output is accurate, coherent and consistent with the characteristics of the target face image.

[0196] First, the computer device analyzes the structure of the target text description undirected graph. This graph is composed of nodes corresponding to the description texts containing coherent semantics and the connections between them. By examining the connection relationship between the nodes, the computer device can identify which description texts are closely related in semantics.

[0197] Next, the computer device adopts a strategy to select the target description text from the graph. This strategy may be based on the connectivity of the graph, the degree of the node (i.e., the number of edges directly connected to the node), or other indicators in graph theory. For example, the computer device may select the description texts that are located in the highly connected subgraph of the graph because these texts are more semantically coherent. Specifically, if there is a highly connected subgraph in the target text description undirected graph, which contains the three nodes "bright eyes", "energetic" and "smiling", and there are direct connections between them, then the computer device can use the description texts corresponding to these nodes as the target description texts. Because these three description texts are not only semantically coherent, but also likely to constitute a comprehensive and accurate description of the target face image together.

[0198] In addition, the computer device can also consider the diversity and coverage of the description text. It can tend to select description text that can cover different features of the face (such as eyes, nose, mouth, etc.) to ensure that the output description is comprehensive and detailed.

[0199] Finally, through the processing of step S34, the computer device can determine a set of accurate and coherent target description texts that can effectively describe the characteristics and expressions of the target face image. For example, for a face image showing bright eyes, full of energy and smiling, the computer device can output three description texts: "bright eyes", "full of energy" and "smiling".

[0200] As an implementation manner, the step S34, determining the multiple target description texts according to the target text description undirected graph, includes:

[0201] Step S341, obtaining X target image region descriptors corresponding to X target training face image regions in the target face image respectively according to the target face descriptor; wherein X is the number of training face image regions obtained by performing image segmentation on the target face image, and X is a natural number greater than 1.

[0202] Step S342, iteratively repeat the following operations, stop when X target text description points are matched in the target text description undirected graph, and use the description texts corresponding to the X target text description points as the multiple target description texts:

[0203] Step S343, obtaining a plurality of candidate text description points connected to the e-th target text description point in the target text description undirected graph, and obtaining the candidate text descriptors of the candidate description texts corresponding to each of the plurality of candidate text description points; wherein the e-th target text description point is a text description point that matches the e-th target training face image region, the first Euclidean distance between the target text descriptor of the target description text corresponding to the e-th target text description point and the target image region descriptor corresponding to the e-th target training face image region is less than a distance threshold, and e is a natural number less than X;

[0204] Step S344, determining the e+1th target text description point that matches the e+1th training face image area from the multiple text description points to be selected; wherein the first Euclidean distance between the target text descriptor of the target description text corresponding to the e+1th target text description point and the target image area descriptor corresponding to the e+1th target training face image area is less than a distance threshold.

[0205] In step S341, the computer device further obtains descriptors of each region in the target face image based on the previously extracted target face descriptors. This process is to analyze the face image more carefully, so as to select more accurate and specific description text.

[0206] Specifically, the computer device first performs image segmentation on the target face image and divides it into X target training face image regions. Here X is a natural number greater than 1, which means that the image is segmented into multiple regions. For example, a face image can be divided into several regions such as eyes, nose, mouth, cheeks, etc. Then, for each segmented region, the computer device extracts the corresponding target image region descriptor. These descriptors are obtained by analyzing and calculating the color, texture, shape and other features of the pixels in the region, and they can effectively represent the visual information of the region.

[0207] Taking the eye region as an example, the computer device can extract descriptors about features such as eye size, shape, pupil position, and white-eye ratio. These descriptors will help to match the description text that matches the characteristics of the region in the subsequent steps, such as "bright eyes" and "deep eyes".

[0208] In this way, the computer device can obtain accurate descriptor information for each area of ​​the face image. This information will provide strong support for the subsequent search for matching description text in the target text description undirected graph, thereby improving the accuracy and pertinence of the description text.

[0209] In step S342, the computer device performs an iterative process to match a sufficient number of target text description points in the target text description undirected graph. This process is a key step in determining multiple target description texts.

[0210] Specifically, the computer device repeatedly performs operations S343 and S344, that is, each time a target text description point matching the target face image region is found in the target text description undirected graph. This process is continued until X target text description points are matched in the graph. Here, X corresponds to the number of regions segmented from the target face image.

[0211] For example, suppose the target face image is segmented into three regions: eyes, nose, and mouth. Then, the computer device needs to find target text description points that match these three regions in the target text description undirected graph. First, the computer device searches for matching target text description points in the graph based on the feature descriptor of the eye region, such as finding the text description point describing "bright eyes". Then, the computer device continues to search for matching target text description points in the graph based on the feature descriptor of the nose region, such as finding the text description point describing "high nose bridge". Next, based on the feature descriptor of the mouth region, find matching text description points such as "sweet smile".

[0212] When the computer device matches the three target text description points in the target text description undirected graph, the iteration process stops. At this time, the description texts corresponding to the three target text description points - "bright eyes", "high nose bridge" and "sweet smile" will be output as multiple target description texts.

[0213] In this way, the computer device can ensure that the selected description text not only matches the overall characteristics of the target face image, but also reflects the characteristics of each area in the image in detail. This greatly improves the accuracy and pertinence of the description text, making the output text description more consistent with the actual situation of the face image.

[0214] In step S343, the computer device performs specific operations in the target text description undirected graph to find a text description that matches the current target training face image area. This step is a key link in the iterative process, which ensures that the most suitable description text can be found for each image area. Specifically, the computer device will first focus on the e-th target text description point, which is a text description point that has been matched with the e-th target training face image area. The "matching" here means that the first Euclidean distance between the target text descriptor of the text description point and the target image area descriptor is less than the set distance threshold. This means that the description text is highly similar to the corresponding face image area in terms of features.

[0215] For example, suppose that the e-th target training face image area is the eye area, and the e-th target text description point that matches it is "bright eyes". At this time, the computer device searches for all candidate text description points that are directly connected to the description point "bright eyes" in the target text description undirected graph. These candidate text description points are, for example, texts that describe other features of the eyes, such as "deep eyes", "long and thin eyeliner", etc. Next, the computer device obtains the candidate text descriptors of the candidate description texts corresponding to each of these candidate text description points. These descriptors are obtained by extracting features from the text and can reflect the main content and features of the text. For example, for the description text "deep eyes", its candidate text descriptor may contain information about features such as eye depth and concentration.

[0216] The purpose of this step is to find the text description point that best matches the next target training face image area from these candidate text description points in the next iteration. In this way, the computer device can gradually build a complete and coherent description text sequence to accurately describe each area of ​​the target face image.

[0217] In step S344, the computer device determines a target text description point that matches the e+1th training face image region from the plurality of candidate text description points. This process is to ensure that the selected description text can accurately reflect the characteristics of the specific region in the face image.

[0218] Specifically, the computer device has obtained multiple candidate text description points connected to the e-th target text description point and the candidate text descriptors of the candidate description texts corresponding to them through the previous steps. Now, the computer device needs to select a description point that best matches the e+1-th training face image area. In order to achieve this, the computer device calculates the first Euclidean distance between each candidate text descriptor and the target image area descriptor corresponding to the e+1-th target training face image area. This distance is an important indicator for measuring the similarity between the two. The computer device compares these distances and finds a candidate text description point whose distance is less than the set distance threshold. This point is determined as the e+1-th target text description point that matches the e+1-th training face image area.

[0219] For example, assuming that the e+1th training face image region is the nose region, the computer device has obtained multiple candidate text description points connected to the description point "bright eyes" matching the eye region (i.e., the eth region), such as "high nose bridge", "flat nose", etc. Now, the computer device needs to calculate the first Euclidean distance between these candidate text descriptors and the target image region descriptor of the nose region.

[0220] After calculation, the computer device finds that the distance of the descriptor "high nose bridge" is the smallest and is less than the set distance threshold. Therefore, the computer device determines that "high nose bridge" is the target text description point that matches the nose area (the e+1th training face image area).

[0221] This process will continue until the computer device finds the target text description points that match all the face image areas. In this way, the computer device can generate an accurate and coherent description text that fully reflects the characteristics of the face image.

[0222] In one embodiment, the step S2, before performing descriptor mining on the target face image and the plurality of candidate description texts included in the facial description text library according to the target descriptor mining algorithm, may further include:

[0223] Step S1a, obtaining a training face descriptor set by mining a plurality of training facial descriptors from the face training image and a plurality of training text descriptors from the face description training text using the descriptor mining algorithm;

[0224] Step S1b, if the training face descriptor obtained in the training face descriptor set is a training face descriptor, obtaining a true training text descriptor corresponding to the training face descriptor, and calculating a first generation value paired with the training face descriptor; wherein a matching score between a first reference face image corresponding to a face description training text to which the true training text descriptor belongs and the face training image is greater than a first score threshold;

[0225] Step S1c, if the training face descriptor obtained in the training face descriptor set is a training text descriptor, then obtaining a true training face descriptor corresponding to the training text descriptor, and calculating a second generation value paired with the training text descriptor; wherein the matching score between the first reference description text corresponding to the face training image to which the true training face descriptor belongs and the face description training text is greater than a second score threshold;

[0226] Step S1d, determining a descriptor associated cost value based on the first generation value of the training facial descriptor and the second generation value matched by the training text descriptor;

[0227] Step S1e: when the descriptor association cost value meets the training cutoff index, stop training the descriptor mining algorithm to obtain the target descriptor mining algorithm.

[0228] The process of steps S1a to S1e may refer to the aforementioned steps S10 to S50 and will not be described in detail here.

[0229] As an implementation mode, the step S1d, based on the first generation value of the training facial descriptor and the second generation value matched with the training text descriptor, determines the descriptor-associated cost value, including: using a descriptor relationship evaluation algorithm to determine the descriptor similarity score between the training facial descriptor and the training text descriptor in the training face descriptor set; determining a reference face descriptor combination in the training face descriptor set based on the descriptor similarity score; wherein the reference face descriptor combination includes a reference training facial descriptor and a reference training text descriptor, and the descriptor similarity score between the reference training facial descriptor and the reference training text descriptor is greater than a similarity score threshold; determining the descriptor-associated cost value based on the first generation value matched with the reference training facial descriptor and the second generation value matched with the reference training text descriptor.

[0230] The implementation of the above S1d can refer to the above steps S41 to S43, which will not be described in detail here.

[0231] As an implementation mode, the determining of the descriptor-associated cost value based on the first generation value matched with the reference training facial descriptor and the second generation value matched with the reference training text descriptor comprises: obtaining a pseudo training text descriptor corresponding to the reference training facial descriptor, and calculating a third generation value paired with the reference training facial descriptor; wherein a matching score between a first reference facial image corresponding to a facial description training text to which the pseudo training text descriptor belongs and the facial training image is less than a third score threshold; obtaining a pseudo training facial descriptor corresponding to the reference training text descriptor, and calculating a third generation value paired with the reference training facial descriptor; wherein a matching score between a first reference facial image corresponding to a facial description training text to which the pseudo training text descriptor belongs and the facial training image is less than a third score threshold; A fourth-generation value matched with a training text descriptor; wherein the matching score between the first reference description text corresponding to the face training image to which the fake training face descriptor belongs and the face description training text is less than a fourth score threshold; based on the cost error between the first-generation value and the third-generation value, a face descriptor generation value corresponding to the reference training face descriptor is obtained, and based on the cost error between the second-generation value and the fourth-generation value, a text descriptor generation value corresponding to the reference training text descriptor is obtained; and the descriptor-associated cost value is determined based on the combined cost value of the face descriptor generation value and the text descriptor cost value.

[0232] The specific implementation of this embodiment can refer to the aforementioned steps S431 to S434, which will not be described in detail here.

[0233] The present disclosure also provides a computer device, such as Figure 3As shown, the hardware entity of the computer device 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 steps in the method of any of the above embodiments are implemented when the processor 1001 executes the program. The memory 1002 stores a computer program that can be run on the processor, and the memory 1002 is configured to store instructions and applications executable by the processor 1001, and can also cache data to be processed or processed by the processor 1001 and each module in the computer device 1000 (for example, image data, text data), which can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM). When the processor 1001 executes the program, the steps of any of the above-mentioned face detection methods based on deep neural networks are implemented. The processor 1001 generally controls the overall operation of the computer device 1000.

Claims

1. A face detection method based on deep neural network, characterized in that: include: Acquire a target face image and a face description text library; wherein the face description text library includes a plurality of description texts to be selected; Descriptor mining is performed on the target face image and the multiple candidate description texts according to a target descriptor mining algorithm to obtain a target face descriptor corresponding to the target face image and multiple candidate text descriptors corresponding to the multiple candidate description texts; wherein the target descriptor mining algorithm is a descriptor mining algorithm determined based on joint learning of face training images and face description training texts, and when the descriptor correlation cost between the training face descriptors in the face training image and the training text descriptors in the face description training text meets the training cutoff index; the target descriptor mining algorithm is a deep neural network; Determining a plurality of target description texts according to descriptor matching scores between the target facial descriptor and the plurality of candidate text descriptors; Merging the multiple target description texts to obtain a target facial description text corresponding to the target facial image; The training process of the descriptor mining algorithm includes: A training face descriptor set is obtained by mining a plurality of training face descriptors from face training images and a plurality of training text descriptors from face description training texts using a descriptor mining algorithm; If the training face descriptor obtained from the training face descriptor set is a training face descriptor, obtaining a true training text descriptor corresponding to the training face descriptor, and calculating a first generation value paired with the training face descriptor; wherein a matching score between a first reference face image corresponding to a face description training text to which the true training text descriptor belongs and the face training image is greater than a first score threshold; If the training face descriptor obtained from the training face descriptor set is a training text descriptor, obtaining a true training face descriptor corresponding to the training text descriptor, and calculating a second generation value paired with the training text descriptor; wherein a matching score between a first reference description text corresponding to a face training image to which the true training face descriptor belongs and the face description training text is greater than a second score threshold; Determining a descriptor associated cost value based on the first generation value of the training facial descriptor and the second generation value matched by the training text descriptor; If the descriptor association cost value meets the training cutoff index, stop training the descriptor mining algorithm to obtain a target descriptor mining algorithm; The step of determining the descriptor associated cost value based on the first generation value of the training facial descriptor and the second generation value matched by the training text descriptor includes: Determining a descriptor similarity score between the training facial descriptor and the training text descriptor in the training face descriptor set using a descriptor relationship evaluation algorithm; Determining a reference face descriptor combination in the training face descriptor set according to the descriptor similarity score; wherein the reference face descriptor combination includes a reference training face descriptor and a reference training text descriptor, and the descriptor similarity score between the reference training face descriptor and the reference training text descriptor is greater than a similarity score threshold; Determining the descriptor-associated cost value based on the first generation value that matches the reference training facial descriptor and the second generation value that matches the reference training text descriptor; Determining the descriptor-associated cost value based on the first generation value matched with the reference training facial descriptor and the second generation value matched with the reference training text descriptor includes: Acquire a fake training text descriptor corresponding to the reference training face descriptor, and calculate a third generation value paired with the reference training face descriptor; wherein a matching score between a first reference face image corresponding to a face description training text to which the fake training text descriptor belongs and the face training image is less than a third score threshold, and the third score threshold is less than the first score threshold; Acquire a fake training face descriptor corresponding to the reference training text descriptor, and calculate a fourth generation value paired with the reference training text descriptor; wherein a matching score between a first reference description text corresponding to a face training image to which the fake training face descriptor belongs and the face description training text is less than a fourth score threshold, and the fourth score threshold is less than the second score threshold; According to the cost error between the first generation value and the third generation value, a face description sub-generation value corresponding to the reference training face descriptor is obtained, and according to the cost error between the second generation value and the fourth generation value, a text description sub-generation value corresponding to the reference training text descriptor is obtained; The descriptor associated cost value is determined according to a combined cost value of the facial descriptor cost value and the text descriptor cost value.

2. The method according to claim 1, characterized in that The step of determining a plurality of target description texts according to the descriptor matching scores between the target facial descriptor and the plurality of candidate text descriptors comprises: Determine a candidate description text containing coherent semantics according to a descriptor matching score between each two candidate text descriptors among the plurality of candidate text descriptors; wherein the descriptor matching score between the candidate text descriptors corresponding to the candidate description text containing coherent semantics is not less than a coherence score threshold; Projecting each of the plurality of description texts to be selected in the facial description text library into a text description point in a reference text description undirected graph; Connecting the text description points corresponding to the two candidate description texts containing the coherent semantics to obtain a target text description undirected graph; Acquire X target image region descriptors corresponding to X target training face image regions in the target face image according to the target face descriptor; wherein X is the number of training face image regions obtained by performing image segmentation on the target face image, and X is a natural number greater than 1; Iteratively repeat the following operations, stop when X target text description points are matched in the target text description undirected graph, and use the description texts corresponding to the X target text description points as the multiple target description texts: In the target text description undirected graph, a plurality of candidate text description points connected to the e-th target text description point are obtained, and candidate text descriptors of the candidate description texts corresponding to the plurality of candidate text description points are obtained; wherein the e-th target text description point is a text description point that matches the e-th target training face image region, the target text descriptor of the target description text corresponding to the e-th target text description point, and the first Euclidean distance between the target image region descriptor corresponding to the e-th target training face image region is less than a distance threshold, and e is a natural number less than X; An e+1th target text description point matching the e+1th training face image area is determined from among the multiple text description points to be selected; wherein a first Euclidean distance between a target text descriptor of a target description text corresponding to the e+1th target text description point and a target image area descriptor corresponding to the e+1th target training face image area is less than a distance threshold.

3. The method according to claim 2, characterized in that Before performing descriptor mining on the target face image and the multiple description texts to be selected included in the facial description text library according to the target descriptor mining algorithm, the method further includes: Obtain a training face descriptor set by mining a plurality of training facial descriptors from the face training image and a plurality of training text descriptors from the face description training text using the descriptor mining algorithm; If the training face descriptor obtained from the training face descriptor set is a training face descriptor, then obtaining a true training text descriptor corresponding to the training face descriptor, and calculating a first generation value paired with the training face descriptor; wherein a matching score between a first reference face image corresponding to a face description training text to which the true training text descriptor belongs and the face training image is greater than a first score threshold; If the training face descriptor obtained from the training face descriptor set is a training text descriptor, then obtaining a true training face descriptor corresponding to the training text descriptor, and calculating a second generation value paired with the training text descriptor; wherein a matching score between a first reference description text corresponding to a face training image to which the true training face descriptor belongs and the face description training text is greater than a second score threshold; Determining a descriptor associated cost value based on the first generation value of the training facial descriptor and the second generation value matched by the training text descriptor; When the descriptor association cost value meets the training cutoff index, the training of the descriptor mining algorithm is stopped to obtain the target descriptor mining algorithm.

4. The method according to claim 1, characterized in that: Determining a reference face descriptor combination in the training face descriptor set according to the descriptor similarity score includes: Iteratively repeat the following operations, and stop when the training text descriptors corresponding to the plurality of training face descriptors in the training face descriptor set are obtained, and obtain a plurality of reference face descriptor combinations according to the plurality of training face descriptors and the corresponding training text descriptors: Determining a training facial descriptor from among the plurality of training facial descriptors as a target training facial descriptor; According to the descriptor similarity score output by the descriptor relationship evaluation algorithm, a target training text descriptor corresponding to the target training face descriptor is obtained from the training text descriptors; wherein the descriptor similarity score between the target training face descriptor and the target training text descriptor exceeds the descriptor similarity score between the target training face descriptor and the remaining training text descriptors; The target training face descriptor and the target training text descriptor are determined as the reference face descriptor combination.

5. The method according to claim 1 or 4, characterized in that: The method of mining a plurality of training facial descriptors from a face training image and a plurality of training text descriptors from a face description training text using a descriptor mining algorithm to obtain a training face descriptor set includes: Based on the descriptor mining algorithm obtained after self-learning, descriptor mining is performed in the face training image and the face description training text respectively to obtain multiple reference face descriptors for the face training image and multiple reference text descriptors for the face description training text; wherein the descriptor mining algorithm includes a face descriptor mining operator and a text descriptor mining operator, the face descriptor mining operator is used to mine the reference face descriptor based on the face training image area included in the face training image, and the text descriptor mining operator is used to mine the reference text descriptor based on the face description training text paragraph included in the face description training text; The multiple reference facial descriptors and the multiple reference text descriptors are processed using a dense affine operator to obtain the multiple training facial descriptors for the multiple reference facial descriptors and the multiple training text descriptors for the multiple reference text descriptors; wherein the dense affine operator is a fully connected layer, and the training facial descriptors and the training text descriptors contain the same number of elements.

6. The method according to claim 5, characterized in that Before the descriptor mining algorithm obtained after self-learning performs descriptor mining in the face training image and the face description training text respectively, the method further includes: Acquire a set of pre-trained knowledge templates; wherein the set of pre-trained knowledge templates includes a plurality of pre-trained face images and a plurality of pre-trained description texts; Based on the multiple pre-trained face images, a reference facial descriptor mining operator in a reference descriptor mining algorithm is self-learned, and based on the multiple pre-trained description texts, a reference text descriptor mining operator in the reference descriptor mining algorithm is self-learned; If the reference facial descriptor mining operator reaches a first training cutoff indicator and the reference text descriptor mining operator reaches a second training cutoff indicator, the reference descriptor mining algorithm is determined to be the descriptor mining algorithm after self-learning.

7. The method according to claim 6, characterized in that The self-learning of the reference facial descriptor mining operator in the reference descriptor mining algorithm based on the plurality of pre-trained face images includes: Determining a first training face image region in the pre-training face image; Performing descriptor mining on the first training face image region according to the reference face descriptor mining operator to obtain a first image region descriptor, and performing descriptor mining on a second training face image region outside the first training face image region in the pre-training face image according to the reference face descriptor mining operator to obtain a second image region descriptor; estimating a facial descriptor corresponding to the first training face image region according to the second image region descriptor to obtain an estimated image region descriptor; If the descriptor difference between the estimated image region descriptor and the first image region descriptor is greater than a target estimated reference value, modifying an operator parameter of the reference facial descriptor mining operator; If the descriptor difference between the estimated image region descriptor and the first image region descriptor is not greater than the target estimated reference value, determining that the reference facial descriptor mining operator reaches the first training cutoff indicator; The self-learning of the reference text descriptor mining operator in the reference descriptor mining algorithm based on the multiple pre-trained description texts includes: Determining a first training description text paragraph in the pre-training description text; Performing descriptor mining on the first training description text paragraph according to the reference text descriptor mining operator to obtain a first text paragraph descriptor, and performing descriptor mining on a second training description text paragraph other than the first training description text paragraph in the pre-training description text according to the reference text descriptor mining operator to obtain a second text paragraph descriptor; estimating a text descriptor corresponding to the first training description text paragraph according to the second text paragraph descriptor to obtain an estimated text paragraph descriptor; If the descriptor difference between the estimated text paragraph descriptor and the first text paragraph descriptor is greater than the target estimated reference value, modifying the operator parameters of the reference text descriptor mining operator; If the descriptor difference between the estimated text paragraph descriptor and the first text paragraph descriptor is not greater than the target estimated reference value, it is determined that the reference text descriptor mining operator reaches the second training cutoff indicator.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Image-text matching model training method and device, equipment and storage medium

    CN116541707A

  • Cross-age face recognition method and related device

    CN117011907A

  • Attribute recognition method based on artificial intelligence and attribute recognition model training method

    CN117523275A

  • Method for training image-text matching model, computing device, and storage medium

    US20230005284A1

  • Method for training image editing model and method for editing image

    US20230071661A1