WO2021184553A1 - 人脸识别模型训练方法、装置、计算机设备及存储介质 - Google Patents

人脸识别模型训练方法、装置、计算机设备及存储介质 Download PDF

Info

Publication number
WO2021184553A1
WO2021184553A1 PCT/CN2020/093330 CN2020093330W WO2021184553A1 WO 2021184553 A1 WO2021184553 A1 WO 2021184553A1 CN 2020093330 W CN2020093330 W CN 2020093330W WO 2021184553 A1 WO2021184553 A1 WO 2021184553A1
Authority
WO
WIPO (PCT)
Prior art keywords
trained
face image
target
distribution histogram
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2020/093330
Other languages
English (en)
French (fr)
Inventor
陈嘉莉
周超勇
刘玉宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2021184553A1 publication Critical patent/WO2021184553A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/172Classification, e.g. identification

Definitions

  • This application relates to the field of intelligent decision-making in the field of artificial intelligence technology, and in particular to a method, device, computer equipment, and storage medium for training a face recognition model.
  • the embodiments of the present application provide a face recognition model training method, device, computer equipment, and storage medium to solve the problem of low accuracy of face recognition.
  • a face recognition model training method including:
  • the first target ⁇ distribution histogram of the face image set to be trained After training for the first preset number of times, obtain the first target ⁇ distribution histogram of the face image set to be trained, where the first target ⁇ distribution histogram is the current ⁇ distribution histogram, In the histogram of the first target ⁇ distribution, the abscissa is the cos ⁇ value, and the ordinate is the number of samples, where ⁇ refers to the difference between the first weight value in the loss function and the feature point corresponding to each face image to be trained Included angle
  • a face recognition model training device including:
  • the sample face image set acquisition module is configured to acquire a sample face image set, and set the same first weight value for each sample face image in the sample face image set to obtain a face image set to be trained;
  • the training module is used to input each face image to be trained in the face image set to be trained into the neural network model for training;
  • the first target ⁇ distribution histogram obtaining module is configured to obtain the first target ⁇ distribution histogram of the face image set to be trained after a first preset number of trainings, wherein the first target ⁇ distribution
  • the histogram is the current ⁇ distribution histogram.
  • the abscissa is the cos ⁇ value
  • the ordinate is the number of samples, where ⁇ is used to reflect that each face image to be trained is a clean sample The probability;
  • the first adjustment module is configured to adjust the first weight value of each face image to be trained in the face image set to be trained according to the first target ⁇ distribution histogram, wherein each of the adjusted face images The first weight value of the face image to be trained is positively correlated with the corresponding cos ⁇ value;
  • the target face recognition model generation module is configured to return to performing the step of obtaining the first target ⁇ distribution histogram of the face image set to be trained after the first preset number of times of training, until the neural network The model meets the preset termination conditions, and the target face recognition model is obtained.
  • a computer device includes a memory, a processor, and computer-readable instructions that are stored in the memory and can run on the processor, and the processor implements the following steps when the processor executes the computer-readable instructions:
  • the first target ⁇ distribution histogram of the face image set to be trained After training for the first preset number of times, obtain the first target ⁇ distribution histogram of the face image set to be trained, where the first target ⁇ distribution histogram is the current ⁇ distribution histogram, In the histogram of the first target ⁇ distribution, the abscissa is the cos ⁇ value, and the ordinate is the number of samples, where ⁇ refers to the difference between the first weight value in the loss function and the feature point corresponding to each face image to be trained Included angle
  • One or more readable storage media storing computer readable instructions, when the computer readable instructions are executed by one or more processors, the one or more processors execute the following steps:
  • the first target ⁇ distribution histogram of the face image set to be trained After training for the first preset number of times, obtain the first target ⁇ distribution histogram of the face image set to be trained, where the first target ⁇ distribution histogram is the current ⁇ distribution histogram, In the histogram of the first target ⁇ distribution, the abscissa is the cos ⁇ value, and the ordinate is the number of samples, where ⁇ refers to the difference between the first weight value in the loss function and the feature point corresponding to each face image to be trained Included angle
  • the above-mentioned face recognition model training method, device, computer equipment and storage medium obtain the sample face image set, and set the same first weight value for each sample face image in the sample face image set to obtain the face image to be trained Set; input each face image to be trained in the face image set to be trained into the neural network model for training; after the first preset number of training, obtain the first target ⁇ distribution of the face image set to be trained Histogram, where the first target ⁇ distribution histogram is the current ⁇ distribution histogram, in the first target ⁇ distribution histogram, the abscissa is the cos ⁇ value, and the number of samples is the ordinate; according to the first target ⁇ distribution histogram Adjust the first weight value of each face image to be trained in the face image set to be trained, where the adjusted first weight value of each face image to be trained is positively correlated with the corresponding cos ⁇ value; After the first preset number of trainings, the step of obtaining the first target ⁇ distribution histogram of the face image set to be trained until the neural
  • the ⁇ distribution of the sample face image reflects the probability that the sample face image is a clean sample, thus The face recognition accuracy of the generated target face recognition model is improved.
  • FIG. 1 is a schematic diagram of an application environment of a face recognition model training method in an embodiment of the present application
  • FIG. 2 is an example diagram of a face recognition model training method in an embodiment of the present application
  • Fig. 3 is another example diagram of a face recognition model training method in an embodiment of the present application.
  • Fig. 4 is another example diagram of a face recognition model training method in an embodiment of the present application.
  • Fig. 5 is another example diagram of a face recognition model training method in an embodiment of the present application.
  • Fig. 6 is another example diagram of a face recognition model training method in an embodiment of the present application.
  • Fig. 7 is a functional block diagram of a face recognition model training device in an embodiment of the present application.
  • FIG. 8 is another functional block diagram of the face recognition model training device in an embodiment of the present application.
  • FIG. 9 is another functional block diagram of a face recognition model training device in an embodiment of the present application.
  • Fig. 10 is a schematic diagram of a computer device in an embodiment of the present application.
  • the face recognition model training method provided by the embodiment of the present application can be applied to the application environment as shown in FIG. 1.
  • the face recognition model training method is applied to a face recognition model training system.
  • the face recognition model training system includes a client and a server as shown in Figure 1.
  • the client and the server communicate through the network. Used to solve the problem of low accuracy of face recognition.
  • the client is also called the client, which refers to the program that corresponds to the server and provides local services to the client.
  • the client can be installed on, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices.
  • the server can be implemented with an independent server or a server cluster composed of multiple servers.
  • a method for training a face recognition model is provided. Taking the method applied to the server in FIG. 1 as an example, the method includes the following steps:
  • S10 Obtain a sample face image set, and set the same first weight value for each sample face image in the sample face image set to obtain a face image set to be trained.
  • the sample face image set refers to the face image data used for model training.
  • the sample face image set may be acquired by first collecting face pictures as a sample face image set, or directly acquiring face pictures from a face database as a sample face image set, such as an AR face database.
  • the face image set to be trained refers to face image data obtained by setting the weight of each sample face image in the sample face image set.
  • a sample face image set is obtained, and then the same first weight value is set for each sample face image in the sample face image set, for example: the first weight value of each sample face image is set to 1, thereby Obtain the face image set to be trained.
  • the neural network model does not have good face recognition capabilities in the initial process of training using the sample face image set, that is, the untrained neural network model cannot well integrate The clean samples and noisy samples in the sample face image set are distinguished. Therefore, in this step, first set each sample face image in the sample face image set to the same first weight value. Understandably, the first weight value can be any value, as long as it is ensured that the first weight value of each sample face image in the sample face image set is the same.
  • S20 Input each face image to be trained in the face image set to be trained into the neural network model for training.
  • each face image to be trained in the face image set to be trained is input into the neural network model for training.
  • the neural network model adopted in this embodiment is CNN (Convolutional Neural Network, convolutional neural network).
  • the neural network in the process of inputting each face image to be trained in the set of face images to be trained into the neural network model for training, can be used to learn each face image to be trained. That is, the face feature extraction is performed on each training face image, and the face features of each face image to be trained are obtained.
  • the facial features of the face image to be trained can be the key feature points, lines, and faces of the facial features of the face, so as to form the facial features of the face.
  • the first preset number of times refers to the preset number of times each face image to be trained is trained in the neural network model.
  • the first preset number of times can be any number of times such as once, twice, or three times.
  • each face image to be trained in the face image set to be trained is input into the neural network model, and then the stochastic gradient descent algorithm SGD is used for training.
  • the person to be trained is obtained The first target ⁇ distribution histogram of the face image set.
  • the first target ⁇ distribution histogram is the current ⁇ distribution histogram obtained after the first preset number of trainings.
  • the abscissa is the cos ⁇ value
  • the ordinate is the number of samples.
  • refers to the angle between the first weight value in the loss function and the feature point corresponding to each face image to be trained.
  • the loss function is preferably a softmax loss function.
  • the feature point corresponding to each face image to be trained refers to the face feature of each face image to be trained after facial feature extraction is performed on each training face image.
  • the first target ⁇ distribution histogram can be used to indicate the cos ⁇ value corresponding to each face image to be trained in the face image set to be trained.
  • the distribution of cos ⁇ values of each face image to be trained reflects the probability that they are clean samples.
  • the face image to be trained with a larger cos ⁇ value will start to move to the right; the face image with a smaller cos ⁇ value to be trained The face image will also move to the right, but the face image to be trained with a smaller cos ⁇ value always remains on the left side of the first target ⁇ distribution histogram.
  • the convolutional neural network CNN tends to identify easy and clean samples quickly, and finally can also identify difficult and noisy samples, the face images to be trained with a larger cos ⁇ value are: The higher probability is a clean sample.
  • the stochastic gradient descent algorithm SGD refers to an algorithm that randomly selects a face image set to be trained from the face image set to be trained for learning, namely: Since the stochastic gradient descent algorithm SGD only randomly selects one sample at a time to update the model parameters, each learning is very fast and can be updated online. Understandably, based on the nature of the stochastic gradient descent algorithm SGD, the category weight corresponding to each face image to be trained in the face image set to be trained will be updated, and then the category weight after each training update is used to calculate the training person The cos ⁇ value of each face image to be trained in the face image set, so as to obtain the cos ⁇ value of each face image to be trained in the training face image set.
  • the cos ⁇ value of each face image to be trained in the face image set to be trained is determined according to the first target ⁇ distribution histogram, and then the cos ⁇ value of each face image to be trained is determined according to each face image to be trained Adjust the first weight value of each face image to be trained.
  • a larger first weight value is assigned to a face image to be trained with a larger cos ⁇ value
  • a smaller first weight value is assigned to a face image to be trained with a smaller cos ⁇ value. That is, a larger first weight value is set for clean samples, and a smaller first weight value is set for noise samples. Understandably, the adjusted first weight value of each face image to be trained is positively correlated with the corresponding cos ⁇ value.
  • the step of obtaining the first target ⁇ distribution histogram of the face image set to be trained after the first preset number of training return to the step of obtaining the first target ⁇ distribution histogram of the face image set to be trained after the first preset number of training, until the neural network The network model meets the preset termination conditions, and the target face recognition model is obtained.
  • the target face recognition model refers to a model obtained after training that can recognize a face image with high accuracy.
  • the preset termination condition refers to a preset condition for the neural network model to terminate training.
  • the termination condition can be that the number of training times of the neural network model reaches a preset threshold; it can also be that the accuracy value of the neural network model reaches a preset accuracy threshold, that is, the difference between the output value of the neural network model and the target value. The error reaches the preset accuracy threshold.
  • the corresponding parameter values in the neural network model can be modified according to preset termination conditions in advance, so as to ensure that during the training process, when the neural network model meets the preset termination conditions When the conditions are met, the training is automatically converged to end the training, and the target face recognition model is obtained.
  • the same first weight value is set for each sample face image in the sample face image set to obtain the face image set to be trained;
  • Each face image to be trained is input to the neural network model for training; after the first preset number of training, the first target ⁇ distribution histogram of the face image set to be trained is obtained, where the first target ⁇ distribution The histogram is the current ⁇ distribution histogram.
  • the abscissa is the cos ⁇ value, and the number of samples is the ordinate; according to the first target ⁇ distribution histogram, adjust each face image set to be trained Training the first weight value of the face image, wherein the adjusted first weight value of each face image to be trained is positively correlated with the corresponding cos ⁇ value; the return execution is performed after the first preset number of trainings, The step of obtaining the first target ⁇ distribution histogram of the face image set to be trained, until the neural network model meets the preset termination conditions, and the target face recognition model is obtained; the method of weighted sample training is adopted, and the ⁇ distribution histogram generated through training Figure, adjust the weight value of each sample face image, and then repeat the training for many times.
  • the ⁇ distribution of the sample face image reflects the probability that the sample face image is a clean sample, thereby improving the generated target face recognition model Face recognition accuracy.
  • the face recognition model training method After adjusting the first weight value of each face image to be trained in the face image set to be trained according to the first target ⁇ distribution histogram, the face recognition model training method, It also specifically includes the following steps:
  • the second preset number of times refers to the preset number of times each face image to be trained is trained on the neural network model.
  • the second preset number of times can be any number of times such as once, twice, or three times. It should be noted that, in order to ensure the accuracy value of the face recognition model after the second training, the second preset number of times is greater than the first preset number of times.
  • the second target ⁇ distribution histogram of the face image set to be trained is obtained, where the second target ⁇ distribution histogram is the second target ⁇ distribution histogram after the second preset number of training sessions. After that, the current ⁇ distribution histogram is obtained.
  • the abscissa is the cos ⁇ value
  • the ordinate is the number of samples.
  • the second target ⁇ distribution histogram can be used to indicate the cos ⁇ value corresponding to each face image to be trained in the face image set to be trained.
  • the distribution of cos ⁇ values of each face image to be trained reflects the probability that they are clean samples.
  • the neural network model after training for the second preset number of times, the neural network model has relatively good performance.
  • the second target ⁇ distribution histogram there will be a small area between the clean sample and the noise sample.
  • the overlapping area is half-clean and half-noise samples.
  • the cos ⁇ value of each face image to be trained in the face image set to be trained is determined according to the second target ⁇ distribution histogram, and then the cos ⁇ value of each face image to be trained is determined according to the The cos ⁇ value adjusts the first weight value of each face image to be trained.
  • the cos ⁇ value of each face image to be trained in the second target ⁇ distribution histogram it is possible to accurately distinguish clean samples, semi-clean and semi-noise samples, and noise samples. Since the clean sample and the noise sample have a small overlap area in the second target ⁇ distribution histogram, the number of semi-clean and semi-noise samples is also very small.
  • this step increase the first weight value of the half-clean and half-noise samples, that is, set the weight of the half-clean and half-noise samples in the overlapping area of the second target ⁇ distribution histogram It is larger than the clean sample and the noise sample, that is, the first weight value of each face image to be trained after adjustment and the corresponding cos ⁇ value are normally distributed, so that the training of the convolutional neural network is more targeted.
  • the second target ⁇ distribution histogram of the face image set to be trained is obtained, where the second target ⁇ distribution histogram is the current ⁇ distribution histogram, The second preset number of times is greater than the first preset number of times; the first weight value of each face image to be trained in the face image set to be trained is adjusted according to the second target ⁇ distribution histogram, where each person to be trained after adjustment The first weight value of the face image and the corresponding cos ⁇ value are normally distributed; the second target ⁇ distribution histogram is used to further adjust the first weight value of each face image to be trained, so that the training of the neural network model is more targeted In order to further improve the face recognition accuracy of the generated target face recognition model.
  • adjusting the first weight value of each face image to be trained in the face image set to be trained according to the first target ⁇ distribution histogram specifically includes the following steps:
  • S401 Based on the first target ⁇ distribution histogram, determine the cos ⁇ value of each face image to be trained in the face image set to be trained.
  • the first is based on the target ⁇ distribution histogram to obtain the
  • the cos ⁇ value corresponding to the training face image s 1- s 30 is 0.2-0.4
  • the cos ⁇ value corresponding to the training face image s 31 -s 60 is 0.4-0.6
  • the training face image s 61- s 100 is The corresponding cos ⁇ value is 0.6-0.8.
  • w is the first weight value
  • cos ⁇ is the cos ⁇ value of the face image to be trained
  • ⁇ r is the maximum cos ⁇ value in the first target ⁇ distribution histogram
  • ⁇ l is the top peak on the left side of the first target ⁇ distribution histogram .
  • softplus is a smooth version of the relu function.
  • the size of the first weight value w is determined by the ratio of softplus( ⁇ z) to softplus( ⁇ ), and in this embodiment, ⁇ is a preset fixed value, for example: preset ⁇ Is 10.
  • the size of z is determined by cos ⁇ , ⁇ l, and ⁇ r .
  • ⁇ l is the top peak on the left side of the first target ⁇ distribution histogram
  • ⁇ r is the largest cos ⁇ value in the first target ⁇ distribution histogram; that is, when the training is completed, the first target After the target ⁇ distribution histogram, ⁇ l and ⁇ r can also be directly determined from the first target ⁇ distribution histogram. It can be seen that the size of the first weight value w of each face image to be trained mainly depends on the size of cos ⁇ . When cos ⁇ is larger, the corresponding output first weight value w will also become larger.
  • each face image to be trained after determining the cos ⁇ value of each face image to be trained and the corresponding first weight value, adjust the face to be trained based on the cos ⁇ value of each face image to be trained and the corresponding first weight value.
  • the first weight value of each face image to be trained in the image set that is, in the face image set to be trained, the first weight value corresponding to the face image to be trained with a larger cos ⁇ value is adjusted to increase, and the cos ⁇ value is adjusted
  • the first weight value corresponding to the smaller face image to be trained is adjusted to be smaller; in order to improve the performance and recognition accuracy of the generated target face recognition model.
  • the cos ⁇ value of each face image to be trained in the face image set to be trained is determined; the following formula is used to calculate the first weight value of each face image to be trained:
  • w is the first weight value
  • cos ⁇ is the cos ⁇ value of the face image to be trained
  • ⁇ r is the maximum cos ⁇ value in the first target ⁇ distribution histogram
  • ⁇ l is the top peak on the left side of the first target ⁇ distribution histogram
  • adjust the first weight value of each face image to be trained in the face image set to be trained pass the cos ⁇ of each face image to be trained Value adjustment corresponding to the first weight value, the first weight value corresponding to the face image to be trained with a larger cos ⁇ value is adjusted to increase, and the first weight value corresponding to the face image to be trained with a smaller cos ⁇ value is adjusted
  • the adjustment becomes smaller; thereby improving the performance and recognition accuracy of the generated target face recognition model.
  • adjusting the first weight value of each face image to be trained in the face image set to be trained according to the first target ⁇ distribution histogram further specifically includes the following steps:
  • S404 Based on the first target ⁇ distribution histogram, determine the cos ⁇ value of each face image to be trained in the face image set to be trained.
  • the first target ⁇ distribution histogram is a histogram used to indicate the cos ⁇ value corresponding to each face image to be trained. Therefore, the cos ⁇ value of each face image to be trained in the face image set to be trained can be determined directly according to the histogram of the first target ⁇ distribution.
  • the cos ⁇ value corresponding to each face image to be trained is sorted from large to small; then, according to each person to be trained The cos ⁇ value of the face image is in the descending order, and each face image to be trained in the face image set to be trained is sorted by the first weight value. Understandably, in the face image set to be trained, a face image to be trained with a larger cos ⁇ value corresponds to a larger first weight value, and a face image to be trained with a smaller cos ⁇ value corresponds to the first weight The value is small.
  • the cos ⁇ value of each face image to be trained in the face image set to be trained is determined; according to the cos ⁇ value of each face image to be trained from large to small, Each face image to be trained in the face image set to be trained is sorted by the first weight value; in order to assign a larger first weight value to the face image to be trained with a larger cos ⁇ value; thus, the generated target person is improved The performance and recognition accuracy of the face recognition model.
  • adjusting the first weight value of each face image to be trained in the face image set to be trained according to the second target ⁇ distribution histogram specifically includes the following steps:
  • S321 Based on the second target ⁇ distribution histogram, determine the cos ⁇ value of each face image to be trained in the face image set to be trained.
  • the second target ⁇ distribution histogram is a histogram used to indicate the cos ⁇ value corresponding to each face image to be trained. Therefore, the cos ⁇ value of each face image to be trained in the face image set to be trained can be determined directly according to the histogram of the second target ⁇ distribution.
  • w is the first weight value
  • cos ⁇ is the cos ⁇ value of the face image to be trained
  • ⁇ r is the top peak on the right side of the second target ⁇ distribution histogram
  • the first weight value of each face image to be trained mainly depends on the size of cos ⁇ . Understandably, the first weight value of each face image to be trained in the face image set to be trained calculated according to the above formula and the corresponding cos ⁇ value are normally distributed.
  • each face image to be trained after determining the cos ⁇ value of each face image to be trained and the corresponding first weight value, adjust the face to be trained based on the cos ⁇ value of each face image to be trained and the corresponding first weight value.
  • the first weight value of each face image to be trained in the image set that is, the first weight value of the half-clean and half-noise sample in the face image set to be trained is adjusted to be larger, and the first weight value of the clean sample and the noise sample is adjusted to be smaller .
  • the cos ⁇ value of each face image to be trained in the face image set to be trained is determined; the following formula is used to calculate each face image to be trained
  • w is the first weight value
  • cos ⁇ is the cos ⁇ value of the face image to be trained
  • ⁇ r is the top peak on the right side of the second target ⁇ distribution histogram
  • a face recognition model training device is provided, and the face recognition model training device corresponds to the face recognition model training method in the above-mentioned embodiment in a one-to-one correspondence.
  • the face recognition model training device includes a sample face image set acquisition module 10, a training module 20, a first target ⁇ distribution histogram acquisition module 30, a first adjustment module 40, and target face recognition model generation Module 50.
  • the detailed description of each functional module is as follows:
  • the sample face image set acquisition module 10 is configured to acquire a sample face image set, and set the same first weight value for each sample face image in the sample face image set to obtain a face image set to be trained;
  • the training module 20 is configured to input each face image to be trained in the face image set to be trained into the neural network model for training;
  • the first target ⁇ distribution histogram obtaining module 30 is configured to obtain a first target ⁇ distribution histogram of the face image set to be trained after a first preset number of trainings, wherein the first target ⁇
  • the distribution histogram is the current ⁇ distribution histogram.
  • the abscissa is the cos ⁇ value
  • the ordinate is the number of samples, where ⁇ refers to the first weight value and each value in the loss function.
  • the first adjustment module 40 is configured to adjust the first weight value of each face image to be trained in the face image set to be trained according to the first target ⁇ distribution histogram, wherein each of the adjusted face values is The first weight value of the face image to be trained is positively correlated with the corresponding cos ⁇ value;
  • the target face recognition model generation module 50 is configured to return to performing the step of obtaining the first target ⁇ distribution histogram of the face image set to be trained after the first preset number of times of training, until the nerve The network model meets the preset termination conditions, and the target face recognition model is obtained.
  • the face recognition model training device further includes:
  • the second target ⁇ distribution histogram obtaining module 31 is configured to obtain a second target ⁇ distribution histogram of the face image set to be trained after a second preset number of trainings, wherein the second target ⁇
  • the distribution histogram is a ⁇ distribution histogram after training for a second preset number of times, and the second preset number of times is greater than the first preset number of times;
  • the second adjustment module 32 is configured to adjust the first weight value of each face image to be trained in the face image set to be trained according to the second target ⁇ distribution histogram, wherein each of the adjusted face values is The first weight value of a face image to be trained and the corresponding cos ⁇ value are normally distributed.
  • the first adjustment module 40 includes:
  • the first determining unit 401 is configured to determine the cos ⁇ value of each face image to be trained in the face image set to be trained based on the first target ⁇ distribution histogram;
  • the first calculation unit 402 is configured to calculate the first weight value of each face image to be trained using the following formula:
  • w is the first weight value
  • cos ⁇ is the cos ⁇ value of the face image to be trained
  • ⁇ r is the maximum cos ⁇ value in the first target ⁇ distribution histogram
  • ⁇ l is the top peak on the left side of the first target ⁇ distribution histogram
  • the first adjustment unit 403 is configured to adjust the value of each face image to be trained in the face image set to be trained based on the cos ⁇ value of each face image to be trained and the corresponding first weight value. The first weight value.
  • the first adjustment module 40 further includes:
  • a second determining unit configured to determine the cos ⁇ value of each face image to be trained in the face image set to be trained based on the first target ⁇ distribution histogram
  • the sorting unit is used for sorting each face image to be trained in the set of face images to be trained according to the first weight value according to the cos ⁇ value of each face image to be trained.
  • the second adjustment module 32 includes:
  • a third determining unit configured to determine the cos ⁇ value of each face image to be trained in the face image set to be trained based on the second target ⁇ distribution histogram
  • the second calculation unit is used to calculate the first weight value w of each face image to be trained using the following formula:
  • w is the first weight value
  • cos ⁇ is the cos ⁇ value of the face image to be trained
  • ⁇ r is the top peak on the right side of the second target ⁇ distribution histogram
  • the second adjustment unit is configured to adjust the first value of each face image to be trained in the face image set to be trained based on the cos ⁇ value of each face image to be trained and the corresponding first weight value. A weight value.
  • the various modules in the above-mentioned face recognition model training device can be implemented in whole or in part by software, hardware and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a server, and its internal structure diagram may be as shown in FIG. 10.
  • the computer equipment includes a processor, a memory, a network interface, and a database connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a readable storage medium and an internal memory.
  • the readable storage medium stores an operating system, computer readable instructions, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer readable instructions in the readable storage medium.
  • the database of the computer device is used to store the data used in the face recognition model training method of the foregoing embodiment.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer readable instructions are executed by the processor to realize a face recognition model training method.
  • the readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and running on the processor.
  • the processor executes the computer-readable instructions to implement the Facial recognition model training method.
  • one or more readable storage media storing computer readable instructions are provided.
  • the readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage. Medium; the readable storage medium stores computer readable instructions, and when the computer readable instructions are executed by one or more processors, the one or more processors implement the face recognition model training method in the foregoing embodiment.
  • Non-volatile memory may include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory may include random access memory (RAM) or external cache memory.
  • RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous chain Channel (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • General Physics & Mathematics (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computing Systems (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Computational Linguistics (AREA)
  • Molecular Biology (AREA)
  • Biophysics (AREA)
  • General Engineering & Computer Science (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Data Mining & Analysis (AREA)
  • Artificial Intelligence (AREA)
  • Multimedia (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)

Abstract

一种人脸识别模型训练方法、装置、计算机设备及存储介质,该方法对样本人脸图像集设置相同的第一权重值,得到待训练人脸图像集;将待训练人脸图像集输入至神经网络模型中进行训练;经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图;根据第一目标θ分布直方图调整待训练人脸图像集的第一权重值,调整后的每一待训练人脸图像的第一权重值与对应的cosθ值呈正相关;返回执行在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图的步骤,直至神经网络模型符合预设的终止条件,得到目标人脸识别模型,从而提高了生成的目标人脸识别模型的人脸识别精度。

Description

人脸识别模型训练方法、装置、计算机设备及存储介质
本申请以2020年03月16日提交的申请号为202010182264.9,名称为“人脸识别模型训练方法、装置、计算机设备及存储介质”的中国申请专利申请为基础,并要求其优先权。
技术领域
本申请涉及人工智能技术领域的智能决策领域,尤其涉及一种人脸识别模型训练方法、装置、计算机设备及存储介质。
背景技术
在图像处理领域,如何对样本集进行处理来训练准确率更高的图像模型一直都是研究的重点。样本集是其中的关键因素。目前传统的样本集处理方法大部分都是对样本数据集增强、修剪等,通过对图像样本进行翻转、折叠、加入人为噪声等来加大样本集的数量,或者是对样本数据进行标准化、正则化等。然而,发明人意识到,在人脸图像处理领域,采用传统的样本集处理方法依旧不可避免地会受到图像标签噪声的影响,给训练和模型带来许多负面效果,从而导致生成的人脸识别模型的识别精度较低、且泛化能力弱。
申请内容
本申请实施例提供一种人脸识别模型训练方法、装置、计算机设备及存储介质,以解决人脸识别的精度较低问题。
一种人脸识别模型训练方法,包括:
获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
一种人脸识别模型训练装置,包括:
样本人脸图像集获取模块,用于获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
训练模块,用于将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
第一目标θ分布直方图获取模块,用于在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量, 其中,θ用于反映每一待训练人脸图像为干净样本的概率;
第一调整模块,用于根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
目标人脸识别模型生成模块,用于返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
一个或多个存储有计算机可读指令的可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
上述人脸识别模型训练方法、装置、计算机设备及存储介质,通过获取样本人脸图像集,对样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;将待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图,其中,第一目标θ分布直方图为当前的θ分布直方图,在第一目标θ分布直方图中,横坐标为cosθ值,样本数量为纵坐标;根据第一目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,其中,调整后的每一待训练人脸图像的第一权重值与对应的所述cosθ值呈正相关;返回执行在经过第一预设次数的训练之后,获取待训练人脸图像 集的第一目标θ分布直方图的步骤,直至神经网络模型符合预设的终止条件,得到目标人脸识别模型;采用加权样本训练的方法,通过训练生成的θ分布直方图,调整每一样本人脸图像的权重值,然后再进行多次重复训练,样本人脸图像的θ分布反映了样本人脸图像为干净样本的概率,从而提高了生成的目标人脸识别模型的人脸识别精度。本申请的一个或多个实施例的细节在下面的附图和描述中提出,本申请的其他特征和优点将从说明书、附图以及权利要求变得明显。
附图说明
为了更清楚地说明本申请实施例的技术方案,下面将对本申请实施例的描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请一实施例中人脸识别模型训练方法的一应用环境示意图;
图2是本申请一实施例中人脸识别模型训练方法的一示例图;
图3是本申请一实施例中人脸识别模型训练方法的另一示例图;
图4是本申请一实施例中人脸识别模型训练方法的另一示例图;
图5是本申请一实施例中人脸识别模型训练方法的另一示例图;
图6是本申请一实施例中人脸识别模型训练方法的另一示例图;
图7是本申请一实施例中人脸识别模型训练装置的一原理框图;
图8是本申请一实施例中人脸识别模型训练装置的另一原理框图;
图9是本申请一实施例中人脸识别模型训练装置的另一原理框图;
图10是本申请一实施例中计算机设备的一示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请实施例提供的人脸识别模型训练方法,该人脸识别模型训练方法可应用如图1所示的应用环境中。具体地,该人脸识别模型训练方法应用在人脸识别模型训练系统中,该人脸识别模型训练系统包括如图1所示的客户端和服务端,客户端与服务端通过网络进行通信,用于解决人脸识别的精度较低问题。其中,客户端又称为用户端,是指与服务端相对应,为客户提供本地服务的程序。客户端可安装在但不限于各种个人计算机、笔记本电脑、智能手机、平板电脑和便携式可穿戴设备上。服务端可以用独立的服务器或者是多个服务器组成的服务器集群来实现。
在一实施例中,如图2所示,提供一种人脸识别模型训练方法,以该方法应用在图1中的服务端为例进行说明,包括如下步骤:
S10:获取样本人脸图像集,对样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集。
其中,样本人脸图像集指用于进行模型训练的人脸图像数据。可选地,获取样本人脸图像集可先通过预先采集人脸图片作为样本人脸图像集,或者直接从人脸库中获取人脸图片作为样本人脸图像集,例如AR人脸库。待训练人脸图像集指对样本人脸图像集中的每一样本人脸图像进行权重设置后的人脸图像数据。
具体地,获取样本人脸图像集,然后对样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,比如:将每一样本人脸图像的第一权重值都设置为1,从而得到待训练 人脸图像集。在一具体实施例中,由于在采用样本人脸图像集进行训练的开始过程中,神经网络模型还不具备很好的脸部识别能力,即未经训练的神经网络模型并不能很好地将样本人脸图像集中的干净样本和噪声样本区分开。因此,在本步骤中,先将样本人脸图像集中的每一样本人脸图像设置成相同的第一权重值。可以理解地,第一权重值可以为任意数值,只要保证样本人脸图像集中的每一样本人脸图像的第一权重值都相同即可。
S20:将待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练。
具体地,将待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练。优选地,在本实施例中采用的神经网络模型为CNN(ConvolutionalNeuralNetwork,卷积神经网络)。
在一具体实施例中,在将待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练的过程中,可利用神经网络对每一待训练人脸图像进行学习,即对每一训练人脸图像进行人脸特征提取,得到各待训练人脸图像的人脸特征。例如:待训练人脸图像的人脸特征可以为人脸五官的关键的特征点、线和面等,从而构成的人脸五官特征。
S30:在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图,其中,第一目标θ分布直方图为当前的θ分布直方图,在第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角。
其中,第一预设次数指预先设定的每一待训练人脸图像在神经网络模型中进行训练的次数。第一预设次数可以为一次、两次或者三次等任意次数。
具体地,将待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中,然后采用随机梯度下降算法SGD进行训练,在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图。其中,第一目标θ分布直方图为在经过第一次预设次数的训练之后,得到的当前的θ分布直方图。在第一目标θ分布直方图中,横坐标是cosθ值,纵坐标是样本数量。其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角。具体地,在本实施例中,损失函数优选为softmax损失函数。每一待训练人脸图像对应的特征点是指对每一训练人脸图像进行人脸特征提取后,得到的每一待训练人脸图像的人脸特征。可以理解地,第一目标θ分布直方图可用于表明待训练人脸图像集中每一待训练人脸图像所对应的cosθ值。每一待训练人脸图像的cosθ值分布反映了它们为干净样本的概率。
在一具体实施例中,经过第一预设次数的训练之后,在第一目标θ分布直方图中,cosθ值较大的待训练人脸图像会开始移动到右边;cosθ值较小的待训练人脸图像也会向右移动,但cosθ值较小的待训练人脸图像始终保持在第一目标θ分布直方图的左侧。在本实施例中,由于卷积神经网络CNN倾向于快速地识别容易的、干净的样本,并且最终还可以识别困难的、带噪声的样本,因此,cosθ值较大的待训练人脸图像有较高的可能性为干净样本。
其中,随机梯度下降算法SGD是指从待训练人脸图像集随机选择一个待训练人脸图像集来进行学习的算法,即:
Figure PCTCN2020093330-appb-000001
由于随机梯度下降算法SGD每次只随机选择一个样本来更新模型参数,因此每次的学习是非常快速的,并且可以进行在线更新。可以理解地,基于随机梯度下降算法SGD的性质,待训练人脸图像集的每一待训练人脸图像所对应的类别权重都会进行更新,然后利用每一训练更新后的类别权重去计算训练人脸图像集中每一待训练人脸图像的cosθ值,从而得到训练人脸图像集中每一待训练人脸图像的cosθ值。
S40:根据第一目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,其中,调整后的每一待训练人脸图像的第一权重值与对应的所述cosθ值呈正 相关。
具体地,在确定了第一目标θ分布直方图之后,根据第一目标θ分布直方图确定待训练人脸图像集中每一待训练人脸图像的cosθ值,然后根据每一待训练人脸图像的cosθ值,调整每一待训练人脸图像的第一权重值。在本步骤中,对于cosθ值较大的待训练人脸图像赋予较大的第一权重值,对于cosθ值较小的待训练人脸图像赋予较小的第一权重值。即对应干净样本设置较大的第一权重值,对应噪声样本设置较小的第一权重值。可以理解地,调整后的每一待训练人脸图像的第一权重值与对应的cosθ值呈正相关。
S50:返回执行在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图的步骤,直至神经网络模型符合预设的终止条件,得到目标人脸识别模型。
具体地,为了进一步提高生成的目标人脸识别模型的识别精度,返回执行在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图的步骤,直至神经网络模型符合预设的终止条件,得到目标人脸识别模型。
其中,目标人脸识别模型指经过训练后得到的可对人脸图像进行较高精准度识别的模型。其中,预设的终止条件是指预先设定的神经网络模型终止训练的条件。可选地,终止条件可以为神经网络模型的训练次数达到预设的次数阈值;也可以为神经网络模型的精度值达到预设的精度阈值,即神经网络模型的输出值与目标值之间的误差达到预设的精度阈值。
在一具体实施例中,在进行模型训练之前,可预先根据预设的终止条件对神经网络模型中对应的参数值进行修改,从而保证在训练的过程中,当神经网络模型符合预设的终止条件时,自动收敛结束训练,从而得到目标人脸识别模型。
在本实施例中,通过获取样本人脸图像集,对样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;将待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图,其中,第一目标θ分布直方图为当前的θ分布直方图,在第一目标θ分布直方图中,横坐标为cosθ值,样本数量为纵坐标;根据第一目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,其中,调整后的每一待训练人脸图像的第一权重值与对应的所述cosθ值呈正相关;返回执行在经过第一预设次数的训练之后,获取待训练人脸图像集的第一目标θ分布直方图的步骤,直至神经网络模型符合预设的终止条件,得到目标人脸识别模型;采用加权样本训练的方法,通过训练生成的θ分布直方图,调整每一样本人脸图像的权重值,然后再进行多次重复训练,样本人脸图像的θ分布反映了样本人脸图像为干净样本的概率,从而提高了生成的目标人脸识别模型的人脸识别精度。
在一实施例中,如图3所示,在根据第一目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值之后,该人脸识别模型训练方法,还具体包括如下步骤:
S31:在经过第二预设次数的训练之后,获取待训练人脸图像集的第二目标θ分布直方图,其中,第二目标θ分布直方图为在经过第二预设次数的训练之后的θ分布直方图,第二预设次数大于第一预设次数。
其中,第二预设次数指预先设定的每一待训练人脸图像在神经网络模型进行训练的次数。第二预设次数可以为一次、两次或者三次等任意次数。需要说明的是,为了保证二次训练后人脸识别模型的精度值,第二预设次数大于第一预设次数。
具体地,在经过第二预设次数的训练之后,获取待训练人脸图像集的第二目标θ分布直方图,其中,第二目标θ分布直方图为在经过第二次预设次数的训练之后,得到的当前的θ分布直方图。同样地,在第二目标θ分布直方图中,横坐标是cosθ值,纵坐标是样本数量。第二目标θ分布直方图可用于表明待训练人脸图像集中每一待训练人脸图像所对 应的cosθ值。每一待训练人脸图像的cosθ值分布反映了它们为干净样本的概率。
在一具体实施例中,在经过第二预设次数的训练之后,神经网络模型已经具备较良好的性能,在第二目标θ分布直方图中,干净样本和噪声样本之间会存在面积很小的重叠区域,重叠区域为半干净半噪声样本。
S32:根据第二目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,其中,调整后的每一待训练人脸图像的第一权重值与对应的cosθ值呈正态分布。
具体地,在确定了第二目标θ分布直方图,根据第二目标θ分布直方图确定待训练人脸图像集中每一待训练人脸图像的cosθ值,然后根据每一待训练人脸图像的cosθ值,调整每一待训练人脸图像的第一权重值。在本实施例中,可以根据第二目标θ分布直方图中每一待训练人脸图像的cosθ值,准确地区分干净样本、半干净半噪声样本以及噪声样本。由于干净样本和噪声样本在第二目标θ分布直方图的重叠区域面积很小,因此半干净半噪声样本的数量也很少。
为了进一步提高人脸识别模型的识别精度,在本步骤中,加大半干净半噪声样本的第一权重值,即把位于第二目标θ分布直方图中重叠区域的半干净半噪声样本的权重设置得比干净样本和噪声样本都大,即调整后的每一待训练人脸图像的第一权重值与对应的cosθ值呈正正态分布,从而使得卷积神经网络的训练更有针对性。
在本实施例中,在经过第二预设次数的训练之后,获取待训练人脸图像集的第二目标θ分布直方图,其中,第二目标θ分布直方图为当前的θ分布直方图,第二预设次数大于第一预设次数;根据第二目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,其中,调整后的每一待训练人脸图像的第一权重值与对应的cosθ值呈正态分布;通过第二目标θ分布直方图进一步调整每一待训练人脸图像的第一权重值,从而使得神经网络模型的训练更有针对性,以进一步提高了生成的目标人脸识别模型的人脸识别精度。
在一实施例中,如图4所示,根据第一目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,具体包括如下步骤:
S401:基于第一目标θ分布直方图,确定待训练人脸图像集中每一待训练人脸图像的cosθ值。
具体地,由于第一目标θ分布直方图可表明每一待训练人脸图像所对应的cosθ值。因此,在本步骤中,可直接根据第一目标θ分布直方图,确定待训练人脸图像集中每一待训练人脸图像的cosθ值。例如:若待训练人脸图像集包括100个待训练人脸图像为S={s 1,s 2,s 3,s 4...s 100},第一基于目标θ分布直方图,得到待训练人脸图像s 1-s 30所对应的cosθ值为0.2-0.4,待训练人脸图像s 31-s 60所对应的cosθ值为0.4-0.6,待训练人脸图像s 61-s 100所对应的cosθ值为0.6-0.8。
S402:采用如下公式计算每一待训练人脸图像的第一权重值:
Figure PCTCN2020093330-appb-000002
softplus(x)=log(1+e x);
其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δ r是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值。
其中,softplus为平滑版的relu函数,当softplus(x)中x的绝对值足够大时,会出现饱和现象,即函数图像会变得很平,从而对输入的微小改变会变成不敏感。具体地,由上述公式可知第一权重值w的大小由softplus(λz)与softplus(λ)的比值决定,而在本实施例中,λ为预先设定的固定值,例如:预先设定λ为10。z的大小由cosθ、μl和δ r决定,μl为第一目标θ分布直方图中左边的顶峰值,δ r为第一目标θ分布直方图中最大的cosθ值;即当训练完成生成第一目标θ分布直方图之后,μl和δ r也可以直接 从第一目标θ分布直方图中确定得到。如此可知,每一待训练人脸图像的第一权重值w的大小主要取决于cosθ的大小,当cosθ较大时,所对应输出的第一权重值w也会变大。
S403:基于每一待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值。
具体地,在确定了每一待训练人脸图像的cosθ值和对应的第一权重值之后,再基于每一待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值,即在待训练人脸图像集中,将cosθ值较大的待训练人脸图像所对应的第一权重值调整变大,以及将cosθ值较小的待训练人脸图像所对应的第一权重值调整变小;以提高生成的目标人脸识别模型的性能和识别精度。
在本实施例中,基于第一目标θ分布直方图,确定待训练人脸图像集中每一待训练人脸图像的cosθ值;采用如下公式计算每一待训练人脸图像的第一权重值:
Figure PCTCN2020093330-appb-000003
softplus(x)=log(1+e x);
其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δ r是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值;基于每一待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值;通过每一待训练人脸图像的cosθ值调整对应的第一权重值,将cosθ值较大的待训练人脸图像所对应的第一权重值调整变大,以及将cosθ值较小的待训练人脸图像所对应的第一权重值调整变小;从而提高了生成的目标人脸识别模型的性能和识别精度。
在一实施例中,如图5所示,根据第一目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,还具体包括如下步骤:
S404:基于第一目标θ分布直方图,确定待训练人脸图像集中每一待训练人脸图像的cosθ值。
具体地,由于第一目标θ分布直方图为用于表明每一待训练人脸图像所对应的cosθ值的直方图。因此,可直接根据第一目标θ分布直方图,确定待训练人脸图像集中每一待训练人脸图像的cosθ值。
S405:根据每一待训练人脸图像的cosθ值的从大到小,对待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。
具体地,在确定了每一待训练人脸图像所对应的cosθ值之后,将每一待训练人脸图像所对应的cosθ值按照从大到小进行排序;然后,再根据每一待训练人脸图像的cosθ值的从大到小顺序,对待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。可以理解地,在待训练人脸图像集中,cosθ值较大的待训练人脸图像,所对应的第一权重值较大,cosθ值较小的待训练人脸图像,所对应的第一权重值较小。
在本实施例中,基于第一目标θ分布直方图,确定待训练人脸图像集中每一待训练人脸图像的cosθ值;根据每一待训练人脸图像的cosθ值的从大到小,对待训练人脸图像集中每一待训练人脸图像进行第一权重值排序;以便于给cosθ值较大的待训练人脸图像分配对应较大的第一权重值;从而提高了生成的目标人脸识别模型的性能和识别精度。
在一实施例中,如图5所示,根据第二目标θ分布直方图调整待训练人脸图像集中每一待训练人脸图像的第一权重值,具体包括如下步骤:
S321:基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值。
具体地,由于第二目标θ分布直方图为用于表明每一待训练人脸图像所对应的cosθ值的直方图。因此,可直接根据第二目标θ分布直方图,确定待训练人脸图像集中每一待 训练人脸图像的cosθ值。
S322:采用如下公式计算每一所述待训练人脸图像的第一权重值w:
Figure PCTCN2020093330-appb-000004
其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μ r是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576。
具体地,由上述公式可知每一待训练人脸图像的第一权重值w主要由cosθ、μr和σ 2决定,μr为第二目标θ分布直方图中右边的顶峰值;σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δr-μr)/2.576,即在训练完成生成第二目标θ分布直方图之后,μr和σ 2可直接从第二目标θ分布直方图中确定。如此可知,每一待训练人脸图像的第一权重值主要取决于cosθ的大小。可以理解地,根据上述公式计算得到的待训练人脸图像集中每一待训练人脸图像的第一权重值与对应的cosθ值呈正正态分布。
S323:基于每一待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值。
具体地,在确定了每一待训练人脸图像的cosθ值和对应的第一权重值之后,再基于每一待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值;即将待训练人脸图像集中半干净半噪声样本的第一权重值调整变大,将干净样本和噪声样本的第一权重值调整变小。
在本实施例中,基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;采用如下公式计算每一所述待训练人脸图像的第一权重值w:
Figure PCTCN2020093330-appb-000005
其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μ r是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576;基于每一待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值;基于每一所述待训练人脸图像的cosθ值和对应的第一权重值,调整待训练人脸图像集中每一待训练人脸图像的第一权重值;使得卷积神经网络的训练更有针对性;从而进一步提高模型的识别精度。
应理解,上述实施例中各步骤的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。
在一实施例中,提供一种人脸识别模型训练装置,该人脸识别模型训练装置与上述实施例中人脸识别模型训练方法一一对应。如图7所示,该人脸识别模型训练装置包括样本人脸图像集获取模块10、训练模块20、第一目标θ分布直方图获取模块30、第一调整模块40和目标人脸识别模型生成模块50。各功能模块详细说明如下:
样本人脸图像集获取模块10,用于获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
训练模块20,用于将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络 模型中进行训练;
第一目标θ分布直方图获取模块30,用于在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
第一调整模块40,用于根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
目标人脸识别模型生成模块50,用于返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
优选地,如图8所示,所述人脸识别模型训练装置还包括:
第二目标θ分布直方图获取模块31,用于在经过第二预设次数的训练之后,获取所述待训练人脸图像集的第二目标θ分布直方图,其中,所述第二目标θ分布直方图为在经过第二预设次数的训练之后的θ分布直方图,所述第二预设次数大于所述第一预设次数;
第二调整模块32,用于根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正态分布。
优选地,如图9所示,所述第一调整模块40包括,
第一确定单元401,用于基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
第一计算单元402,用于采用如下公式计算每一所述待训练人脸图像的第一权重值:
Figure PCTCN2020093330-appb-000006
Figure PCTCN2020093330-appb-000007
softplus(x)=log(1+e x);
其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δr是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值;
第一调整单元403,用于基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
优选地,所述第一调整模块40,还包括,
第二确定单元,用于基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
排序单元,用于根据每一所述待训练人脸图像的cosθ值的从大到小,对所述待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。
优选地,所述第二调整模块32包括:
第三确定单元,用于基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
第二计算单元,用于采用如下公式计算每一所述待训练人脸图像的第一权重值w:
Figure PCTCN2020093330-appb-000008
其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μr是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576;
第二调整单元,用于基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
关于人脸识别模型训练装置的具体限定可以参见上文中对于人脸识别模型训练方法的限定,在此不再赘述。上述人脸识别模型训练装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
在一个实施例中,提供了一种计算机设备,该计算机设备可以是服务器,其内部结构图可以如图10所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括可读存储介质、内存储器。该可读存储介质存储有操作系统、计算机可读指令和数据库。该内存储器为可读存储介质中的操作系统和计算机可读指令的运行提供环境。该计算机设备的数据库用于存储上述实施例人脸识别模型训练方法中使用到的数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机可读指令被处理器执行时以实现一种人脸识别模型训练方法。本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质。
在一个实施例中,提供了一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,处理器执行计算机可读指令时实现上述实施例中的人脸识别模型训练方法。
在一个实施例中,提供了一个或多个存储有计算机可读指令的可读存储介质,本实施例所提供的可读存储介质包括非易失性可读存储介质和易失性可读存储介质;该可读存储介质上存储有计算机可读指令,该计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现上述实施例中的人脸识别模型训练方法。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质或易失性可读存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,仅以上述各功能单元、模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能单元、模块完成,即将所述装置的内部结构划分成不同的功能单元或模块,以完成以上 描述的全部或者部分功能。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种人脸识别模型训练方法,其中,包括:
    获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
    将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
    在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
    根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
    返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
  2. 如权利要求1所述的人脸识别模型训练方法,其中,在所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值之后,所述人脸识别模型训练方法还包括:
    在经过第二预设次数的训练之后,获取所述待训练人脸图像集的第二目标θ分布直方图,其中,所述第二目标θ分布直方图为在经过第二预设次数的训练之后的θ分布直方图,所述第二预设次数大于所述第一预设次数;
    根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正态分布。
  3. 如权利要求1所述的人脸识别模型训练方法,其中,所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,包括:
    基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    采用如下公式计算每一所述待训练人脸图像的第一权重值:
    Figure PCTCN2020093330-appb-100001
    Figure PCTCN2020093330-appb-100002
    softplus(x)=log(1+e x);
    其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δ r是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值;
    基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  4. 如权利要求1所述的人脸识别模型训练方法,其中,所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,还包括:
    基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像 的cosθ值;
    根据每一所述待训练人脸图像的cosθ值的从大到小,对所述待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。
  5. 如权利要求2所述的人脸识别模型训练方法,其中,所述根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,包括:
    基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    采用如下公式计算每一所述待训练人脸图像的第一权重值w:
    Figure PCTCN2020093330-appb-100003
    其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μ r是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576;
    基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  6. 一种人脸识别模型训练装置,其中,包括:
    样本人脸图像集获取模块,用于获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
    训练模块,用于将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
    第一目标θ分布直方图获取模块,用于在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
    第一调整模块,用于根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
    目标人脸识别模型生成模块,用于返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
  7. 如权利要求6所述的人脸识别模型训练装置,其中,所述人脸识别模型训练装置还包括:
    第二目标θ分布直方图获取模块,用于在经过第二预设次数的训练之后,获取所述待训练人脸图像集的第二目标θ分布直方图,其中,所述第二目标θ分布直方图为在经过第二预设次数的训练之后的θ分布直方图,所述第二预设次数大于所述第一预设次数;
    第二调整模块,用于根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正态分布。
  8. 如权利要求6所述的人脸识别模型训练装置,其中,所述第一调整模块包括,
    第一确定单元,用于基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    第一计算单元,用于采用如下公式计算每一所述待训练人脸图像的第一权重值:
    Figure PCTCN2020093330-appb-100004
    Figure PCTCN2020093330-appb-100005
    softplus(x)=log(1+e x);
    其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δ r是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值;
    第一调整单元,用于基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  9. 如权利要求6所述的人脸识别模型训练装置,其中,所述第一调整模块,还包括,
    第二确定单元,用于基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    排序单元,用于根据每一所述待训练人脸图像的cosθ值的从大到小,对所述待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。
  10. 如权利要求7所述的人脸识别模型训练装置,其中,所述第二调整模块包括:
    第三确定单元,用于基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    第二计算单元,用于采用如下公式计算每一所述待训练人脸图像的第一权重值w:
    Figure PCTCN2020093330-appb-100006
    其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μr是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576;
    第二调整单元,用于基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  11. 一种计算机设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机可读指令,其中,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
    将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
    在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
    根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
    返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
  12. 如权利要求11所述的计算机设备,其中,在所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值之后,所述处理器执行所述计算机可读指令时还实现如下步骤:
    在经过第二预设次数的训练之后,获取所述待训练人脸图像集的第二目标θ分布直方图,其中,所述第二目标θ分布直方图为在经过第二预设次数的训练之后的θ分布直方图,所述第二预设次数大于所述第一预设次数;
    根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正态分布。
  13. 如权利要求11所述的计算机设备,其中,所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,包括:
    基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    采用如下公式计算每一所述待训练人脸图像的第一权重值:
    Figure PCTCN2020093330-appb-100007
    Figure PCTCN2020093330-appb-100008
    softplus(x)=log(1+e x);
    其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δ r是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值;
    基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  14. 如权利要求11所述的计算机设备,其中,所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,还包括:
    基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    根据每一所述待训练人脸图像的cosθ值的从大到小,对所述待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。
  15. 如权利要求12所述的计算机设备,其中,所述根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,包括:
    基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    采用如下公式计算每一所述待训练人脸图像的第一权重值w:
    Figure PCTCN2020093330-appb-100009
    其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μ r是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576;
    基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  16. 一个或多个存储有计算机可读指令的可读存储介质,其中,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行如下步骤:
    获取样本人脸图像集,对所述样本人脸图像集中的每一样本人脸图像设置相同的第一权重值,得到待训练人脸图像集;
    将所述待训练人脸图像集中的每一待训练人脸图像输入至神经网络模型中进行训练;
    在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图,其中,所述第一目标θ分布直方图为当前的θ分布直方图,在所述第一目标θ分布直方图中,横坐标为cosθ值,纵坐标为样本数量,其中,θ是指在损失函数中第一权重值和每一待训练人脸图像对应的特征点之间的夹角;
    根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正相关;
    返回执行所述在经过第一预设次数的训练之后,获取所述待训练人脸图像集的第一目标θ分布直方图的步骤,直至所述神经网络模型符合预设的终止条件,得到目标人脸识别模型。
  17. 如权利要求16所述的可读存储介质,其中,在所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值之后,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器还执行如下步骤:
    在经过第二预设次数的训练之后,获取所述待训练人脸图像集的第二目标θ分布直方图,其中,所述第二目标θ分布直方图为在经过第二预设次数的训练之后的θ分布直方图,所述第二预设次数大于所述第一预设次数;
    根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,其中,所述调整后的每一待训练人脸图像的所述第一权重值与对应的所述cosθ值呈正态分布。
  18. 如权利要求16所述的可读存储介质,其中,所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,包括:
    基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    采用如下公式计算每一所述待训练人脸图像的第一权重值:
    Figure PCTCN2020093330-appb-100010
    Figure PCTCN2020093330-appb-100011
    softplus(x)=log(1+e x);
    其中,w为第一权重值;cosθ为待训练人脸图像的cosθ值;δ r是第一目标θ分布直方图中最大的cosθ值,μl是第一目标θ分布直方图中左边的顶峰值;
    基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
  19. 如权利要求16所述的可读存储介质,其中,所述根据所述第一目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,还包括:
    基于所述第一目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    根据每一所述待训练人脸图像的cosθ值的从大到小,对所述待训练人脸图像集中每一待训练人脸图像进行第一权重值排序。
  20. 如权利要求17所述的可读存储介质,其中,所述根据所述第二目标θ分布直方图调整所述待训练人脸图像集中每一待训练人脸图像的所述第一权重值,包括:
    基于所述第二目标θ分布直方图,确定所述待训练人脸图像集中每一待训练人脸图像的cosθ值;
    采用如下公式计算每一所述待训练人脸图像的第一权重值w:
    Figure PCTCN2020093330-appb-100012
    其中,w为第一权重值,cosθ为待训练人脸图像的cosθ值,μ r是第二目标θ分布直方图中右边的顶峰值,σ 2为第二目标θ分布直方图中干净样本的方差,σ=(δ rr)/2.576;
    基于每一所述待训练人脸图像的所述cosθ值和对应的所述第一权重值,调整所述待训练人脸图像集中每一待训练人脸图像的第一权重值。
PCT/CN2020/093330 2020-03-16 2020-05-29 人脸识别模型训练方法、装置、计算机设备及存储介质 Ceased WO2021184553A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010182264.9A CN111507188B (zh) 2020-03-16 2020-03-16 人脸识别模型训练方法、装置、计算机设备及存储介质
CN202010182264.9 2020-03-16

Publications (1)

Publication Number Publication Date
WO2021184553A1 true WO2021184553A1 (zh) 2021-09-23

Family

ID=71874505

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093330 Ceased WO2021184553A1 (zh) 2020-03-16 2020-05-29 人脸识别模型训练方法、装置、计算机设备及存储介质

Country Status (2)

Country Link
CN (1) CN111507188B (zh)
WO (1) WO2021184553A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120705516A (zh) * 2025-08-21 2025-09-26 茌平信发铝制品有限公司 一种轮毂加工误差补偿方法及系统

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116092269B (zh) * 2023-01-10 2025-01-17 广西新发展交通集团有限公司 一种隧道工程岩体灾害预警方法、装置及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090433A (zh) * 2017-12-12 2018-05-29 厦门集微科技有限公司 人脸识别方法及装置、存储介质、处理器
CN108197574A (zh) * 2018-01-04 2018-06-22 张永刚 人物风格识别方法、终端及计算机可读存储介质
CN109002790A (zh) * 2018-07-11 2018-12-14 广州视源电子科技股份有限公司 一种人脸识别的方法、装置、设备和存储介质
CN110245550A (zh) * 2019-04-22 2019-09-17 北京云识图信息技术有限公司 一种基于总体余弦分布的人脸噪音数据集cnn训练方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108520220B (zh) * 2018-03-30 2021-07-09 百度在线网络技术(北京)有限公司 模型生成方法和装置
CN109815801A (zh) * 2018-12-18 2019-05-28 北京英索科技发展有限公司 基于深度学习的人脸识别方法及装置
CN110705489B (zh) * 2019-10-09 2022-07-26 北京迈格威科技有限公司 目标识别网络的训练方法、装置、计算机设备和存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090433A (zh) * 2017-12-12 2018-05-29 厦门集微科技有限公司 人脸识别方法及装置、存储介质、处理器
CN108197574A (zh) * 2018-01-04 2018-06-22 张永刚 人物风格识别方法、终端及计算机可读存储介质
CN109002790A (zh) * 2018-07-11 2018-12-14 广州视源电子科技股份有限公司 一种人脸识别的方法、装置、设备和存储介质
CN110245550A (zh) * 2019-04-22 2019-09-17 北京云识图信息技术有限公司 一种基于总体余弦分布的人脸噪音数据集cnn训练方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120705516A (zh) * 2025-08-21 2025-09-26 茌平信发铝制品有限公司 一种轮毂加工误差补偿方法及系统

Also Published As

Publication number Publication date
CN111507188B (zh) 2024-07-16
CN111507188A (zh) 2020-08-07

Similar Documents

Publication Publication Date Title
JP7376731B2 (ja) 画像認識モデル生成方法、装置、コンピュータ機器及び記憶媒体
WO2021184902A1 (zh) 图像分类方法、装置、及其训练方法、装置、设备、介质
US20210035304A1 (en) Training method for image semantic segmentation model and server
CN111091075B (zh) 人脸识别方法、装置、电子设备及存储介质
WO2020232877A1 (zh) 一种问题答案选取方法、装置、计算机设备及存储介质
WO2020237869A1 (zh) 一种问题意图识别方法、装置、计算机设备及存储介质
CN111832581A (zh) 肺部特征识别方法、装置、计算机设备及存储介质
WO2021082426A1 (zh) 人脸聚类方法、装置、计算机设备及存储介质
CN111950329A (zh) 目标检测及模型训练方法、装置、计算机设备和存储介质
WO2019228317A1 (zh) 人脸识别方法、装置及计算机可读介质
WO2020119419A1 (zh) 基于图像识别的测试方法、装置、计算机设备及存储介质
WO2020215560A1 (zh) 自编码神经网络处理方法、装置、计算机设备及存储介质
WO2021159748A1 (zh) 模型压缩方法、装置、计算机设备及存储介质
CN112329843B (zh) 基于决策树的呼叫数据处理方法、装置、设备及存储介质
WO2022134805A1 (zh) 文档分类预测方法、装置、计算机设备及存储介质
WO2020151310A1 (zh) 文本生成方法、装置、计算机设备及介质
CN110197107B (zh) 微表情识别方法、装置、计算机设备及存储介质
US20200082213A1 (en) Sample processing method and device
CN111598213A (zh) 网络训练方法、数据识别方法、装置、设备和介质
WO2022147910A1 (zh) 病历信息校验方法、装置、计算机设备及存储介质
WO2022134354A1 (zh) 车损检测模型训练、车损检测方法、装置、设备及介质
WO2021135063A1 (zh) 病理数据分析方法、装置、设备及存储介质
WO2021190046A1 (zh) 手势识别模型的训练方法、手势识别方法及装置
WO2020199498A1 (zh) 指静脉比对方法、装置、计算机设备及存储介质
CN114626524A (zh) 目标业务网络确定方法、业务处理方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20925497

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20925497

Country of ref document: EP

Kind code of ref document: A1