WO2020147408A1 - 一种人脸识别模型的评价方法、装置、存储介质及计算机设备 - Google Patents

一种人脸识别模型的评价方法、装置、存储介质及计算机设备 Download PDF

Info

Publication number
WO2020147408A1
WO2020147408A1 PCT/CN2019/118257 CN2019118257W WO2020147408A1 WO 2020147408 A1 WO2020147408 A1 WO 2020147408A1 CN 2019118257 W CN2019118257 W CN 2019118257W WO 2020147408 A1 WO2020147408 A1 WO 2020147408A1
Authority
WO
WIPO (PCT)
Prior art keywords
similarity
base
test
negative
photo
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/CN2019/118257
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 WO2020147408A1 publication Critical patent/WO2020147408A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Definitions

  • This application relates to the field of artificial intelligence technology, and in particular to an evaluation method, device, storage medium and computer equipment of a face recognition model.
  • the face recognition model is used in scenes such as staff and examinees that need to record attendance.
  • the face is used as a medium to identify attendants, and it is widely used.
  • An excellent face recognition model should have high recognition accuracy.
  • the face recognition model cannot be evaluated based on the recognition accuracy.
  • the embodiments of the present application provide an evaluation method, device, storage medium, and computer equipment for a face recognition model to solve the problem that the prior art cannot evaluate the face recognition model based on the recognition accuracy.
  • an embodiment of the present application provides a method for evaluating a face recognition model.
  • the method includes: constructing n positive test samples, each of the n positive test samples includes a live photo and a The basemap, and the live photos and basemaps included in the same positive test sample correspond to the same user.
  • the basemaps are images stored in the basemap library.
  • the basemap library stores n basemaps, and each basemap corresponds to the same user.
  • a user has a corresponding relationship, n is a natural number greater than 1; construct n negative test samples, each of the n negative test samples includes a field photo and a base map, and the same negative test sample includes The live photos and the base map correspond to different users; the n negative test samples are input into the face recognition model; the feature vectors corresponding to the live photos and the base map output from the face recognition model are received, and the The cosine similarity between the feature vector corresponding to the live photo and the feature vector corresponding to the base image is described, and the live photo and base image of each of the n negative test samples are determined according to the calculated cosine similarity Sort the n test negative samples according to the similarity between the field photos and the base map of each test negative sample in the n test negative samples to obtain the sorting result; obtain the preset error Recognition rate; determine the target similarity according to the preset false recognition rate and the ranking result; calculate the pass rate of the n positive test samples according to the target similarity; according to the pass rate of the n positive test
  • an embodiment of the present application provides an evaluation device for a face recognition model.
  • the device includes: a first construction unit configured to construct n test positive samples, each of the n test positive samples being tested positive
  • the sample includes a live photo and a basemap, and the live photo and basemap included in the same positive test sample correspond to the same user.
  • the basemap is an image stored in a basemap library, and n basemaps are stored in the basemap library.
  • each base map has a corresponding relationship with a user, n is a natural number greater than 1;
  • the second construction unit is used to construct n negative test samples, each of the n negative test samples includes a site A photo and a base map, and the site photos and the base map included in the same negative test sample correspond to different users;
  • the first determination unit uses After receiving the feature vector corresponding to the live photo and the feature vector corresponding to the base image output by the face recognition model, the cosine similarity between the feature vector corresponding to the live photo and the feature vector corresponding to the base image is calculated, according to The calculated cosine similarity determines the similarity between the scene photos and the base image of each test negative sample in the n test negative samples;
  • the sorting unit is used to determine the similarity between each test negative sample in the n test negative samples.
  • an embodiment of the present application provides a storage medium, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the aforementioned facial recognition model evaluation method.
  • an embodiment of the present application provides a computer device, including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and the program instructions are executed by the processor.
  • the steps of the above-mentioned face recognition model evaluation method are realized.
  • the negative test sample is input into the face recognition model, the feature vector corresponding to the live photo and the feature vector corresponding to the base image output by the face recognition model are received, and the feature vector corresponding to the live photo and the base image are calculated.
  • the cosine similarity between the feature vectors is calculated based on the calculated cosine similarity to determine the similarity between the field photos and the base image of each test negative sample; the n test negatives are negative based on the similarity between the field photos and the base image
  • the samples are sorted to obtain the sorting result, and the target similarity is determined according to the preset false recognition rate and the sorting result; the pass rate of n test positive samples is calculated according to the target similarity; the face recognition model is generated according to the pass rate of n test positive samples
  • the evaluation result is used to evaluate the recognition accuracy of the face recognition model, which solves the technical problem that the existing technology cannot evaluate the face recognition model based on the recognition accuracy, and achieves the evaluation of the face recognition based on the recognition accuracy The technical effect of the model.
  • FIG. 1 is a flowchart of an optional evaluation method of a face recognition model provided by an embodiment of the present application
  • FIG. 2 is a schematic diagram of an optional evaluation device for a face recognition model provided by an embodiment of the present application
  • Fig. 3 is a schematic diagram of an optional computer device provided by an embodiment of the present application.
  • Fig. 1 is a flowchart of an optional evaluation method for a face recognition model provided by an embodiment of the present application. As shown in Fig. 1, the method includes the following steps:
  • Step S102 construct n positive test samples, each of the n positive test samples includes a site photo and a base map, and the site photos and base maps included in the same test positive sample correspond to the same user.
  • the picture is an image stored in a basemap library.
  • the basemap library stores n basemaps, and each basemap has a corresponding relationship with a user, and n is a natural number greater than 1.
  • Step S104 constructing n negative test samples, each of the n negative test samples includes a site photo and a base map, and the site photos and base maps included in the same test negative sample correspond to different users.
  • Step S106 Input n test negative samples into the face recognition model.
  • Step S108 Receive the feature vector corresponding to the live photo and the feature vector corresponding to the base image output by the face recognition model, calculate the cosine similarity between the feature vector corresponding to the live photo and the feature vector corresponding to the base image, and calculate the cosine based on the calculated cosine The similarity determines the similarity between the scene photos and the base map of each negative test sample in the n negative test samples.
  • step S110 the n negative test samples are sorted according to the similarity between the field photos and the base map of each negative test sample in the n negative test samples to obtain a sorting result.
  • Step S112 Obtain a preset false recognition rate.
  • Step S114 Determine the target similarity according to the preset false recognition rate and the ranking result.
  • Step S116 Calculate the pass rates of n test positive samples according to the target similarity.
  • step S118 an evaluation result of the face recognition model is generated according to the pass rates of the n positive test samples, and the evaluation result is used to evaluate the recognition accuracy of the face recognition model.
  • Step S120 Output the evaluation result of the face recognition model.
  • the camera When employees, candidates, etc. need to enter the workplace or examination room, the camera will take a picture of them in front of the camera.
  • the picture In the embodiment of this application, the picture is represented by a live photo.
  • the pictures in the base gallery are pre-collected.
  • the basemap library stores 10,000 basemaps.
  • the basemaps are collected in advance, and each basemap has a one-to-one correspondence with a user.
  • the front face photo of user 0890 is collected in advance to obtain user 0890.
  • the base map has a one-to-one correspondence with the 0890 user.
  • There are 10,000 positive test samples which are test positive sample S1, test positive sample S2,..., test positive sample S10000.
  • a positive test sample includes a field photo and a base map corresponding to the same user.
  • the test positive sample Si includes a field photo of user i and a base map of user i.
  • the test positive sample S0055 includes user 0055.
  • the test positive sample S0036 includes a live photo of user 0036 and a base map of user 0036.
  • a negative test sample includes a site photo and a base map, and the site photo and the base map correspond to different users.
  • the test negative sample S0055 includes a site photo and a base map.
  • the site photo is the site of user 0055.
  • Photo and the base map is not the base map of user 0055.
  • the negative test sample S0036 includes a site photo and a base map.
  • the site photo is the site photo of user 0036, and the base map is not the base map of user 0036.
  • the recognition accuracy of the face recognition model generally cannot reach 100%, some misrecognition situations will occur, for example, the scene photos and base maps of the same person cannot be recognized, or the scene photos and base maps of different people are recognized For the same person.
  • the reasons for misrecognition may be various.
  • the posture of the collected live photo is a profile posture, the user wears glasses in the live photo but the user does not wear glasses in the bottom photo, etc., the live photo and the light in the bottom photo Circumstances will also affect the recognition results.
  • a high-quality face recognition model can reduce the false recognition rate to a low level.
  • the negative test sample is input into the face recognition model, the feature vector corresponding to the live photo and the feature vector corresponding to the base image output by the face recognition model are received, and the feature vector corresponding to the live photo and the base image are calculated.
  • the cosine similarity between the feature vectors is calculated based on the calculated cosine similarity to determine the similarity between the field photos and the base image of each test negative sample; the n test negatives are negative based on the similarity between the field photos and the base image
  • the samples are sorted to obtain the sorting result, and the target similarity is determined according to the preset false recognition rate and the sorting result; the pass rate of n test positive samples is calculated according to the target similarity; the face recognition model is generated according to the pass rate of n test positive samples
  • the evaluation result is used to evaluate the recognition accuracy of the face recognition model, which solves the technical problem that the existing technology cannot evaluate the face recognition model based on the recognition accuracy, and achieves the evaluation of the face recognition based on the recognition accuracy The technical effect of the model.
  • the specific process of constructing the i-th test negative sample is: get the live photo of the i-th user, i is a natural number, 1 ⁇ i ⁇ n; get the n base images stored in the base library; filter out the base images corresponding to the i-th user ; Calculate the similarity between the i-th user’s live photo and the remaining n-1 base images, use the base image corresponding to the largest similarity as the base image of the i-th test negative sample, and use the i-th user’s live photo as A live photo of the i-th test negative sample.
  • the basemap library stores 10,000 basemaps
  • the specific process of constructing the 0055th negative test sample is: obtain the live photos of user 0055; obtain the 10,000 basemaps stored in the basemap library; filter out the corresponding ones for user 0055 Basemap; calculate the similarity between the site photo of user 0055 and the remaining 9999 basemaps, among which, the basemap corresponding to the largest similarity is basemap P560, then basemap P560 is used as the 0055th negative test sample In the bottom image, the scene photo of user No. 0055 is taken as the scene photo of the 0055th negative test sample.
  • the specific process of constructing the 0036th negative test sample is: obtain the site photos of user 0036; obtain the 10,000 base maps stored in the base library; filter out the base maps corresponding to user 0036; combine the site photos of user 0036 with the rest
  • the similarity calculation is performed on the 9999 base maps of, among which, the base map corresponding to the largest similarity is base map P9923, then base map P9923 is used as the base map of the 0036th negative test sample, and the scene photo of user 0036 is taken as the first 0036 live photos of negative test samples.
  • the preset false recognition rate is a preset value, which can be 1%, 2%, 5%, 10%, etc., and can be set according to actual conditions.
  • the preset false recognition rate has a negative correlation with the target similarity. If the preset false recognition rate is higher, the target similarity is smaller; if the preset false recognition rate is low, the target similarity is greater.
  • the pass rate of n test positive samples can evaluate the recognition accuracy of the face recognition model.
  • the specific process includes: calculate the feature vector corresponding to the i-th user’s live photo, and calculate the feature vector corresponding to the i-th user’s live photo L2 norm normalization processing; obtain the feature vectors corresponding to the remaining n-1 base images, and perform L2 norm normalization processing on the feature vectors corresponding to the remaining n-1 base images; calculate the L2 norm normalization
  • the cosine similarity between the feature vector corresponding to the user's live photo and the feature vector corresponding to the k-th base image in the remaining n-1 base images is used as the i-th user's live photo and the remaining n-1 base images
  • the specific process can be:
  • the feature vector corresponding to the live photo of the i-th user is normalized by the L2 norm, and the vector obtained after transposing is used as the first vector.
  • the first vector is a matrix with 1 row and m columns, and m is the i-th user’s
  • the dimension of the feature vector corresponding to the scene photo; the feature vector obtained after L2 norm normalization is performed on the feature vector corresponding to the n-1 base images is used as the second vector.
  • the second vector is a matrix with m rows and 1 column.
  • n-1 two vectors Arrange these n-1 second vectors into a first matrix, where the first matrix is a matrix with m rows (n-1) columns, and the first vector and the first matrix are used as a matrix Multiply to obtain the second vector, where the second vector is a matrix with 1 row (n-1) column, and the k-th element of the second vector is the feature vector corresponding to the i-th user’s live photo and corresponds to the k-th base image
  • the cosine similarity between eigenvectors is 1 ⁇ k ⁇ n-1.
  • 2 represents the L2 norm of vector x
  • n represents the number of elements contained in vector x.
  • the evaluation result is used to evaluate the recognition accuracy of the face recognition model. If the evaluation result shows that the recognition accuracy of the face recognition model is lower than the preset accuracy level, after outputting the evaluation result of the face recognition model, a prompt message is also output, which is used to indicate that the face recognition model needs to be optimized .
  • the embodiment of the present application provides an evaluation device for a face recognition model.
  • the device is used to execute the aforementioned evaluation method for a face recognition model.
  • the device includes: a first construction unit 10, a second construction unit 11.
  • the first construction unit 10 is used to construct n positive test samples, each of the n positive test samples includes a field photo and a base map, and the field photos and the base map included in the same test positive sample correspond
  • the basemap is an image stored in the basemap library.
  • the second construction unit 11 is used to construct n negative test samples, each of the n negative test samples includes a field photo and a base map, and the field photos and the base map included in the same test negative sample correspond Different users.
  • the input unit 12 is used to input n test negative samples into the face recognition model.
  • the first determining unit 13 is configured to receive the feature vector corresponding to the live photo and the feature vector corresponding to the base image output by the face recognition model, and calculate the cosine similarity between the feature vector corresponding to the live photo and the feature vector corresponding to the base image, According to the calculated cosine similarity, the similarity between the field photos and the base image of each negative test sample in the n negative test samples is determined.
  • the sorting unit 14 is used for sorting the n negative test samples according to the similarity between the field photos and the base map of each of the n negative test samples to obtain the sorting result.
  • the obtaining unit 15 is configured to obtain a preset false recognition rate.
  • the second determining unit 16 is configured to determine the target similarity according to the preset false recognition rate and the ranking result.
  • the calculation unit 17 is configured to calculate the pass rate of n test positive samples according to the target similarity.
  • the generating unit 18 is configured to generate an evaluation result of the face recognition model according to the pass rate of the n test positive samples, and the evaluation result is used to evaluate the recognition accuracy of the face recognition model.
  • the output unit 19 is used to output the evaluation result of the face recognition model.
  • the camera When employees, candidates, etc. need to enter the workplace or examination room, the camera will take a picture of them in front of the camera.
  • the picture In the embodiment of this application, the picture is represented by a live photo.
  • the pictures in the base gallery are pre-collected.
  • the basemap library stores 10,000 basemaps.
  • the basemaps are collected in advance, and each basemap has a one-to-one correspondence with a user.
  • the front face photo of user 0890 is collected in advance to obtain user 0890.
  • the base map has a one-to-one correspondence with the 0890 user.
  • There are 10,000 positive test samples which are test positive sample S1, test positive sample S2,..., test positive sample S10000.
  • a positive test sample includes a field photo and a base map corresponding to the same user.
  • the test positive sample Si includes a field photo of user i and a base map of user i.
  • the test positive sample S0055 includes user 0055.
  • the test positive sample S0036 includes a live photo of user 0036 and a base map of user 0036.
  • a negative test sample includes a site photo and a base map, and the site photo and the base map correspond to different users.
  • the test negative sample S0055 includes a site photo and a base map.
  • the site photo is the site of user 0055.
  • Photo and the base map is not the base map of user 0055.
  • the negative test sample S0036 includes a site photo and a base map.
  • the site photo is the site photo of user 0036, and the base map is not the base map of user 0036.
  • the cosine similarity between the vectors is determined according to the calculated cosine similarity to determine the similarity between the live photos and the base image of each of the 10,000 negative test samples.
  • 10,000 negative test samples are sorted to obtain the sorting result, and the target similarity is determined according to the preset false recognition rate and the sorting result.
  • the pass rate of 10,000 positive test samples is calculated according to the target similarity; the evaluation result of the face recognition model is generated according to the pass rate of 10,000 positive test samples, and the evaluation result is used to evaluate the recognition accuracy of the face recognition model.
  • the recognition accuracy of the face recognition model generally cannot reach 100%, some misrecognition situations will occur, for example, the scene photos and base maps of the same person cannot be recognized, or the scene photos and base maps of different people are recognized For the same person.
  • the reasons for misrecognition may be various.
  • the posture of the collected live photo is a profile posture, the user wears glasses in the live photo but the user does not wear glasses in the bottom photo, etc., the live photo and the light in the bottom photo Circumstances will also affect the recognition results.
  • a high-quality face recognition model can reduce the false recognition rate to a low level.
  • the negative test sample is input into the face recognition model, the feature vector corresponding to the live photo and the feature vector corresponding to the base image output by the face recognition model are received, and the feature vector corresponding to the live photo and the base image are calculated.
  • the cosine similarity between the feature vectors is calculated based on the calculated cosine similarity to determine the similarity between the field photos and the base image of each test negative sample; the n test negatives are negative based on the similarity between the field photos and the base image
  • the samples are sorted to obtain the sorting result, and the target similarity is determined according to the preset false recognition rate and the sorting result; the pass rate of n test positive samples is calculated according to the target similarity; the face recognition model is generated according to the pass rate of n test positive samples
  • the evaluation result is used to evaluate the recognition accuracy of the face recognition model, which solves the technical problem that the existing technology cannot evaluate the face recognition model based on the recognition accuracy, and achieves the evaluation of the face recognition based on the recognition accuracy The technical effect of the model.
  • the second determination unit 16 includes: a first calculation subunit, a screening subunit, a first determination subunit, and a second determination subunit.
  • the screening subunit is used to screen out h negative test samples according to the sorting results, where the similarity between the field photos and the base map of the h selected negative test samples is greater than the field photos of the remaining nh negative test samples The similarity between the basemaps.
  • the first determining subunit is used for taking the negative test sample with the lowest similarity between the field photo and the base map among the h negative test samples as the target negative test sample.
  • the second determining subunit is used to determine the target similarity according to the similarity between the field photos and the base map of the target test negative sample.
  • the calculation unit 17 includes: a second calculation subunit, a statistics subunit, and a third calculation subunit.
  • the second calculation subunit is used to calculate the similarity between the field photos and the base map of the n test positive samples to obtain n similarities.
  • the statistical subunit is used to count the number of positive test samples whose similarity between the field photos and the base map is greater than or equal to the target similarity.
  • the second construction unit 11 includes: a first acquisition subunit, a second acquisition subunit, a filtering subunit, and a fourth calculation subunit.
  • the first obtaining subunit is used to obtain the live photo of the i-th user, where i is a natural number, and 1 ⁇ i ⁇ n.
  • the second obtaining subunit is used to obtain n basemaps stored in the basemap library.
  • the filtering subunit is used to filter out the base image corresponding to the i-th user.
  • the fourth calculation subunit is used to calculate the similarity between the i-th user’s live photo and the remaining n-1 base images, and use the base image corresponding to the largest similarity as the base image of the i-th negative test sample.
  • the live photo of the i-th user is taken as the live photo of the i-th test negative sample.
  • the fourth calculation subunit includes: a first calculation module, an acquisition module, a second calculation module, and a determination module.
  • the first calculation module is used to calculate the feature vector corresponding to the live photo of the i-th user, and perform L2 norm normalization processing on the feature vector corresponding to the live photo of the i-th user.
  • the acquisition module is used to acquire the feature vectors corresponding to the remaining n-1 base images, and perform L2 norm normalization processing on the feature vectors corresponding to the remaining n-1 base images.
  • the second calculation module is used to calculate the cosine similarity between the feature vector corresponding to the live photo of the i-th user after the normalization of the L2 norm and the feature vector corresponding to each of the remaining n-1 base images .
  • the determination module is used to take the cosine similarity between the feature vector corresponding to the i-th user's live photo after the normalization of the L2 norm and the feature vector corresponding to the k-th base image in the remaining n-1 base images as The similarity between the live photo of the i-th user and the k-th base image in the remaining n-1 base images, 1 ⁇ k ⁇ n-1.
  • the embodiment of the present application provides a storage medium, the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to perform the following steps: construct n positive test samples, each of the n positive test samples
  • the sample includes a live photo and a basemap, and the live photo and basemap included in the same test positive sample correspond to the same user.
  • the basemap is an image stored in the basemap library, and the basemap library stores n basemaps.
  • Each base map has a corresponding relationship with a user, n is a natural number greater than 1; construct n negative test samples, each of the n negative test samples includes a scene photo and a base map, and the same test Negative samples include live photos and base images corresponding to different users; input n negative test samples into the face recognition model; receive the feature vectors corresponding to the live photos output by the face recognition model and the feature vectors corresponding to the base images, and calculate the live photos According to the cosine similarity between the corresponding feature vector and the corresponding feature vector of the base image, the similarity between the field photos and the base image of each of the n negative test samples is determined according to the calculated cosine similarity; Sort the n test negative samples based on the similarity between the field photos and the base map of each test negative sample in the n test negative samples to obtain the sort result; obtain the preset false recognition rate; according to the preset false recognition rate and sort The result determines the target similarity; the pass rate of n positive test samples is calculated according to the target
  • the device where the storage medium is controlled also performs the following steps: Obtain a live photo of the i-th user, where i is a natural number, and 1 ⁇ i ⁇ n; Obtain n base images stored in the base library; The base map corresponding to user i; calculate the similarity between the i-th user’s live photo and the remaining n-1 base maps, and use the base map corresponding to the largest similarity as the base map of the i-th test negative sample.
  • the live photo of the i user is taken as the live photo of the i-th negative test sample.
  • the device where the storage medium is controlled further executes the following steps: Calculate the feature vector corresponding to the scene photo of the i-th user, and perform L2 norm normalization processing on the feature vector corresponding to the scene photo of the i-th user ; Obtain the feature vectors corresponding to the remaining n-1 base images, and perform the L2 norm normalization process on the feature vectors corresponding to the remaining n-1 base images; calculate the i-th user after the L2 norm normalization process The cosine similarity between the feature vector corresponding to the scene photo and the feature vector corresponding to each base image in the remaining n-1 base images; the features corresponding to the scene photo of the i-th user after normalizing the L2 norm The cosine similarity between the vector and the feature vector corresponding to the k-th base image in the remaining n-1 base images is used as the live photo of the i-th user and the k-th base image in the remaining n-1 base images The similarity of 1 ⁇ k ⁇ n-1.
  • the embodiment of the present application provides a computer device including a memory and a processor, the memory is used to store information including program instructions, the processor is used to control the execution of the program instructions, and the program instructions are loaded and executed by the processor to implement the following steps: n positive test samples, each of the n positive test samples includes a site photo and a base map, and the site photos and base maps included in the same test positive sample correspond to the same user, and the base map is stored in For the images in the base library, there are n base images stored in the base library, and each base image has a corresponding relationship with a user, and n is a natural number greater than 1; construct n negative test samples, and each test in the n negative test samples Negative samples include a live photo and a base image, and the live photos and base images included in the same test negative sample correspond to different users; input n test negative samples into the face recognition model; receive the scene output from the face recognition model According to the corresponding feature vector, the feature vector corresponding to the base image, calculate the cosine
  • the following steps are also implemented: Obtain the scene photo of the i-th user, where i is a natural number, and 1 ⁇ i ⁇ n; Obtain n base images stored in the base library; The base map corresponding to user i; calculate the similarity between the i-th user’s live photo and the remaining n-1 base maps, and use the base map corresponding to the largest similarity as the base map of the i-th test negative sample.
  • the live photo of the i user is taken as the live photo of the i-th negative test sample.
  • the following steps are also implemented: calculate the feature vector corresponding to the scene photo of the i-th user, and perform L2 norm normalization processing on the feature vector corresponding to the scene photo of the i-th user ; Obtain the feature vectors corresponding to the remaining n-1 base images, and perform the L2 norm normalization process on the feature vectors corresponding to the remaining n-1 base images; calculate the i-th user after the L2 norm normalization process
  • the cosine similarity between the vector and the feature vector corresponding to the k-th base image in the remaining n-1 base images is used as the live photo of the i-th user and the k-th base image in the remaining n-1 base images The similarity of 1 ⁇ k ⁇ n-1.
  • Fig. 3 is a schematic diagram of an optional computer device provided by an embodiment of the present application.
  • the computer device 50 of this embodiment includes: a processor 51, a memory 52, and a computer program 53 stored in the memory 52 and running on the processor 51.
  • the computer program 53 is executed by the processor 51, To implement the evaluation method of the face recognition model in the embodiment, in order to avoid repetition, it will not be repeated here.
  • the computer program is executed by the processor 51, the function of each model/unit in the evaluation device of the face recognition model in the embodiment is realized. In order to avoid repetition, it will not be repeated here.
  • the computer device 50 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the computer device may include, but is not limited to, a processor 51 and a memory 52.
  • FIG. 3 is only an example of the computer device 50, and does not constitute a limitation on the computer device 50, and may include more or less components than shown, or combine some components, or different components.
  • computer equipment may also include input and output devices, network access devices, buses, and so on.
  • the so-called processor 51 can be a central processing unit (Central Processing Unit, CPU), other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory 52 may be an internal storage unit of the computer device 50, such as a hard disk or memory of the computer device 50.
  • the memory 52 may also be an external storage device of the computer device 50, for example, a plug-in hard disk equipped on the computer device 50, a smart memory card (Smart Media (SMC), a secure digital (SD) card, and a flash memory card (Flash Card) etc.
  • the memory 52 may also include both the internal storage unit of the computer device 50 and the external storage device.
  • the memory 52 is used to store computer programs and other programs and data required by computer devices.
  • the memory 52 may also be used to temporarily store data that has been or will be output.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components may be combined Or it can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical, or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware, or in the form of hardware plus software functional units.
  • the above-mentioned integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium.
  • the above software functional unit is stored in a storage medium, and includes several instructions to enable a computer device (which may be a personal computer, server, or network device, etc.) or processor (Processor) to perform the methods described in the embodiments of the present application Partial steps.
  • the foregoing storage media include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Image Analysis (AREA)

Abstract

一种人脸识别模型的评价方法、装置、存储介质及计算机设备,涉及人工智能技术领域,方法包括:构建n个测试正样本(S102);构建n个测试负样本(S104);将n个测试负样本输入人脸识别模型(S106);接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定n个测试负样本中每个测试负样本的现场照和底图之间的相似度(S108);根据n个测试负样本中每个测试负样本的现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果(S110);获取预设误识别率(S112);根据预设误识别率和排序结果确定目标相似度(S114);根据目标相似度计算n个测试正样本的通过率(S116);根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价(S118);输出人脸识别模型的评估结果(S120)。所述方法能解决现有技术中无法根据识别准确度评价人脸识别模型的问题。

Description

一种人脸识别模型的评价方法、装置、存储介质及计算机设备
本申请要求于2019年01月16日提交中国专利局、申请号为201910039128.1、申请名称为“一种人脸识别模型的评价方法和装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
【技术领域】
本申请涉及人工智能技术领域,尤其涉及一种人脸识别模型的评价方法、装置、存储介质及计算机设备。
【背景技术】
人脸识别模型用于职员、考生等需要记录出勤情况的场景,以人脸为介质识别出勤人员,应用十分广泛。一个优秀的人脸识别模型应当具有高识别准确度。
目前,无法根据识别准确度评价人脸识别模型。
【申请内容】
有鉴于此,本申请实施例提供了一种人脸识别模型的评价方法、装置、存储介质及计算机设备,用以解决现有技术无法根据识别准确度评价人脸识别模型的问题。
一方面,本申请实施例提供了一种人脸识别模型的评价方法,所述方法包括:构建n个测试正样本,所述n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,所述底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;构建n个测试负样本,所述n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;将所述n个测试负样本输入人脸识别模型;接收所述人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算所述现场照对应的特征向量与所述底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度;根据所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度对所述n个测试负样本进行排序,得到排序结果;获取预设误识别率;根据所述预设误识别率和所述排序结果确定目标相似度; 根据所述目标相似度计算所述n个测试正样本的通过率;根据所述n个测试正样本的通过率生成所述人脸识别模型的评估结果,所述评估结果用于对所述人脸识别模型的识别准确度进行评价;输出所述人脸识别模型的评估结果。
一方面,本申请实施例提供了一种人脸识别模型的评价装置,所述装置包括:第一构建单元,用于构建n个测试正样本,所述n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,所述底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;第二构建单元,用于构建n个测试负样本,所述n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;输入单元,用于将所述n个测试负样本输入人脸识别模型;第一确定单元,用于接收所述人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算所述现场照对应的特征向量与所述底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度;排序单元,用于根据所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度对所述n个测试负样本进行排序,得到排序结果;获取单元,用于获取预设误识别率;第二确定单元,用于根据所述预设误识别率和所述排序结果确定目标相似度;计算单元,用于根据所述目标相似度计算所述n个测试正样本的通过率;生成单元,用于根据所述n个测试正样本的通过率生成所述人脸识别模型的评估结果,所述评估结果用于对所述人脸识别模型的识别准确度进行评价;输出单元,用于输出所述人脸识别模型的评估结果。
一方面,本申请实施例提供了一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行上述的人脸识别模型的评价方法。
一方面,本申请实施例提供了一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制程序指令的执行,所述程序指令被处理器加载并执行时实现上述的人脸识别模型的评价方法的步骤。
在本申请实施例中,将测试负样本输入人脸识别模型,接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定每个测试负样本的现场照和底图之间的相似度;根据现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果,根据预设误识别率和排序结果确定目标相似度;根据目标相似度计算n个测试正样本的通过率;根据n个测试正样本的通过率生成人脸识别模型的评估 结果,评估结果用于对人脸识别模型的识别准确度进行评价,解决了现有技术中无法根据识别准确度评价人脸识别模型的技术问题,达到了根据识别准确度评价人脸识别模型的技术效果。
【附图说明】
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。
图1是本申请实施例提供的一种可选的人脸识别模型的评价方法的流程图;
图2是本申请实施例提供的一种可选的人脸识别模型的评价装置的示意图;
图3是本申请实施例提供的一种可选的计算机设备的示意图。
【具体实施方式】
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
图1是本申请实施例提供的一种可选的人脸识别模型的评价方法的流程图,如图1所示,该方法包括如下步骤:
步骤S102,构建n个测试正样本,n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数。
步骤S104,构建n个测试负样本,n个测试负样本中每个测试负样本 包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户。
步骤S106,将n个测试负样本输入人脸识别模型。
步骤S108,接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定n个测试负样本中每个测试负样本的现场照和底图之间的相似度。
步骤S110,根据n个测试负样本中每个测试负样本的现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果。
步骤S112,获取预设误识别率。
步骤S114,根据预设误识别率和排序结果确定目标相似度。
步骤S116,根据目标相似度计算n个测试正样本的通过率。
步骤S118,根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价。
步骤S120,输出人脸识别模型的评估结果。
当职员、考生等需要进入职场、考场时,摄像头会拍下他们在镜头前的画面,在本申请实施例中,该画面用现场照表述。
底图库中的图片是预先收集的。
例如,底图库中存储了10000个底图,底图是预先采集得到的,每一个底图与一个用户具有一一对应关系,例如,预先采集0890号用户的正面人脸照片,得到0890号用户的底图,将该底图存储在数据库中,该底图与0890号用户具有一一对应关系。测试正样本一共有10000个,分别为测试正样本S1、测试正样本S2、……、测试正样本S10000。一个测试正样本包括同一个用户对应的一个现场照和一个底图,测试正样本Si包括i号用户的一个现场照和i号用户的一个底图,例如,测试正样本S0055包括0055号用户的一个现场照和0055号用户的一个底图,测试正样本S0036包括0036号用户的一个现场照和0036号用户的一个底图。一个测试负样本包括一个现场照和一个底图,并且,该现场照和该底图对应不同用户,例如,测试负样本S0055包括一个现场照和一个底图,该现场照是0055号用户的现场照,并且该底图不是0055号用户的底图。测试负样本S0036包括一个现场照和一个底图,该现场照是0036号用户的现场照,并且该底图不是0036号用户的底图。将10000个测试负样本输入人脸识别模型,人脸识别模型输出10000个测试负样本的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定10000个测试负样本中每个测试负样本的现场照和底图之间的相似度。根据现场照和底图之间的相似度由高到低的顺序对10000个测试负样本进行排序,得到排序结果,根据预设误识别率和排序结果确定目标相似度。根据目标相似度计算10000个测试正样本的通过率;根据10000个测试正样本的通过率生成 人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价。
由于人脸识别模型的识别准确度一般无法达到100%,因此会产生一些误识别的情况,例如,无法识别出同一个人的现场照和底图,或者,将不同人的现场照和底图识别为同一个人的。产生误识别的原因可能是多种多样的,例如,采集的现场照的姿态为侧脸姿态、现场照中用户戴了眼镜而底图中用户没有戴眼镜等,现场照与底图中的光照情况也会对识别结果产生影响。一个优质的人脸识别模型可以将误识别率降到较低的程度。
在本申请实施例中,将测试负样本输入人脸识别模型,接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定每个测试负样本的现场照和底图之间的相似度;根据现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果,根据预设误识别率和排序结果确定目标相似度;根据目标相似度计算n个测试正样本的通过率;根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价,解决了现有技术中无法根据识别准确度评价人脸识别模型的技术问题,达到了根据识别准确度评价人脸识别模型的技术效果。
以构建第i个测试负样本的具体过程为例,对构建测试负样本的过程进行具体说明。构建第i个测试负样本的具体过程为:获取第i用户的现场照,i为自然数,1≤i≤n;获取底图库中存储的n个底图;过滤掉第i用户对应的底图;将第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将第i用户的现场照作为第i个测试负样本的现场照。
例如,底图库中存储了10000个底图,构建第0055个测试负样本的具体过程为:获取0055号用户的现场照;获取底图库中存储的10000个底图;过滤掉0055号用户对应的底图;将0055号用户的现场照与剩余的9999个底图进行相似度计算,其中,最大的相似度对应的底图为底图P560,则将底图P560作为第0055个测试负样本的底图,将0055号用户的现场照作为第0055个测试负样本的现场照。构建第0036个测试负样本的具体过程为:获取0036号用户的现场照;获取底图库中存储的10000个底图;过滤掉0036号用户对应的底图;将0036号用户的现场照与剩余的9999个底图进行相似度计算,其中,最大的相似度对应的底图为底图P9923,则将底图P9923作为第0036个测试负样本的底图,将0036号用户的现场照作为第0036个测试负样本的现场照。
可选地,根据预设误识别率和排序结果确定目标相似度,包括:根据公式h=n×L计算误识别数量,L为预设误识别率,h为误识别数量;根据排序结果筛选出h个测试负样本,其中,筛选出的h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图 之间的相似度;将h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;根据目标测试负样本的现场照和底图之间的相似度确定目标相似度。
预设误识别率是预先设置的一个数值,可以为1%、2%、5%、10%等,可以根据实际情况进行设置。
预设误识别率与目标相似度呈负相关关系,如果预设误识别率较高,则目标相似度较小;如果预设误识别率较低,则目标相似度较大。
可选地,根据目标相似度计算n个测试正样本的通过率,包括:计算n个测试正样本的现场照和底图之间的相似度,得到n个相似度;统计现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量;根据以下公式计算n个测试正样本的通过率:P=n1/n,其中,P是n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量。
n个测试正样本的通过率能够评价人脸识别模型的识别准确度。n个测试正样本的通过率越高,则说明人脸识别模型的识别准确度越高;n个测试正样本的通过率越低,则说明人脸识别模型的识别准确度越低。
将第i用户的现场照与剩余的n-1个底图进行相似度计算,具体过程包括:计算第i用户的现场照对应的特征向量,并将第i用户的现场照对应的特征向量进行L2范数归一化处理;获取剩余的n-1个底图对应的特征向量,并将剩余的n-1个底图对应的特征向量进行L2范数归一化处理;计算L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;将L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为第i用户的现场照与剩余的n-1个底图中第k个底图之间的相似度,1≤k≤n-1。
计算L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度,具体过程可以为:将第i用户的现场照对应的特征向量进行L2范数归一化处理,再进行转置处理后得到的向量作为第一向量,第一向量为1行m列的矩阵,m为第i用户的现场照对应的特征向量的维度;将n-1个底图对应的特征向量进行L2范数归一化处理后得到的特征向量作为第二向量,第二向量为m行1列的矩阵,第二向量有n-1个,将这n-1个第二向量排列成第一矩阵,其中,第一矩阵为m行(n-1)列的矩阵,将第一向量与第一矩阵作矩阵乘法,得到第二向量,其中,第二向量为1行(n-1)列的矩阵,第二向量的第k个元素为第i用户的现场照对应的特征向量与第k个底图对应的特征向量之间的余弦相似度,1≤k≤n-1。
向量L2范数归一化就是向量中每个元素除以向量的L2范数。L2范
Figure PCTCN2019118257-appb-000001
||x|| 2表示向量x的L2范数,n表示向量x包含 的元素的数量。
由于在计算余弦相似度之前先将特征向量进行了L2范数归一化处理,在计算余弦相似度的过程中不需要每次都进行除模处理,从而将多次向量乘法运算转换为单次矩阵乘法运算,实现了并行计算,相似度计算效率高。
评估结果用于对人脸识别模型的识别准确度进行评价。如果评估结果表明人脸识别模型的识别准确度低于预设准确度等级,则在输出人脸识别模型的评估结果之后,还输出提示信息,提示信息用于提示需要对人脸识别模型进行优化。
本申请实施例提供了一种人脸识别模型的评价装置,该装置用于执行上述人脸识别模型的评价方法,如图2所示,该装置包括:第一构建单元10、第二构建单元11、输入单元12、第一确定单元13、排序单元14、获取单元15、第二确定单元16、计算单元17、生成单元18、输出单元19。
第一构建单元10,用于构建n个测试正样本,n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数。
第二构建单元11,用于构建n个测试负样本,n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户。
输入单元12,用于将n个测试负样本输入人脸识别模型。
第一确定单元13,用于接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定n个测试负样本中每个测试负样本的现场照和底图之间的相似度。
排序单元14,用于根据n个测试负样本中每个测试负样本的现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果。
获取单元15,用于获取预设误识别率。
第二确定单元16,用于根据预设误识别率和排序结果确定目标相似度。
计算单元17,用于根据目标相似度计算n个测试正样本的通过率。
生成单元18,用于根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价。
输出单元19,用于输出人脸识别模型的评估结果。
当职员、考生等需要进入职场、考场时,摄像头会拍下他们在镜头前的画面,在本申请实施例中,该画面用现场照表述。
底图库中的图片是预先收集的。
例如,底图库中存储了10000个底图,底图是预先采集得到的,每一个底图与一个用户具有一一对应关系,例如,预先采集0890号用户的正 面人脸照片,得到0890号用户的底图,将该底图存储在数据库中,该底图与0890号用户具有一一对应关系。测试正样本一共有10000个,分别为测试正样本S1、测试正样本S2、……、测试正样本S10000。一个测试正样本包括同一个用户对应的一个现场照和一个底图,测试正样本Si包括i号用户的一个现场照和i号用户的一个底图,例如,测试正样本S0055包括0055号用户的一个现场照和0055号用户的一个底图,测试正样本S0036包括0036号用户的一个现场照和0036号用户的一个底图。一个测试负样本包括一个现场照和一个底图,并且,该现场照和该底图对应不同用户,例如,测试负样本S0055包括一个现场照和一个底图,该现场照是0055号用户的现场照,并且该底图不是0055号用户的底图。测试负样本S0036包括一个现场照和一个底图,该现场照是0036号用户的现场照,并且该底图不是0036号用户的底图。将10000个测试负样本输入人脸识别模型,人脸识别模型输出10000个测试负样本的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定10000个测试负样本中每个测试负样本的现场照和底图之间的相似度。根据现场照和底图之间的相似度由高到低的顺序对10000个测试负样本进行排序,得到排序结果,根据预设误识别率和排序结果确定目标相似度。根据目标相似度计算10000个测试正样本的通过率;根据10000个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价。
由于人脸识别模型的识别准确度一般无法达到100%,因此会产生一些误识别的情况,例如,无法识别出同一个人的现场照和底图,或者,将不同人的现场照和底图识别为同一个人的。产生误识别的原因可能是多种多样的,例如,采集的现场照的姿态为侧脸姿态、现场照中用户戴了眼镜而底图中用户没有戴眼镜等,现场照与底图中的光照情况也会对识别结果产生影响。一个优质的人脸识别模型可以将误识别率降到较低的程度。
在本申请实施例中,将测试负样本输入人脸识别模型,接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定每个测试负样本的现场照和底图之间的相似度;根据现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果,根据预设误识别率和排序结果确定目标相似度;根据目标相似度计算n个测试正样本的通过率;根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价,解决了现有技术中无法根据识别准确度评价人脸识别模型的技术问题,达到了根据识别准确度评价人脸识别模型的技术效果。
可选地,第二确定单元16包括:第一计算子单元、筛选子单元、第一确定子单元、第二确定子单元。第一计算子单元,用于根据公式h=n× L计算误识别数量,L为预设误识别率,h为误识别数量。筛选子单元,用于根据排序结果筛选出h个测试负样本,其中,筛选出的h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度。第一确定子单元,用于将h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本。第二确定子单元,用于根据目标测试负样本的现场照和底图之间的相似度确定目标相似度。
可选地,计算单元17包括:第二计算子单元、统计子单元、第三计算子单元。第二计算子单元,用于计算n个测试正样本的现场照和底图之间的相似度,得到n个相似度。统计子单元,用于统计现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量。第三计算子单元,用于根据以下公式计算n个测试正样本的通过率:P=n1/n,其中,P是n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量。
可选地,第二构建单元11包括:第一获取子单元、第二获取子单元、过滤子单元、第四计算子单元。第一获取子单元,用于获取第i用户的现场照,i为自然数,1≤i≤n。第二获取子单元,用于获取底图库中存储的n个底图。过滤子单元,用于过滤掉第i用户对应的底图。第四计算子单元,用于将第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将第i用户的现场照作为第i个测试负样本的现场照。
可选地,第四计算子单元包括:第一计算模块、获取模块、第二计算模块、确定模块。第一计算模块,用于计算第i用户的现场照对应的特征向量,并将第i用户的现场照对应的特征向量进行L2范数归一化处理。获取模块,用于获取剩余的n-1个底图对应的特征向量,并将剩余的n-1个底图对应的特征向量进行L2范数归一化处理。第二计算模块,用于计算L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度。确定模块,用于将L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为第i用户的现场照与剩余的n-1个底图中第k个底图之间的相似度,1≤k≤n-1。
本申请实施例提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行以下步骤:构建n个测试正样本,n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;构建n个测试负样本,n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同 一个测试负样本包括的现场照和底图对应不同的用户;将n个测试负样本输入人脸识别模型;接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定n个测试负样本中每个测试负样本的现场照和底图之间的相似度;根据n个测试负样本中每个测试负样本的现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果;获取预设误识别率;根据预设误识别率和排序结果确定目标相似度;根据目标相似度计算n个测试正样本的通过率;根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价;输出人脸识别模型的评估结果。
可选地,在程序运行时控制存储介质所在设备还执行以下步骤:根据公式h=n×L计算误识别数量,L为预设误识别率,h为误识别数量;根据排序结果筛选出h个测试负样本,其中,筛选出的h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度;将h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;根据目标测试负样本的现场照和底图之间的相似度确定目标相似度。
可选地,在程序运行时控制存储介质所在设备还执行以下步骤:计算n个测试正样本的现场照和底图之间的相似度,得到n个相似度;统计现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量;根据以下公式计算n个测试正样本的通过率:P=n1/n,其中,P是n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量。
可选地,在程序运行时控制存储介质所在设备还执行以下步骤:获取第i用户的现场照,i为自然数,1≤i≤n;获取底图库中存储的n个底图;过滤掉第i用户对应的底图;将第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将第i用户的现场照作为第i个测试负样本的现场照。
可选地,在程序运行时控制存储介质所在设备还执行以下步骤:计算第i用户的现场照对应的特征向量,并将第i用户的现场照对应的特征向量进行L2范数归一化处理;获取剩余的n-1个底图对应的特征向量,并将剩余的n-1个底图对应的特征向量进行L2范数归一化处理;计算L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;将L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为第i用户的现场照与剩余的n-1个底图中第k个底图之间的相似度,1≤k≤n-1。
本申请实施例提供了一种计算机设备,包括存储器和处理器,存储器用于存储包括程序指令的信息,处理器用于控制程序指令的执行,程序指令被处理器加载并执行时实现以下步骤:构建n个测试正样本,n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;构建n个测试负样本,n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;将n个测试负样本输入人脸识别模型;接收人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算现场照对应的特征向量与底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定n个测试负样本中每个测试负样本的现场照和底图之间的相似度;根据n个测试负样本中每个测试负样本的现场照和底图之间的相似度对n个测试负样本进行排序,得到排序结果;获取预设误识别率;根据预设误识别率和排序结果确定目标相似度;根据目标相似度计算n个测试正样本的通过率;根据n个测试正样本的通过率生成人脸识别模型的评估结果,评估结果用于对人脸识别模型的识别准确度进行评价;输出人脸识别模型的评估结果。
可选地,程序指令被处理器加载并执行时还实现以下步骤:根据公式h=n×L计算误识别数量,L为预设误识别率,h为误识别数量;根据排序结果筛选出h个测试负样本,其中,筛选出的h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度;将h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;根据目标测试负样本的现场照和底图之间的相似度确定目标相似度。
可选地,程序指令被处理器加载并执行时还实现以下步骤:计算n个测试正样本的现场照和底图之间的相似度,得到n个相似度;统计现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量;根据以下公式计算n个测试正样本的通过率:P=n1/n,其中,P是n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于目标相似度的测试正样本的数量。
可选地,程序指令被处理器加载并执行时还实现以下步骤:获取第i用户的现场照,i为自然数,1≤i≤n;获取底图库中存储的n个底图;过滤掉第i用户对应的底图;将第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将第i用户的现场照作为第i个测试负样本的现场照。
可选地,程序指令被处理器加载并执行时还实现以下步骤:计算第i用户的现场照对应的特征向量,并将第i用户的现场照对应的特征向量进行L2范数归一化处理;获取剩余的n-1个底图对应的特征向量,并将剩 余的n-1个底图对应的特征向量进行L2范数归一化处理;计算L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;将L2范数归一化处理后第i用户的现场照对应的特征向量与剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为第i用户的现场照与剩余的n-1个底图中第k个底图之间的相似度,1≤k≤n-1。
图3是本申请实施例提供的一种可选的计算机设备的示意图。如图3所示,该实施例的计算机设备50包括:处理器51、存储器52以及存储在存储器52中并可在处理器51上运行的计算机程序53,该计算机程序53被处理器51执行时实现实施例中的人脸识别模型的评价方法,为避免重复,此处不一一赘述。或者,该计算机程序被处理器51执行时实现实施例中人脸识别模型的评价装置中各模型/单元的功能,为避免重复,此处不一一赘述。
计算机设备50可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。计算机设备可包括,但不仅限于,处理器51、存储器52。本领域技术人员可以理解,图3仅仅是计算机设备50的示例,并不构成对计算机设备50的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如计算机设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器51可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
存储器52可以是计算机设备50的内部存储单元,例如计算机设备50的硬盘或内存。存储器52也可以是计算机设备50的外部存储设备,例如计算机设备50上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器52还可以既包括计算机设备50的内部存储单元也包括外部存储设备。存储器52用于存储计算机程序以及计算机设备所需的其他程序和数据。存储器52还可以用于暂时地存储已经输出或者将要输出的数据。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分, 实际实现时可以有另外的划分方式,例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。
上述以软件功能单元的形式实现的集成的单元,可以存储在一个计算机可读取存储介质中。上述软件功能单元存储在一个存储介质中,包括若干指令用以使得一台计算机装置(可以是个人计算机,服务器,或者网络装置等)或处理器(Processor)执行本申请各个实施例所述方法的部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (20)

  1. 一种人脸识别模型的评价方法,其特征在于,所述方法包括:
    构建n个测试正样本,所述n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,所述底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;
    构建n个测试负样本,所述n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;
    将所述n个测试负样本输入人脸识别模型;
    接收所述人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算所述现场照对应的特征向量与所述底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度;
    根据所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度对所述n个测试负样本进行排序,得到排序结果;
    获取预设误识别率;
    根据所述预设误识别率和所述排序结果确定目标相似度;
    根据所述目标相似度计算所述n个测试正样本的通过率;
    根据所述n个测试正样本的通过率生成所述人脸识别模型的评估结果,所述评估结果用于对所述人脸识别模型的识别准确度进行评价;
    输出所述人脸识别模型的评估结果。
  2. 根据权利要求1所述的方法,其特征在于,所述根据所述预设误识别率和所述排序结果确定目标相似度,包括:
    根据公式h=n×L计算误识别数量,L为所述预设误识别率,h为所述误识别数量;
    根据所述排序结果筛选出h个测试负样本,其中,筛选出的所述h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度;
    将所述h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;
    根据所述目标测试负样本的现场照和底图之间的相似度确定所述目标相似度。
  3. 根据权利要求1所述的方法,其特征在于,所述根据所述目标相似度计算所述n个测试正样本的通过率,包括:
    计算所述n个测试正样本的现场照和底图之间的相似度,得到n个相似度;
    统计现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量;
    根据以下公式计算所述n个测试正样本的通过率:P=n1/n,其中,P是所述n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量。
  4. 根据权利要求1至3任一项所述的方法,其特征在于,所述构建n个测试负样本,包括:
    获取第i用户的现场照,i为自然数,1≤i≤n;
    获取所述底图库中存储的n个底图;
    过滤掉所述第i用户对应的底图;
    将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将所述第i用户的现场照作为所述第i个测试负样本的现场照。
  5. 根据权利要求4所述的方法,其特征在于,所述将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,包括:
    计算所述第i用户的现场照对应的特征向量,并将所述第i用户的现场照对应的特征向量进行L2范数归一化处理;
    获取所述剩余的n-1个底图对应的特征向量,并将所述剩余的n-1个底图对应的特征向量进行L2范数归一化处理;
    计算L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;
    将L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为所述第i用户的现场照与所述剩余的n-1个底图中所述第k个底图之间的相似度,1≤k≤n-1。
  6. 一种人脸识别模型的评价装置,其特征在于,所述装置包括:
    第一构建单元,用于构建n个测试正样本,所述n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,所述底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;
    第二构建单元,用于构建n个测试负样本,所述n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;
    输入单元,用于将所述n个测试负样本输入人脸识别模型;
    第一确定单元,用于接收所述人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算所述现场照对应的特征向量与所述底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述 n个测试负样本中每个测试负样本的现场照和底图之间的相似度;
    排序单元,用于根据所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度对所述n个测试负样本进行排序,得到排序结果;
    获取单元,用于获取预设误识别率;
    第二确定单元,用于根据所述预设误识别率和所述排序结果确定目标相似度;
    计算单元,用于根据所述目标相似度计算所述n个测试正样本的通过率;
    生成单元,用于根据所述n个测试正样本的通过率生成所述人脸识别模型的评估结果,所述评估结果用于对所述人脸识别模型的识别准确度进行评价;
    输出单元,用于输出所述人脸识别模型的评估结果。
  7. 根据权利要求6所述的装置,其特征在于,所述第二确定单元包括:
    第一计算子单元,用于根据公式h=n×L计算误识别数量,L为所述预设误识别率,h为所述误识别数量;
    筛选子单元,用于根据所述排序结果筛选出h个测试负样本,其中,筛选出的所述h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度;
    第一确定子单元,用于将所述h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;
    第二确定子单元,用于根据所述目标测试负样本的现场照和底图之间的相似度确定所述目标相似度。
  8. 根据权利要求6所述的装置,其特征在于,所述计算单元包括:
    第二计算子单元,用于计算所述n个测试正样本的现场照和底图之间的相似度,得到n个相似度;
    统计子单元,用于统计现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量;
    第三计算子单元,用于根据以下公式计算所述n个测试正样本的通过率:P=n1/n,其中,P是所述n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量。
  9. 根据权利要求6至8任一项所述的装置,其特征在于,所述第二构建单元包括:
    第一获取子单元,用于获取第i用户的现场照,i为自然数,1≤i≤n;
    第二获取子单元,用于获取所述底图库中存储的n个底图;
    过滤子单元,用于过滤掉所述第i用户对应的底图;
    第四计算子单元,用于将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将所述第i用户的现场照作为所述第i个测试负样本的现场照。
  10. 根据权利要求9所述的装置,其特征在于,所述第四计算子单元包括:
    第一计算模块,用于计算所述第i用户的现场照对应的特征向量,并将所述第i用户的现场照对应的特征向量进行L2范数归一化处理;
    获取模块,用于获取所述剩余的n-1个底图对应的特征向量,并将所述剩余的n-1个底图对应的特征向量进行L2范数归一化处理;
    第二计算模块,用于计算L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;
    确定模块,用于将L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为所述第i用户的现场照与所述剩余的n-1个底图中所述第k个底图之间的相似度,1≤k≤n-1。
  11. 一种存储介质,其特征在于,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行以下步骤:
    构建n个测试正样本,所述n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,所述底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;
    构建n个测试负样本,所述n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;
    将所述n个测试负样本输入人脸识别模型;
    接收所述人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算所述现场照对应的特征向量与所述底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度;
    根据所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度对所述n个测试负样本进行排序,得到排序结果;
    获取预设误识别率;
    根据所述预设误识别率和所述排序结果确定目标相似度;
    根据所述目标相似度计算所述n个测试正样本的通过率;
    根据所述n个测试正样本的通过率生成所述人脸识别模型的评估结果,所述评估结果用于对所述人脸识别模型的识别准确度进行评价;
    输出所述人脸识别模型的评估结果。
  12. 根据权利要求11所述的存储介质,其特征在于,在所述程序运行时控制所述存储介质所在设备执行所述根据所述预设误识别率和所述排序结果确定目标相似度,包括:
    根据公式h=n×L计算误识别数量,L为所述预设误识别率,h为所 述误识别数量;
    根据所述排序结果筛选出h个测试负样本,其中,筛选出的所述h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度;
    将所述h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;
    根据所述目标测试负样本的现场照和底图之间的相似度确定所述目标相似度。
  13. 根据权利要求11所述的存储介质,其特征在于,在所述程序运行时控制所述存储介质所在设备执行所述根据所述目标相似度计算所述n个测试正样本的通过率,包括:
    计算所述n个测试正样本的现场照和底图之间的相似度,得到n个相似度;
    统计现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量;
    根据以下公式计算所述n个测试正样本的通过率:P=n1/n,其中,P是所述n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量。
  14. 根据权利要求11至13任一项所述的存储介质,其特征在于,在所述程序运行时控制所述存储介质所在设备执行所述构建n个测试负样本,包括:
    获取第i用户的现场照,i为自然数,1≤i≤n;
    获取所述底图库中存储的n个底图;
    过滤掉所述第i用户对应的底图;
    将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将所述第i用户的现场照作为所述第i个测试负样本的现场照。
  15. 根据权利要求14所述的存储介质,其特征在于,在所述程序运行时控制所述存储介质所在设备执行所述将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,包括:
    计算所述第i用户的现场照对应的特征向量,并将所述第i用户的现场照对应的特征向量进行L2范数归一化处理;
    获取所述剩余的n-1个底图对应的特征向量,并将所述剩余的n-1个底图对应的特征向量进行L2范数归一化处理;
    计算L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;
    将L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为所述第i用户的现场照与所述剩余的n-1个底图中所述第k个底图之间的 相似度,1≤k≤n-1。
  16. 一种计算机设备,包括存储器和处理器,所述存储器用于存储包括程序指令的信息,所述处理器用于控制程序指令的执行,其特征在于,所述程序指令被处理器加载并执行时实现以下步骤:
    构建n个测试正样本,所述n个测试正样本中每个测试正样本包括一个现场照和一个底图,并且,同一个测试正样本包括的现场照和底图对应同一个用户,底图为存储在底图库中的图像,所述底图库中存储了n个底图,每一个底图与一个用户具有对应关系,n为大于1的自然数;
    构建n个测试负样本,所述n个测试负样本中每个测试负样本包括一个现场照和一个底图,并且,同一个测试负样本包括的现场照和底图对应不同的用户;
    将所述n个测试负样本输入人脸识别模型;
    接收所述人脸识别模型输出的现场照对应的特征向量、底图对应的特征向量,计算所述现场照对应的特征向量与所述底图对应的特征向量之间的余弦相似度,根据计算得到的余弦相似度确定所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度;
    根据所述n个测试负样本中每个测试负样本的现场照和底图之间的相似度对所述n个测试负样本进行排序,得到排序结果;
    获取预设误识别率;
    根据所述预设误识别率和所述排序结果确定目标相似度;
    根据所述目标相似度计算所述n个测试正样本的通过率;
    根据所述n个测试正样本的通过率生成所述人脸识别模型的评估结果,所述评估结果用于对所述人脸识别模型的识别准确度进行评价;
    输出所述人脸识别模型的评估结果。
  17. 根据权利要求16所述的计算机设备,其特征在于,所述程序指令被处理器加载并执行时实现所述根据所述预设误识别率和所述排序结果确定目标相似度,包括:
    根据公式h=n×L计算误识别数量,L为所述预设误识别率,h为所述误识别数量;
    根据所述排序结果筛选出h个测试负样本,其中,筛选出的所述h个测试负样本的现场照和底图之间的相似度均大于其余n-h个测试负样本的现场照和底图之间的相似度;
    将所述h个测试负样本中现场照和底图之间的相似度最低的测试负样本作为目标测试负样本;
    根据所述目标测试负样本的现场照和底图之间的相似度确定所述目标相似度。
  18. 根据权利要求16所述的计算机设备,其特征在于,所述程序指令被处理器加载并执行时实现所述根据所述目标相似度计算所述n个测试正样本的通过率,包括:
    计算所述n个测试正样本的现场照和底图之间的相似度,得到n个相似度;
    统计现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量;
    根据以下公式计算所述n个测试正样本的通过率:P=n1/n,其中,P是所述n个测试正样本的通过率,n1是现场照和底图之间的相似度大于或等于所述目标相似度的测试正样本的数量。
  19. 根据权利要求16至18任一项所述的计算机设备,其特征在于,所述程序指令被处理器加载并执行时实现所述构建n个测试负样本,包括:
    获取第i用户的现场照,i为自然数,1≤i≤n;
    获取所述底图库中存储的n个底图;
    过滤掉所述第i用户对应的底图;
    将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,将最大的相似度对应的底图作为第i个测试负样本的底图,将所述第i用户的现场照作为所述第i个测试负样本的现场照。
  20. 根据权利要求19所述的计算机设备,其特征在于,所述程序指令被处理器加载并执行时实现所述将所述第i用户的现场照与剩余的n-1个底图进行相似度计算,包括:
    计算所述第i用户的现场照对应的特征向量,并将所述第i用户的现场照对应的特征向量进行L2范数归一化处理;
    获取所述剩余的n-1个底图对应的特征向量,并将所述剩余的n-1个底图对应的特征向量进行L2范数归一化处理;
    计算L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中每个底图对应的特征向量之间的余弦相似度;
    将L2范数归一化处理后所述第i用户的现场照对应的特征向量与所述剩余的n-1个底图中第k个底图对应的特征向量之间的余弦相似度作为所述第i用户的现场照与所述剩余的n-1个底图中所述第k个底图之间的相似度,1≤k≤n-1。
PCT/CN2019/118257 2019-01-16 2019-11-14 一种人脸识别模型的评价方法、装置、存储介质及计算机设备 Ceased WO2020147408A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910039128.1A CN109871762B (zh) 2019-01-16 2019-01-16 一种人脸识别模型的评价方法和装置
CN201910039128.1 2019-01-16

Publications (1)

Publication Number Publication Date
WO2020147408A1 true WO2020147408A1 (zh) 2020-07-23

Family

ID=66917594

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/118257 Ceased WO2020147408A1 (zh) 2019-01-16 2019-11-14 一种人脸识别模型的评价方法、装置、存储介质及计算机设备

Country Status (2)

Country Link
CN (1) CN109871762B (zh)
WO (1) WO2020147408A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116092149A (zh) * 2022-11-18 2023-05-09 青岛高重信息科技有限公司 一种基于困难样本挖掘的人脸数据清洗方法
CN118447268A (zh) * 2023-09-22 2024-08-06 荣耀终端有限公司 身份识别方法、电子设备及存储介质
CN119180351A (zh) * 2024-09-23 2024-12-24 北京字跳网络技术有限公司 一种提示词的优化方法、装置、设备、介质及产品

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109871762B (zh) * 2019-01-16 2023-08-08 平安科技(深圳)有限公司 一种人脸识别模型的评价方法和装置
CN110765903A (zh) * 2019-10-10 2020-02-07 浙江大华技术股份有限公司 行人重识别方法、装置及存储介质
CN110991314B (zh) * 2019-11-28 2023-11-10 以萨技术股份有限公司 一种基于人脸聚类精准度的测试方法及系统
CN111738349B (zh) * 2020-06-29 2023-05-02 重庆紫光华山智安科技有限公司 目标检测算法的检测效果评估方法、装置、存储介质及设备
CN115510987A (zh) * 2022-09-30 2022-12-23 中国人民解放军军事科学院战略评估咨询中心 一种基于运算特征差异性的深度学习基准测试集构建方法
CN116206179A (zh) * 2023-02-01 2023-06-02 北京龙智数科科技服务有限公司 人脸识别模型性能的评估方法及装置
CN116959072A (zh) * 2023-07-24 2023-10-27 蓝思系统集成有限公司 人脸识别模型的评价方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150235073A1 (en) * 2014-01-28 2015-08-20 The Trustees Of The Stevens Institute Of Technology Flexible part-based representation for real-world face recognition apparatus and methods
CN108009528A (zh) * 2017-12-26 2018-05-08 广州广电运通金融电子股份有限公司 基于Triplet Loss的人脸认证方法、装置、计算机设备和存储介质
CN108805048A (zh) * 2018-05-25 2018-11-13 腾讯科技(深圳)有限公司 一种人脸识别模型的调整方法、装置和存储介质
CN109189961A (zh) * 2018-07-23 2019-01-11 上海斐讯数据通信技术有限公司 一种人脸识别可信度的计算方法及系统
CN109871762A (zh) * 2019-01-16 2019-06-11 平安科技(深圳)有限公司 一种人脸识别模型的评价方法和装置

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105956518A (zh) * 2016-04-21 2016-09-21 腾讯科技(深圳)有限公司 一种人脸识别方法、装置和系统
CN108776768A (zh) * 2018-04-19 2018-11-09 广州视源电子科技股份有限公司 图像识别方法及装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150235073A1 (en) * 2014-01-28 2015-08-20 The Trustees Of The Stevens Institute Of Technology Flexible part-based representation for real-world face recognition apparatus and methods
CN108009528A (zh) * 2017-12-26 2018-05-08 广州广电运通金融电子股份有限公司 基于Triplet Loss的人脸认证方法、装置、计算机设备和存储介质
CN108805048A (zh) * 2018-05-25 2018-11-13 腾讯科技(深圳)有限公司 一种人脸识别模型的调整方法、装置和存储介质
CN109189961A (zh) * 2018-07-23 2019-01-11 上海斐讯数据通信技术有限公司 一种人脸识别可信度的计算方法及系统
CN109871762A (zh) * 2019-01-16 2019-06-11 平安科技(深圳)有限公司 一种人脸识别模型的评价方法和装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116092149A (zh) * 2022-11-18 2023-05-09 青岛高重信息科技有限公司 一种基于困难样本挖掘的人脸数据清洗方法
CN118447268A (zh) * 2023-09-22 2024-08-06 荣耀终端有限公司 身份识别方法、电子设备及存储介质
CN119180351A (zh) * 2024-09-23 2024-12-24 北京字跳网络技术有限公司 一种提示词的优化方法、装置、设备、介质及产品

Also Published As

Publication number Publication date
CN109871762A (zh) 2019-06-11
CN109871762B (zh) 2023-08-08

Similar Documents

Publication Publication Date Title
WO2020147408A1 (zh) 一种人脸识别模型的评价方法、装置、存储介质及计算机设备
CN108197532B (zh) 人脸识别的方法、装置及计算机装置
CN107742100B (zh) 一种考生身份验证方法及终端设备
JP6624794B2 (ja) 画像処理装置、画像処理方法及びプログラム
CN111104867A (zh) 基于部件分割的识别模型训练、车辆重识别方法及装置
CN107944020A (zh) 人脸图像查找方法及装置、计算机装置和存储介质
US12223647B2 (en) Method for identifying body constitution in traditional chinese medicine, and computing and processing device and non-transitory computer-readable medium thereof
CN110197146A (zh) 基于深度学习的人脸图像分析方法、电子装置及存储介质
WO2018228218A1 (zh) 身份识别方法、计算设备及存储介质
WO2021169641A1 (zh) 人脸识别方法和系统
WO2019200702A1 (zh) 去网纹系统训练方法、去网纹方法、装置、设备及介质
CN110941978A (zh) 一种未识别身份人员的人脸聚类方法、装置及存储介质
WO2022126464A1 (zh) 一种人脸识别方法、机器人及存储介质
CN113762042B (zh) 视频识别方法、装置、设备以及存储介质
CN114627424A (zh) 一种基于视角转化的步态识别方法和系统
CN114078271B (zh) 阈值确定方法、目标人员识别方法、装置、设备及介质
CN114155578A (zh) 人像聚类方法、装置、电子设备和存储介质
CN110321935B (zh) 业务事件关系确定方法及装置、计算机可读存储介质
WO2021135863A1 (zh) 一种图像识别方法及装置
CN111666976A (zh) 基于属性信息的特征融合方法、装置和存储介质
CN116797510B (zh) 图像处理方法、装置、计算机设备和存储介质
CN118379586B (zh) 关键点预测模型的训练方法、装置、设备、介质及产品
CN114817607A (zh) 一种图像检测方法、装置、设备及存储介质
CN109815353B (zh) 一种基于类中心的人脸检索方法及系统
CN119360244A (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: 19910884

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS (EPO FORM 1205A DATED 07.09.2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19910884

Country of ref document: EP

Kind code of ref document: A1