[go: up one dir, main page]

WO2016177259A1 - Similar image recognition method and device - Google Patents

Similar image recognition method and device Download PDF

Info

Publication number
WO2016177259A1
WO2016177259A1 PCT/CN2016/079158 CN2016079158W WO2016177259A1 WO 2016177259 A1 WO2016177259 A1 WO 2016177259A1 CN 2016079158 W CN2016079158 W CN 2016079158W WO 2016177259 A1 WO2016177259 A1 WO 2016177259A1
Authority
WO
WIPO (PCT)
Prior art keywords
image
identified
feature
normalized
distance
Prior art date
Application number
PCT/CN2016/079158
Other languages
French (fr)
Chinese (zh)
Inventor
陈岳峰
Original Assignee
阿里巴巴集团控股有限公司
陈岳峰
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 阿里巴巴集团控股有限公司, 陈岳峰 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016177259A1 publication Critical patent/WO2016177259A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures

Definitions

  • the present application relates to the field of communications technologies, and in particular, to a similar image recognition method.
  • the application also relates to a similar image recognition device.
  • the traditional face authentication method is mainly based on SIFT (Scale-invariant feature transform), LBP (Local Binary Patterns) and other features to describe the photos and the faces in the existing photos. Then, through the classifier, it is judged whether the two faces are the same person, wherein SIFT is a local feature descriptor for the field of image processing, and the description has scale invariance and can detect key points in the image, and the SIFT feature is Regardless of the size and rotation of the image based on some local appearance of interest points on the object, the tolerance for light, noise, and slight viewing angle changes is also quite high; LBP is an effective texture description operator that can measure and extract images. Local texture information, which is invariant to illumination.
  • SIFT Scale-invariant feature transform
  • LBP Local Binary Patterns
  • the prior art has the following disadvantages: the traditional feature-based face authentication algorithm often extracts high-dimensional features from the face region and uses a classifier. Face authentication. Such algorithms are often only targeted at face features. Don't notice the pictures or photos to be effective. In the case that the background is complicated and the face changes greatly, the recognition technology in the prior art often cannot accurately pass the images in the two photos to be the same person. Therefore, how to ensure the recognition accuracy is The fast and efficient recognition of the image to be detected and the existing image has become a technical problem to be solved by those skilled in the art.
  • the present application provides a similar image recognition method for quickly and efficiently identifying an image to be detected and an existing image under the premise of ensuring accuracy, and the method includes:
  • a metric distance between the normalized image and a normalized image of the second image to be recognized the metric distance being characterized according to the normalized image and the normalized image of the second image to be recognized Distance generation in space, wherein the distance of the similar normalized image in the feature space is less than the distance of the non-similar normalized image in the feature space;
  • the metric distance is less than or equal to the threshold, confirming that the first to-be-identified image is similar to a specified feature of the second to-be-identified image.
  • the area to be compared corresponding to the specified feature in the first to-be-identified image is obtained, specifically:
  • the key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-contrast area are obtained by a preset key point regression model.
  • the image in the area to be identified is aligned with a preset standard image, specifically:
  • the parameter M is generated according to coordinates of each key point of the standard image and key point coordinates of an image corresponding to the specified feature in the labeled image.
  • the method further includes:
  • the resolution of the normalized image is adjusted to a preset resolution.
  • determining a metric distance between the normalized image and the normalized image of the second to-be-identified image is specifically:
  • the designated feature is specifically a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • the convolutional neural network parameters are trained according to an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  • the present application also proposes a similar image recognition device, including:
  • An acquiring module configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image
  • An alignment module configured to align an image in the area to be identified with a preset standard image, And using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the designated feature;
  • a determining module configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the Calculating a distance of the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space;
  • An identification module configured to confirm, when the metric distance is greater than a preset threshold, that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and that the metric distance is less than or equal to the threshold It is confirmed that the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
  • the determining module is specifically configured to:
  • the alignment module is specifically configured to:
  • the method further comprises:
  • an adjustment module configured to adjust a resolution of the normalized image to a preset resolution.
  • the obtaining module is specifically configured to:
  • the designated feature is specifically a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • the convolutional neural network parameters are trained according to an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  • the present application also proposes a similar image recognition method, which is applied to a client, and includes the following steps:
  • the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
  • the client presents the authentication result to the user according to the identity authentication response.
  • the user identity authentication request is received, specifically:
  • the identity authentication response is an identity authentication success response or an identity authentication failure response, and further includes:
  • the identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
  • the identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
  • the authentication result is displayed to the user according to the identity authentication response, specifically:
  • the user When receiving the identity authentication failure response, the user is presented with a preset interface corresponding to the identity authentication failure response, and prompting the user whether the manual verification is required.
  • the method further includes:
  • the identity authentication request is sent to a preset server.
  • the application also proposes a client, including:
  • a receiving module configured to receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
  • a sending module configured to send the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
  • a receiving module configured to receive an identity authentication response sent by the server
  • a display module configured to display the authentication result to the user according to the identity authentication response.
  • the receiving module is specifically configured to:
  • the identity authentication response is an identity authentication success response or an identity authentication failure response. Also includes:
  • the identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
  • the identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
  • the displaying module is configured to: when the receiving module receives the identity authentication success response, display the preset interface corresponding to the identity authentication success response to the user;
  • the displaying module is specifically configured to: when the receiving module receives the identity authentication failure response, display, to the user, a preset interface corresponding to the identity authentication failure response, and to the user Show tips for manual verification.
  • the receiving module when the display module displays the preset interface corresponding to the identity authentication failure response to the user and prompts the user whether the manual verification is required, the receiving module further receives the The manual verification request of the user, the receiving module instructing the sending module to send the identity authentication request to a preset server.
  • the present application also proposes a similar image recognition method, which is applied to a server, and includes the following steps:
  • the metric distance is generated according to a distance of the normalized image and the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is less than a non-similar The normalized image of the distance in the feature space;
  • metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image, and return an identity verification failure response to the client;
  • the metric distance is less than or equal to the threshold, confirm that the first to-be-identified image is similar to the specified feature of the second to-be-identified image, and return an identity verification success response to the client.
  • the area to be compared corresponding to the specified feature in the first to-be-identified image is obtained, specifically:
  • the key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-contrast area are obtained by a preset key point regression model.
  • the image in the area to be identified is aligned with a preset standard image, specifically:
  • the parameter M is generated according to coordinates of each key point of the standard image and key point coordinates of an image corresponding to the specified feature in the labeled image.
  • the method further includes:
  • the resolution of the normalized image is adjusted to a preset resolution.
  • determining a metric distance between the normalized image and the normalized image of the second to-be-identified image is specifically:
  • the specified feature is mapped to Solving the feature value after the space, and using the feature value as the feature value of the normalized image;
  • the designated feature is specifically a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • the convolutional neural network parameters are trained according to an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  • a server including:
  • a querying module configured to query, according to the authentication information, a second to-be-identified image corresponding to the user
  • An acquiring module configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image
  • An alignment module configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Specify the feature correspondence;
  • a determining module configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the Calculating a distance of the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space;
  • An identification module configured to confirm, when the metric distance is greater than a preset threshold, that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and that the metric distance is less than or When the threshold is equal to the confirmation, the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
  • a sending module configured to return an identity verification failure response to the client when the identification module confirms that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and confirm in the identification module And returning the identity verification success response to the client when the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
  • the determining module is specifically configured to:
  • the alignment module is specifically configured to map coordinates of each key point of the to-be-identified area to key point coordinates of the aligned image according to the parameter M, wherein the parameter M is a key according to the standard image. Point coordinates and keypoint coordinates of the image corresponding to the specified feature in the annotated image.
  • the method further comprises:
  • an adjustment module configured to adjust a resolution of the normalized image to a preset resolution.
  • the obtaining module is specifically configured to:
  • the designated feature is specifically a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • the convolutional neural network parameters are obtained according to the labeled image training, and the labeled
  • the annotation image includes a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  • the area to be identified is to be recognized.
  • the resolution of the aligned image is adjusted to a preset resolution, and the adjusted image is used as a normalized image, and finally the normalized image of the first image to be recognized and the normalized image of the second image to be recognized are acquired.
  • the metric distance between the images determines whether the specified features of the first to-be-identified image and the second to-be-identified image are similar according to a size between the metric distance and the preset threshold. Therefore, under the premise of ensuring accuracy, the similarity between the image to be detected and another image to be detected is quickly and efficiently identified, which provides a reference for improving the security of the existing system.
  • FIG. 1 is a schematic flow chart of a similar image recognition method proposed in the present application.
  • FIG. 2 is a structural diagram of a convolutional neural network for training face feature point positioning in a specific embodiment of the present application
  • FIG. 3 is a schematic flowchart of performing depth metric learning in a specific embodiment of the present application.
  • FIG. 4 is a structural diagram of a convolutional neural network for training face authentication in a specific embodiment of the present application
  • FIG. 5 is a schematic flowchart of a similar image recognition performed by a client in a specific embodiment of the present application.
  • FIG. 6 is a schematic flowchart of performing similar image recognition by a server in a specific embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a similar image recognition device according to the present application.
  • FIG. 8 is a schematic structural diagram of a client according to the present application.
  • FIG. 9 is a schematic structural diagram of a server according to the present application.
  • the present application proposes a recognition method for similar images, which can be implemented by means of a computer device in a network environment.
  • the main purpose of judging the similarity is the server in the background of the system, and the client-oriented client is either a mobile device compatible with key input and touch screen input, or a PC device, and the client and the server are wired or A wireless way to achieve network connectivity.
  • a schematic flowchart of a similar image recognition method proposed in the present application includes the following steps:
  • the area to be compared can be obtained by determining the key point coordinates (related to the face). Specifically, in determining a region to be compared corresponding to the specified feature in the first to-be-identified image, the to-be-contrast region in the first to-be-identified image may be first determined according to a detection algorithm corresponding to the specified feature.
  • the key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-compared area are obtained by using a preset key point regression model, so as to accurately determine the area to be compared.
  • the designated feature may be a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • a deep convolutional neural network is used to implement regression of face key points.
  • the structure of the neural network in this embodiment is as shown in FIG. 2, and includes four convolution layers and two fully connected layers.
  • the first three convolutional layers contain the maximum pooling operation, and the last convolutional layer contains only the convolution operation.
  • the first fully connected layer contains 100 nodes, and the second is fully connected to have 10 nodes, representing the coordinates of the five key points of the face.
  • Regression uses the Euclidean distance as the loss function, and the expression is as follows:
  • x represents the coordinates of the key points of the annotation, representing the coordinates of the key points predicted by the convolutional neural network.
  • the specific embodiment uses a stochastic gradient descent algorithm to optimize the parameters in the model, thereby training to obtain a model for predicting key points of the face.
  • this step maps the coordinates of each key point of the to-be-identified area to the key point coordinates of the aligned image according to the parameter M, wherein the parameter M is the coordinate of each key point according to the standard image and the labeled image
  • the key point coordinates of the image corresponding to the specified feature are generated.
  • the specific embodiment defines five key point positions in the standard human face, which are the left eye, the right eye, the nose, the left mouth corner, and the right mouth corner position, and are detected by The face is rotated, panned, and scaled to align to a standard face. Assuming that the position of the feature point in the standard face is (x, y) and the position of the predicted feature point is (x', y'), then the relationship between the two is:
  • 4 equations are needed.
  • the specific embodiment maps five points, establishes a linear equation group, and calculates a system of linear equations by the least squares method of the linear equations. details as follows:
  • the above process is a detailed generation process of the parameter M.
  • Those skilled in the art can perform alignment processing on the face image according to the parameter M.
  • other improved implementation manners that can obtain the parameter M are all within the protection scope of the present application.
  • the comparison result is more accurate.
  • the application needs to align the image in the area to be identified with the preset standard image.
  • this step aligns the face to a standard face, and those skilled in the art can set the face of the standard based on existing comparison criteria, which are all within the scope of the present application. .
  • the present application adjusts the resolution of the normalized image to a preset resolution.
  • the step will be the face key.
  • the point coordinate information is normalized to the 39x39 scale space.
  • a specified feature in the normalized image is first extracted by a convolutional neural network, and then the specified feature is mapped to the convolutional neural network and the distance metric loss function.
  • the feature value after the feature space, and the feature value is used as the feature value of the normalized image, and finally determining the feature value of the normalized image and the feature of the normalized image of the second image to be recognized
  • the Euclidean distance between the values, the Euclidean distance is taken as the metric distance.
  • the technical solution of the present application combines a deep convolutional neural network and metric learning to train a face authentication model.
  • Deep convolutional neural networks are widely used in the field of image understanding, including image classification, image retrieval, target detection, and face recognition.
  • the convolutional neural network has a feature self-learning, and the model generalization ability is good.
  • Metric learning is a linear or non-linear mapping of feature spaces such that the same face feature distance is less than a different face feature distance.
  • the convolutional neural network parameters are obtained according to the labeled image training, and the labeled image includes a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  • sample pairing is performed in a pair-wise manner, and each sample includes two portrait images, if two images are in the image Not the same person, indicating a negative sample, if the same person is expressed as Positive sample.
  • a positive sample is generated by combining two pictures belonging to the same person, and a negative sample is generated by a picture that is not the same person.
  • the depth metric learning mainly consists of two parts. One of them is the parameter W, which represents the parameters of the resulting convolutional neural network that need to be trained, and the other is the distance metric loss function. Different from traditional face recognition, the input of this application is 2 faces, and the final loss is also the distance between 2 faces in the feature space.
  • the structure of the convolutional neural network used in this embodiment is as shown in FIG.
  • metric learning is to find a transformation space in which the distance of similar samples is reduced, and the distance between different types of samples is increased. Therefore, this step first searches for a nonlinear transformation through metric learning, transforming the face from the original pixel to a feature space, so that the similar face distance is small and the dissimilar face distance is large in this space. Then the facial features are extracted by the deep convolutional neural network. Finally, the features learned by the convolutional neural network are mapped to a feature space in combination with metric learning. Since the convolutional neural network continues the non-linear mapping of the face image, the feature expression thus obtained is more robust than the artificially designed feature, and the face authentication accuracy is higher.
  • the resulting 100-dimensional feature will be subjected to metric learning, and the loss function employed in the process is as follows:
  • the parameter W of the model can be obtained by minimizing the loss function.
  • the technician can use the chain derivation rule to obtain the gradient of the corresponding parameter and use the stochastic gradient descent method (SGD) to optimize the parameters of the calculation model.
  • SGD stochastic gradient descent method
  • Other calculation models capable of achieving the optimization effect are also within the protection scope of the present application.
  • the faces in the map are respectively detected, and feature point extraction and face alignment are performed according to the face region.
  • the feature extraction is performed and the feature is mapped into the space of 100 dimensions.
  • the Euclidean distance of the two facial features is calculated. When the distance is greater than or equal to ⁇ , it means that it is not the same person, otherwise it is the same person.
  • the process can be completed by the client and the server.
  • the user can use a mobile terminal such as a smart phone or a tablet to upload images and information, and also upload images and related information through the PC terminal.
  • the server may be a data server or a web server pre-configured by the system operator.
  • the client As a link between the user and the server, the client is mainly used to forward the user's input content to the server, and the server verifies the identity of the user according to the content input by the user, and finally the client displays the verification result according to the server.
  • the following first introduces the similar image recognition method on the client side, as shown in FIG. 5, including the following steps:
  • S501 Receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user.
  • the form of the client is not limited, and the client may be a PC device or a mobile device. However, both can provide the user with the function of image uploading and information input. Specifically, the client first acquires the image uploaded by the user and the information input by the user, and then uses the image as the first image to be recognized, and Using the information as the authentication information, and finally generating the identity authentication request according to the first to-be-identified image and the authentication information.
  • the server may obtain the second to-be-identified image corresponding to the user according to the data.
  • the server queries the database for the image in the user ID according to the identity information provided by the user, and uses the image as the second image to be identified, thereby determining whether the image uploaded by the user is the same as the ID card. Image matching.
  • the identity authentication response is an identity authentication success response or an identity authentication failure response, wherein the identity authentication success response is that the server confirms that the first to-be-identified image is similar to the specified feature of the second to-be-identified image. And then generated, and the identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
  • the client When the client receives the identity authentication success response, the client displays the preset interface corresponding to the identity authentication success response to the user;
  • the client when the client receives the identity authentication failure response, the client displays the preset interface corresponding to the identity authentication failure response to the user, and shows whether the user needs to perform Manually verified prompt information.
  • the present application automatically judges a group of images to be recognized by the device, in order to further avoid the influence of the error, when the failure response is returned to the user, the prompt information indicating whether manual verification is required is simultaneously displayed to the user. . If the user thinks that the manual review needs to be resubmitted, then the client re-advertises the manual verification request, and after receiving the manual verification request from the user, the client sends the identity authentication request to the preset server.
  • the above is the process of the client, and is mainly used to implement the interaction between the user and the server.
  • the following embodiment is a similar image recognition method on the server side, as shown in FIG. 6, including the following steps:
  • S605. Determine a metric distance between the normalized image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the normalized image of the second to-be-identified image a distance generation in the feature space, wherein a distance of the similar normalized image in the feature space is less than a distance of the non-similar normalized image in the feature space;
  • the present application also proposes a similar image recognition device, as shown in FIG. 7, comprising:
  • the obtaining module 710 is configured to obtain an area to be compared corresponding to the specified feature in the first to-be-identified image
  • the aligning module 720 is configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Corresponding to the specified feature;
  • a determining module 730 configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and A normalized image of the second image to be identified is generated in a distance in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a non-similar normalized image in the feature Distance of space;
  • the identification module 740 is configured to confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image when the metric distance is greater than a preset threshold, and that the metric distance is less than or equal to the The threshold is confirmed to be similar to the specified feature of the second image to be recognized.
  • the determining module is specifically configured to:
  • the alignment module is specifically configured to:
  • an adjustment module configured to adjust a resolution of the normalized image to a preset resolution.
  • the acquiring module is specifically configured to:
  • the designated feature is specifically a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • the convolutional neural network parameters are obtained according to the labeled image, and the labeled image includes normalized images with specified features being similar to each other and designated features are not mutually exclusive. A similar normalized image.
  • the application also proposes a client, as shown in FIG. 8, comprising:
  • the receiving module 810 is configured to receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
  • the sending module 820 is configured to send the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
  • the receiving module 810 is further configured to receive an identity authentication response sent by the server.
  • the displaying module 830 is configured to display the authentication result to the user according to the identity authentication response.
  • the receiving module is specifically configured to:
  • the identity authentication response is an identity authentication success response or an identity authentication failure response, and further includes:
  • the identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
  • the identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
  • the displaying module is specifically configured to: when the receiving module receives the identity authentication success response, display the preset interface corresponding to the identity authentication success response to the user; Or the displaying module is specifically configured to: when the receiving module receives the identity authentication failure response, display, to the user, a preset interface corresponding to the identity authentication failure response, and to the user Show tips for manual verification.
  • the receiving module displays to the user in the display module Receiving a manual verification request corresponding to the identity authentication failure response and a prompt to the user to indicate whether manual verification is required, the receiving module instructing the sending module to The identity authentication request is sent to the preset server.
  • the embodiment of the present application further provides a server, as shown in FIG. 9, including:
  • the receiving module 910 is configured to receive an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
  • the querying module 920 is configured to query, according to the authentication information, a second to-be-identified image corresponding to the user;
  • the obtaining module 930 is configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image
  • An alignment module 940 configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Corresponding to the specified feature;
  • a determining module 950 configured to determine a metric distance between the normalized image of the first to-be-identified image and the normalized image of the second to-be-identified image, the metric distance according to the normalized image and a normalized image of the second image to be identified is generated in a distance in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space ;
  • the identification module 960 is configured to confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image when the metric distance is greater than a preset threshold, and that the metric distance is less than or equal to the Confirming, at the threshold, that the first to-be-identified image is similar to a specified feature of the second to-be-identified image;
  • the sending module 970 is configured to: when the identifying module confirms that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image, return an identity verification failure response to the client, and And when the identifying module confirms that the first to-be-identified image is similar to the specified feature of the second to-be-identified image, returning an identity verification success response to the client.
  • the determining module is specifically configured to:
  • the alignment module is specifically configured to:
  • an adjustment module configured to adjust a resolution of the normalized image to a preset resolution.
  • the acquiring module is specifically configured to:
  • the designated feature is specifically a face region
  • the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
  • the convolutional neural network parameters are trained according to the labeled image, and the labeled image includes a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  • the present application can be implemented in hardware or by means of software plus the necessary general hardware platform.
  • the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several The instructions are for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various implementation scenarios of the present application.
  • modules in the apparatus in the implementation scenario may be distributed in the apparatus for implementing the scenario according to the implementation scenario description, or may be correspondingly changed in one or more devices different from the implementation scenario.
  • the modules of the above implementation scenarios may be combined into one module, or may be further split into multiple sub-modules.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Medical Informatics (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Collating Specific Patterns (AREA)
  • Image Analysis (AREA)

Abstract

Disclosed is a similar image recognition method. After a to-be-compared area, corresponding to a specified feature, in a first to-be-recognized image is determined and an image in the to-be-recognized area is aligned with a preset standard image, the resolution of the aligned image in the to-be-recognized area is adjusted to a preset resolution and the adjusted image is used as a normalized image, and finally, a metric distance between the normalized image of the first to-be-recognized image and a normalized image of a second to-be-recognized image is acquired, and whether the specified features of the first to-be-recognized image and the second to-be-recognized image are similar to each other is determined according to the difference between the metric distance and a preset threshold. Thus on the premise that the accuracy is ensured, the similarity between one to-be-detected image and another to-be-detected image is recognized in a fast and efficient way, thereby providing a reference basis for improvements in the security of the existing systems.

Description

一种相似图像识别方法及设备Similar image recognition method and device 技术领域Technical field
本申请涉及通信技术领域,特别涉及一种相似图像识别方法。本申请同时还涉及一种相似图像识别设备。The present application relates to the field of communications technologies, and in particular, to a similar image recognition method. The application also relates to a similar image recognition device.
背景技术Background technique
随着互联网和计算机信息技术的发展,网络购物日渐成为人们购物的新时尚。对于访问量以及购买量都很大的销售系统来说,每天都有着上千万的商家用户通过该销售系统售卖商品,但同时也有很多不法分子假冒他人身份企图在销售系统上进行交易处理,由此可能会产生各种违规操作,从而对其他合法用户的权益造成损害。因此如何基于从商家用户上传的待检测照片和已有的备案照片判断两种照片中是否是同一个人,成为销售系统所要解决的问题之一。With the development of the Internet and computer information technology, online shopping has become a new fashion for people to shop. For sales systems with large visits and large purchases, tens of millions of merchants sell goods through the sales system every day, but there are also many criminals who impersonate others in an attempt to process transactions on the sales system. This may result in various violations that may harm the rights of other legitimate users. Therefore, it is one of the problems to be solved by the sales system to determine whether the two photos are the same person based on the photos to be detected uploaded from the merchant user and the existing record photos.
传统的人脸认证方法主要基于SIFT(Scale-invariant feature transform,尺度不变特征转换)、LBP(Local Binary Patterns,局部二值模式)等特征对待检测照片以及已有照片中的人脸进行描述,然后通过分类器来判断两个人脸是否是同一个人,其中SIFT是用于图像处理领域的一种局部特征描述子,这种描述具有尺度不变性且可在图像中检测出关键点,SIFT特征是基于物体上的一些局部外观的兴趣点而与影像的大小和旋转无关,对于光线、噪声、些微视角改变的容忍度也相当高;LBP为一种有效的纹理描述算子,能够度量和提取图像局部的纹理信息,对光照具有不变性。The traditional face authentication method is mainly based on SIFT (Scale-invariant feature transform), LBP (Local Binary Patterns) and other features to describe the photos and the faces in the existing photos. Then, through the classifier, it is judged whether the two faces are the same person, wherein SIFT is a local feature descriptor for the field of image processing, and the description has scale invariance and can detect key points in the image, and the SIFT feature is Regardless of the size and rotation of the image based on some local appearance of interest points on the object, the tolerance for light, noise, and slight viewing angle changes is also quite high; LBP is an effective texture description operator that can measure and extract images. Local texture information, which is invariant to illumination.
然而,在实现本申请的过程中,发明人发现现有技术存在着以下缺点:传统的基于特征描述的人脸认证算法往往通过对人脸区域提取高维度的特征,通过分类器的方式来进行人脸认证。这类算法往往只有针对人脸特征特 别明显的图片或照片才有效果。在背景比较复杂,人脸变化较大的情况下,现有技术中的识别技术往往无法准确的通过两张照片中的图像是否为同一个人,因此,如何在保证识别准确度的前提下,针对待检测图像与已有的图像进行快速高效的识别,成为本领域技术人员亟待解决的技术问题。However, in the process of implementing the present application, the inventors have found that the prior art has the following disadvantages: the traditional feature-based face authentication algorithm often extracts high-dimensional features from the face region and uses a classifier. Face authentication. Such algorithms are often only targeted at face features. Don't notice the pictures or photos to be effective. In the case that the background is complicated and the face changes greatly, the recognition technology in the prior art often cannot accurately pass the images in the two photos to be the same person. Therefore, how to ensure the recognition accuracy is The fast and efficient recognition of the image to be detected and the existing image has become a technical problem to be solved by those skilled in the art.
发明内容Summary of the invention
本申请提供了一种相似图像识别方法,用于在保证准确性的前提下,针对待检测图像与已有的图像进行快速高效的识别,该方法包括:The present application provides a similar image recognition method for quickly and efficiently identifying an image to be detected and an existing image under the premise of ensuring accuracy, and the method includes:
获取第一待识别图像中与指定特征对应的待对比区域;Obtaining an area to be compared corresponding to the specified feature in the first to-be-identified image;
将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;Aligning an image in the to-be-identified area with a preset standard image, and using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the specified feature;
确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;Determining a metric distance between the normalized image and a normalized image of the second image to be recognized, the metric distance being characterized according to the normalized image and the normalized image of the second image to be recognized Distance generation in space, wherein the distance of the similar normalized image in the feature space is less than the distance of the non-similar normalized image in the feature space;
若所述度量距离大于预设的阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征不相似;If the metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image;
若所述度量距离小于或等于所述阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征相似。And if the metric distance is less than or equal to the threshold, confirming that the first to-be-identified image is similar to a specified feature of the second to-be-identified image.
优选地,获取第一待识别图像中与指定特征对应的待对比区域,具体为:Preferably, the area to be compared corresponding to the specified feature in the first to-be-identified image is obtained, specifically:
根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域;Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature;
通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。 The key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-contrast area are obtained by a preset key point regression model.
优选地,将所述待识别区域中的图像与预设的标准图像进行对齐,具体为:Preferably, the image in the area to be identified is aligned with a preset standard image, specifically:
根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标;Mapping the coordinates of each key point of the to-be-identified area to the key point coordinates of the aligned image according to the parameter M;
其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。The parameter M is generated according to coordinates of each key point of the standard image and key point coordinates of an image corresponding to the specified feature in the labeled image.
优选地,在将对齐后的图像作为所述第一待识别图像的归一化图像之后,还包括:Preferably, after the aligned image is used as the normalized image of the first to-be-identified image, the method further includes:
将所述归一化图像的分辨率调整至预设的分辨率。The resolution of the normalized image is adjusted to a preset resolution.
优选地,确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,具体为:Preferably, determining a metric distance between the normalized image and the normalized image of the second to-be-identified image is specifically:
通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
优选地,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。Preferably, the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
优选地,所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。Preferably, the convolutional neural network parameters are trained according to an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
相应的,本申请还提出了一种相似图像识别设备,包括:Correspondingly, the present application also proposes a similar image recognition device, including:
获取模块,用于获取第一待识别图像中与指定特征对应的待对比区域;An acquiring module, configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image;
对齐模块,用于将所述待识别区域中的图像与预设的标准图像进行对齐, 并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;An alignment module, configured to align an image in the area to be identified with a preset standard image, And using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the designated feature;
确定模块,用于确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;a determining module, configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the Calculating a distance of the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space;
识别模块,用于在所述度量距离大于预设的阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,以及在所述度量距离小于或等于所述阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征相似。An identification module, configured to confirm, when the metric distance is greater than a preset threshold, that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and that the metric distance is less than or equal to the threshold It is confirmed that the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
优选地,所述确定模块具体用于:Preferably, the determining module is specifically configured to:
根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature, and acquiring a plurality of keys in the to-be-contrast area and the specified feature by using a preset key point regression model The key point coordinates corresponding to the point feature.
优选地,所述对齐模块具体用于:Preferably, the alignment module is specifically configured to:
根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。Mapping each key point coordinate of the to-be-identified area to a key point coordinate of the aligned image according to the parameter M, wherein the parameter M is according to each key point coordinate of the standard image and the labeled image Specifies the keypoint coordinates of the image corresponding to the feature.
优选地,还包括:Preferably, the method further comprises:
调整模块,用于将所述归一化图像的分辨率调整至预设的分辨率。And an adjustment module, configured to adjust a resolution of the normalized image to a preset resolution.
优选地,所述获取模块具体用于:Preferably, the obtaining module is specifically configured to:
通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值; Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
优选地,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。Preferably, the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
优选地,所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。Preferably, the convolutional neural network parameters are trained according to an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
相应的,本申请还提出了一种相似图像识别方法,该方法应用于客户端,包括以下步骤:Correspondingly, the present application also proposes a similar image recognition method, which is applied to a client, and includes the following steps:
接收用户的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;Receiving an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
将所述身份认证请求发送至服务器,以使所述服务器根据所述认证信息获取与所述用户对应的第二待识别图像;Sending the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
接收所述服务器发送的身份认证响应;Receiving an identity authentication response sent by the server;
所述客户端根据所述身份认证响应向所述用户展示认证结果。The client presents the authentication result to the user according to the identity authentication response.
优选地,接收用户的身份认证请求,具体为:Preferably, the user identity authentication request is received, specifically:
获取所述用户上传的图像以及所述用户输入的信息;Obtaining an image uploaded by the user and information input by the user;
将所述图像作为所述第一待识别图像,以及将所述信息作为所述认证信息;Using the image as the first to-be-identified image, and using the information as the authentication information;
根据所述第一待识别图像以及所述认证信息生成所述身份认证请求。And generating the identity authentication request according to the first to-be-identified image and the authentication information.
优选地,所述身份认证响应为身份认证成功响应或身份认证失败响应,还包括:Preferably, the identity authentication response is an identity authentication success response or an identity authentication failure response, and further includes:
所述身份认证成功响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征相似之后生成的; The identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
所述身份认证失败响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征不相似之后生成的。The identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
优选地,根据所述身份认证响应向所述用户展示认证结果,具体为:Preferably, the authentication result is displayed to the user according to the identity authentication response, specifically:
当接收到所述身份认证成功响应时,向所述用户展示预设的与所述身份认证成功响应对应的界面;When receiving the identity authentication success response, displaying, by the user, a preset interface corresponding to the identity authentication success response;
当接收到所述身份认证失败响应时,向所述用户展示预设的与所述身份认证失败响应对应的界面,以及向所述用户展示是否需要进行人工验证的提示信息。When receiving the identity authentication failure response, the user is presented with a preset interface corresponding to the identity authentication failure response, and prompting the user whether the manual verification is required.
优选地,在向所述用户展示预设的与所述身份认证失败响应对应的界面以及向所述用户展示是否需要进行人工验证的提示之后,还包括:Preferably, after the user is presented with a preset interface corresponding to the identity authentication failure response and a prompt to the user to indicate whether manual verification is required, the method further includes:
若接收到所述用户的人工验证请求,将所述身份认证请求发送至预设的服务端。And if the manual verification request of the user is received, the identity authentication request is sent to a preset server.
相应的,本申请还提出了一种客户端,包括:Correspondingly, the application also proposes a client, including:
接收模块,用于接收用户的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;a receiving module, configured to receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
发送模块,用于将所述身份认证请求发送至服务器,以使所述服务器根据所述认证信息获取与所述用户对应的第二待识别图像;a sending module, configured to send the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
接收模块,用于接收所述服务器发送的身份认证响应;a receiving module, configured to receive an identity authentication response sent by the server;
展示模块,用于根据所述身份认证响应向所述用户展示认证结果。And a display module, configured to display the authentication result to the user according to the identity authentication response.
优选地,所述接收模块具体用于:Preferably, the receiving module is specifically configured to:
获取所述用户上传的图像以及所述用户输入的信息,将所述图像作为所述第一待识别图像,以及将所述信息作为所述认证信息,根据所述第一待识别图像以及所述认证信息生成所述身份认证请求。Acquiring the image uploaded by the user and the information input by the user, using the image as the first image to be recognized, and using the information as the authentication information, according to the first image to be recognized and the The authentication information generates the identity authentication request.
优选地,所述身份认证响应为身份认证成功响应或身份认证失败响应, 还包括:Preferably, the identity authentication response is an identity authentication success response or an identity authentication failure response. Also includes:
所述身份认证成功响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征相似之后生成的;The identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
所述身份认证失败响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征不相似之后生成的。The identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
优选地,所述展示模块,具体用于在当所述接收模块接收到所述身份认证成功响应时,向所述用户展示预设的与所述身份认证成功响应对应的界面;Preferably, the displaying module is configured to: when the receiving module receives the identity authentication success response, display the preset interface corresponding to the identity authentication success response to the user;
或,所述展示模块,具体用于在当所述接收模块接收到所述身份认证失败响应时,向所述用户展示预设的与所述身份认证失败响应对应的界面,以及向所述用户展示是否需要进行人工验证的提示信息。Or the displaying module is specifically configured to: when the receiving module receives the identity authentication failure response, display, to the user, a preset interface corresponding to the identity authentication failure response, and to the user Show tips for manual verification.
优选地,当所述接收模块在所述展示模块向所述用户展示预设的与所述身份认证失败响应对应的界面以及向所述用户展示是否需要进行人工验证的提示之后,还接收到所述用户的人工验证请求,所述接收模块指示所述发送模块将所述身份认证请求发送至预设的服务端。Preferably, when the display module displays the preset interface corresponding to the identity authentication failure response to the user and prompts the user whether the manual verification is required, the receiving module further receives the The manual verification request of the user, the receiving module instructing the sending module to send the identity authentication request to a preset server.
相应的,本申请还提出了一种相似图像识别方法,该方法应用于服务器,包括以下步骤:Correspondingly, the present application also proposes a similar image recognition method, which is applied to a server, and includes the following steps:
接收由所述客户端发送的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;Receiving an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
根据所述认证信息查询与所述用户对应的第二待识别图像;Querying, according to the authentication information, a second to-be-identified image corresponding to the user;
获取第一待识别图像中与指定特征对应的待对比区域;Obtaining an area to be compared corresponding to the specified feature in the first to-be-identified image;
将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;Aligning an image in the to-be-identified area with a preset standard image, and using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the specified feature;
确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离, 所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;Determining a metric distance between the normalized image and the normalized image of the second image to be recognized, The metric distance is generated according to a distance of the normalized image and the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is less than a non-similar The normalized image of the distance in the feature space;
若所述度量距离大于预设的阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,并向所述客户端返回身份验证失败响应;If the metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image, and return an identity verification failure response to the client;
若所述度量距离小于或等于所述阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征相似,并向所述客户端返回身份验证成功响应。If the metric distance is less than or equal to the threshold, confirm that the first to-be-identified image is similar to the specified feature of the second to-be-identified image, and return an identity verification success response to the client.
优选地,获取第一待识别图像中与指定特征对应的待对比区域,具体为:Preferably, the area to be compared corresponding to the specified feature in the first to-be-identified image is obtained, specifically:
根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域;Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature;
通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。The key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-contrast area are obtained by a preset key point regression model.
优选地,将所述待识别区域中的图像与预设的标准图像进行对齐,具体为:Preferably, the image in the area to be identified is aligned with a preset standard image, specifically:
根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标;Mapping the coordinates of each key point of the to-be-identified area to the key point coordinates of the aligned image according to the parameter M;
其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。The parameter M is generated according to coordinates of each key point of the standard image and key point coordinates of an image corresponding to the specified feature in the labeled image.
优选地,在将对齐后的图像作为所述第一待识别图像的归一化图像之后,还包括:Preferably, after the aligned image is used as the normalized image of the first to-be-identified image, the method further includes:
将所述归一化图像的分辨率调整至预设的分辨率。The resolution of the normalized image is adjusted to a preset resolution.
优选地,确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,具体为:Preferably, determining a metric distance between the normalized image and the normalized image of the second to-be-identified image is specifically:
通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特 征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the specified feature is mapped to Solving the feature value after the space, and using the feature value as the feature value of the normalized image;
确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
优选地,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。Preferably, the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
优选地,所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。Preferably, the convolutional neural network parameters are trained according to an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
相应的,本申请还提出了一种服务器,包括:Correspondingly, the present application also proposes a server, including:
接收模块,用接收由所述客户端发送的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;Receiving, by the receiving module, an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
查询模块,用于根据所述认证信息查询与所述用户对应的第二待识别图像;a querying module, configured to query, according to the authentication information, a second to-be-identified image corresponding to the user;
获取模块,用于获取第一待识别图像中与指定特征对应的待对比区域;An acquiring module, configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image;
对齐模块,用于将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;An alignment module, configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Specify the feature correspondence;
确定模块,用于确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;a determining module, configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the Calculating a distance of the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space;
识别模块,用于在所述度量距离大于预设的阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,以及在所述度量距离小于或 等于所述阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征相似;An identification module, configured to confirm, when the metric distance is greater than a preset threshold, that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and that the metric distance is less than or When the threshold is equal to the confirmation, the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
发送模块,用于在所述识别模块确认所述第一待识别图像与所述第二待识别图像的指定特征不相似时向所述客户端返回身份验证失败响应,以及在所述识别模块确认所述第一待识别图像与所述第二待识别图像的指定特征相似时向所述客户端返回身份验证成功响应。a sending module, configured to return an identity verification failure response to the client when the identification module confirms that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and confirm in the identification module And returning the identity verification success response to the client when the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
优选地,所述确定模块具体用于:Preferably, the determining module is specifically configured to:
根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature, and acquiring a plurality of keys in the to-be-contrast area and the specified feature by using a preset key point regression model The key point coordinates corresponding to the point feature.
优选地,所述对齐模块具体用于根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。Preferably, the alignment module is specifically configured to map coordinates of each key point of the to-be-identified area to key point coordinates of the aligned image according to the parameter M, wherein the parameter M is a key according to the standard image. Point coordinates and keypoint coordinates of the image corresponding to the specified feature in the annotated image.
优选地,还包括:Preferably, the method further comprises:
调整模块,用于将所述归一化图像的分辨率调整至预设的分辨率。And an adjustment module, configured to adjust a resolution of the normalized image to a preset resolution.
优选地,所述获取模块具体用于:Preferably, the obtaining module is specifically configured to:
通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
优选地,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。Preferably, the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
优选地,所述卷积神经网络参数是根据已标注图像训练得到,所述已标 注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。Preferably, the convolutional neural network parameters are obtained according to the labeled image training, and the labeled The annotation image includes a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
由此可见,通过应用本申请的技术方案,在确定第一待识别图像中与指定特征对应的待对比区域并将待识别区域中的图像与预设的标准图像进行对齐后,即将待识别区域中对齐后的图像的分辨率调整至预设的分辨率,以及将调整后的图像作为归一化图像,最后获取第一待识别图像的归一化图像与第二待识别图像的归一化图像之间的度量距离,根据度量距离与预设的阈值之间的大小确定第一待识别图像与第二待识别图像的指定特征是否相似。从而在保证准确性的前提下,针对待检测图像与另一待检测图像之间的相似度进行快速高效的识别,为提高现有的系统的安全性提供了参考依据。It can be seen that, by applying the technical solution of the present application, after determining the to-be-compared area corresponding to the specified feature in the first to-be-identified image and aligning the image in the to-be-identified area with the preset standard image, the area to be identified is to be recognized. The resolution of the aligned image is adjusted to a preset resolution, and the adjusted image is used as a normalized image, and finally the normalized image of the first image to be recognized and the normalized image of the second image to be recognized are acquired. The metric distance between the images determines whether the specified features of the first to-be-identified image and the second to-be-identified image are similar according to a size between the metric distance and the preset threshold. Therefore, under the premise of ensuring accuracy, the similarity between the image to be detected and another image to be detected is quickly and efficiently identified, which provides a reference for improving the security of the existing system.
附图说明DRAWINGS
图1为本申请提出的一种相似图像识别方法的流程示意图;1 is a schematic flow chart of a similar image recognition method proposed in the present application;
图2为本申请具体实施例中训练人脸特征点定位的卷积神经网络结构图;2 is a structural diagram of a convolutional neural network for training face feature point positioning in a specific embodiment of the present application;
图3为本申请具体实施例中进行深度度量学习的流程示意图;3 is a schematic flowchart of performing depth metric learning in a specific embodiment of the present application;
图4为本申请具体实施例中训练人脸认证的卷积神经网络结构图;4 is a structural diagram of a convolutional neural network for training face authentication in a specific embodiment of the present application;
图5为本申请具体实施例中客户端进行相似图像识别的流程示意图;FIG. 5 is a schematic flowchart of a similar image recognition performed by a client in a specific embodiment of the present application; FIG.
图6为本申请具体实施例中服务器进行相似图像识别的流程示意图;6 is a schematic flowchart of performing similar image recognition by a server in a specific embodiment of the present application;
图7为本申请提出的一种相似图像识别设备的结构示意图;FIG. 7 is a schematic structural diagram of a similar image recognition device according to the present application; FIG.
图8为本申请提出的一种客户端的结构示意图;FIG. 8 is a schematic structural diagram of a client according to the present application; FIG.
图9为本申请提出的一种服务器的结构示意图。FIG. 9 is a schematic structural diagram of a server according to the present application.
具体实施方式detailed description
随着移动设备的普及,人脸认证在越来越多的地方发挥着重要的作用。但人脸认证过程中受到很多其他客观因素的干扰,再加上角度等原因,一般 包含人脸的图像中的人脸往往并不能直接进行特征对比以及提取。有鉴于该问题,本申请提出了针对相似图像的识别方法,该方法能够借助于网络环境下的计算机设备实现。其中主要用于对相似度进行判断的为系统后台的服务器,而面向用户的客户端既可是兼容键位输入以及触屏输入的移动设备,也可以是PC设备,客户端与服务器通过有线或是无线的方式实现网络连接。With the popularity of mobile devices, face authentication plays an important role in more and more places. However, the face authentication process is interfered by many other objective factors, plus angles, etc. Faces in images containing faces are often not directly compared and extracted. In view of this problem, the present application proposes a recognition method for similar images, which can be implemented by means of a computer device in a network environment. The main purpose of judging the similarity is the server in the background of the system, and the client-oriented client is either a mobile device compatible with key input and touch screen input, or a PC device, and the client and the server are wired or A wireless way to achieve network connectivity.
如图1所示,为本申请所提出的一种相似图像识别方法的流程示意图,包括以下步骤:As shown in FIG. 1 , a schematic flowchart of a similar image recognition method proposed in the present application includes the following steps:
S101,获取第一待识别图像中与指定特征对应的待对比区域。S101. Acquire an area to be compared corresponding to the specified feature in the first to-be-identified image.
在针对人脸类的图片进行相似度判断以准确的分辨两张照片是否为同一人的过程中,准确地定位出人脸的一些关键点(例如眼睛,鼻子,嘴角等)人脸对齐必不可少的步骤。因此在本申请优选的实施例中,待对比区域可通过确定关键点坐标(与人脸相关)的方式来获取。具体地,在确定第一待识别图像中与指定特征对应的待对比区域的过程中,可首先根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,然后通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标,以此准确的确定待对比区域。相应地,指定特征可为脸部区域,而关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。In the process of similarity judgment on the face of the face class to accurately distinguish whether the two photos are the same person, accurately locating some key points of the face (such as eyes, nose, mouth, etc.) face alignment is indispensable Less steps. Therefore, in a preferred embodiment of the present application, the area to be compared can be obtained by determining the key point coordinates (related to the face). Specifically, in determining a region to be compared corresponding to the specified feature in the first to-be-identified image, the to-be-contrast region in the first to-be-identified image may be first determined according to a detection algorithm corresponding to the specified feature. Then, the key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-compared area are obtained by using a preset key point regression model, so as to accurately determine the area to be compared. Accordingly, the designated feature may be a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
根据本申请一个实施例,采用了深度卷积神经网络实现人脸关键点的回归。该具体实施例中的神经网络的结构如图2所示,包括4个卷积层和2个全连接层。其中前3个卷积层包含最大池化(max pooling)操作,最后一个卷积层仅仅含有卷积操作。第一个全连接层含有100个节点,第二个全连接成有10个节点,表示人脸5个关键点的坐标。回归采用欧式距离最作为损失函数,表达式如下:According to an embodiment of the present application, a deep convolutional neural network is used to implement regression of face key points. The structure of the neural network in this embodiment is as shown in FIG. 2, and includes four convolution layers and two fully connected layers. The first three convolutional layers contain the maximum pooling operation, and the last convolutional layer contains only the convolution operation. The first fully connected layer contains 100 nodes, and the second is fully connected to have 10 nodes, representing the coordinates of the five key points of the face. Regression uses the Euclidean distance as the loss function, and the expression is as follows:
Figure PCTCN2016079158-appb-000001
x表示标注的关键点的坐标,表示通过卷积 神经网络预测的关键点的坐标。
Figure PCTCN2016079158-appb-000001
x represents the coordinates of the key points of the annotation, representing the coordinates of the key points predicted by the convolutional neural network.
通过最小化上述损失函数,本具体实施例采用随机梯度下降算法优化模型中的参数,从而训练得到预测人脸关键点的模型。By minimizing the above loss function, the specific embodiment uses a stochastic gradient descent algorithm to optimize the parameters in the model, thereby training to obtain a model for predicting key points of the face.
其次,本步骤根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成。Secondly, this step maps the coordinates of each key point of the to-be-identified area to the key point coordinates of the aligned image according to the parameter M, wherein the parameter M is the coordinate of each key point according to the standard image and the labeled image The key point coordinates of the image corresponding to the specified feature are generated.
以上述具体实施例中参数为例,该具体实施例定义了标准人脸中的5个关键点位置,分别是左眼,右眼,鼻子,左嘴角,右嘴角位置,并通过将检测到的人脸进行旋转、平移、缩放,从而对齐到标准人脸。假设标准人脸中的特征点位置为(x,y),预测得到的特征点的位置为(x',y'),那么两者的关系为:Taking the parameters in the above specific embodiment as an example, the specific embodiment defines five key point positions in the standard human face, which are the left eye, the right eye, the nose, the left mouth corner, and the right mouth corner position, and are detected by The face is rotated, panned, and scaled to align to a standard face. Assuming that the position of the feature point in the standard face is (x, y) and the position of the predicted feature point is (x', y'), then the relationship between the two is:
Figure PCTCN2016079158-appb-000002
Figure PCTCN2016079158-appb-000002
其中位置的参数为a=s cosθ,b=s sinθ,c=tx,d=ty4个未知参数,为了求解这4个参数,需要4个等式。为了使得对齐的结果更加健壮,本具体实施例将5个点进行映射,建立线性方程组,将线性方程组的最小二乘方法计算改线性方程组的系统。具体如下:The parameters of the position are a=s cosθ, b=s sinθ, c=t x , d=t y 4 unknown parameters. In order to solve these 4 parameters, 4 equations are needed. In order to make the result of the alignment more robust, the specific embodiment maps five points, establishes a linear equation group, and calculates a system of linear equations by the least squares method of the linear equations. details as follows:
Figure PCTCN2016079158-appb-000003
Figure PCTCN2016079158-appb-000003
将上述等式表述成线性方程组的形式,可以变为: Expressing the above equation as a linear system of equations can become:
Figure PCTCN2016079158-appb-000004
Figure PCTCN2016079158-appb-000004
通过最小化
Figure PCTCN2016079158-appb-000005
其中解得x=(MTM)-1y
By minimizing
Figure PCTCN2016079158-appb-000005
Where the solution is x=(M T M) -1 y
Figure PCTCN2016079158-appb-000006
Figure PCTCN2016079158-appb-000006
以上过程为参数M的详细生成过程,本领域技术人员能够根据该参数M对人脸图像进行对齐处理,在此基础上,其他能够得到该参数M的改进实现方式均属于本申请的保护范围。The above process is a detailed generation process of the parameter M. Those skilled in the art can perform alignment processing on the face image according to the parameter M. On the basis of this, other improved implementation manners that can obtain the parameter M are all within the protection scope of the present application.
S102,将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像。S102. Align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image.
为了降低其他客观因素的干扰,使得对比结果更加的准确,本申请在确定与指定特征对应的待对比区域后,需要将待识别区域中的图像与预设的标准图像进行对齐。在本申请的优选实施例中,该步骤将人脸对齐到一个标准的人脸,本领域技术人员能够基于现有的对比标准设置该标准的人脸,这些均在本申请的保护范围之内。In order to reduce the interference of other objective factors, the comparison result is more accurate. After determining the area to be compared corresponding to the specified feature, the application needs to align the image in the area to be identified with the preset standard image. In a preferred embodiment of the present application, this step aligns the face to a standard face, and those skilled in the art can set the face of the standard based on existing comparison criteria, which are all within the scope of the present application. .
此外,为了进一步地将图像标准化以便于处理,在以上过程结束后,本申请将归一化图像的分辨率调整至预设的分辨率。根据本申请一个实施例,若根据预设的参数需要将人脸区域缩放到39x39该规格时,该步骤将人脸关键 点坐标信息归一化到39x39尺度空间内。Furthermore, in order to further normalize the image for processing, after the above process is finished, the present application adjusts the resolution of the normalized image to a preset resolution. According to an embodiment of the present application, if the face area needs to be scaled to the 39x39 specification according to the preset parameters, the step will be the face key. The point coordinate information is normalized to the 39x39 scale space.
S103,确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离。S103. Determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the second A normalized image of the image to be identified is generated in a distance in the feature space, wherein the distance of the similar normalized image in the feature space is less than the distance of the non-similar normalized image in the feature space.
基于上述说明,在本申请优选的实施例中,首先通过卷积神经网络提取所述归一化图像中的指定特征,随后根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值,最后确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Based on the above description, in a preferred embodiment of the present application, a specified feature in the normalized image is first extracted by a convolutional neural network, and then the specified feature is mapped to the convolutional neural network and the distance metric loss function. The feature value after the feature space, and the feature value is used as the feature value of the normalized image, and finally determining the feature value of the normalized image and the feature of the normalized image of the second image to be recognized The Euclidean distance between the values, the Euclidean distance is taken as the metric distance.
针对人脸认证(两个人脸进行比较)的特殊场景,本申请的技术方案结合了深度卷积神经网络和度量学习来训练人脸认证模型。深度卷积神经网络目前在图像理解的领域,包括图像分类,图像检索,目标检测,人脸识别等,得到了广泛的使用。和传统的特征加分类器的方法相比,卷积神经网络具有特征自学习、模型泛化能力好等有点。度量学习是通过将特征空间进行线性或者非线性的映射,从而使得相同的人脸特征距离小于不同的人脸特征距离。For the special scenario of face authentication (comparison of two faces), the technical solution of the present application combines a deep convolutional neural network and metric learning to train a face authentication model. Deep convolutional neural networks are widely used in the field of image understanding, including image classification, image retrieval, target detection, and face recognition. Compared with the traditional feature plus classifier method, the convolutional neural network has a feature self-learning, and the model generalization ability is good. Metric learning is a linear or non-linear mapping of feature spaces such that the same face feature distance is less than a different face feature distance.
需要说明的是,所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。It should be noted that the convolutional neural network parameters are obtained according to the labeled image training, and the labeled image includes a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
具体的,为了得到基于深度度量学习的人脸认证模型,本申请具体的实施例中采用成对(pair-wise)的方式进行样本标注,每个样本包含2个人像图片,如果两个图像中的不是同一个人,表示负样本,如果是同一个人表示为 正样本。正样本通过收集属于同一个人的多个图片进行两两组合生成,负样本则通过不是同一个人的图片进行仿真生成。在将样本进行人脸检测、通过训练得到的人脸关键点预测模型对人脸的关键点进行预测、将人脸对齐到标准脸、以及将图像分辨率缩放到39x39等一系列过程后,即可训练基于深度度量学习的人脸认证模型。Specifically, in order to obtain a face authentication model based on depth metric learning, in a specific embodiment of the present application, sample pairing is performed in a pair-wise manner, and each sample includes two portrait images, if two images are in the image Not the same person, indicating a negative sample, if the same person is expressed as Positive sample. A positive sample is generated by combining two pictures belonging to the same person, and a negative sample is generated by a picture that is not the same person. After performing a face detection on the sample, a face key prediction model obtained by training, predicting key points of the face, aligning the face to the standard face, and scaling the image resolution to 39x39, A face authentication model based on depth metric learning can be trained.
如图3所示,每一组样本中的两个图像经过人脸检测、关键点定位以及人脸对齐后,输入到卷积神经网络,通过卷积提取学习到的人脸特征。其中左边和右边的网络的参数W共享的。最后在高层的语义空间进行特征的距离度量。深度度量学习主要包含2个部分。其中一个是参数W,表示需要训练的得到的卷积神经网络的参数,另外一个是距离度量损失函数。与传统的人脸识别不同,本申请的输入是2个人脸,最后的损失也是衡量2个人脸在特征空间上的距离。本具体实施例中使用的卷积神经网络的结构如图4所示,包含4个卷积层和2个全连接层,其中3个卷积层后面接了最大采样层。最大采样层使得提取的特征具有平移不变性,并且降低了计算复杂度。最后将人脸的特征非线性映射到100维的特征空间中。As shown in FIG. 3, after two images in each group of samples are subjected to face detection, key point positioning, and face alignment, they are input to a convolutional neural network, and the learned facial features are extracted by convolution. The parameters of the left and right networks are shared by W. Finally, the distance measure of the feature is performed in the high-level semantic space. The depth metric learning mainly consists of two parts. One of them is the parameter W, which represents the parameters of the resulting convolutional neural network that need to be trained, and the other is the distance metric loss function. Different from traditional face recognition, the input of this application is 2 faces, and the final loss is also the distance between 2 faces in the feature space. The structure of the convolutional neural network used in this embodiment is as shown in FIG. 4, and includes four convolutional layers and two fully connected layers, wherein three convolutional layers are followed by a maximum sampling layer. The maximum sampling layer makes the extracted features have translation invariance and reduces computational complexity. Finally, the features of the face are nonlinearly mapped into the 100-dimensional feature space.
由此可见,度量学习是寻找一个变换空间,在这个空间中同类样本的距离缩小,不同类样本距离增大。因此该步骤首先通过度量学习寻找一个非线性变换,将人脸从原始像素变换到一个特征空间,使得在这个空间中相似的人脸距离小,不相似的人脸距离大。随后通过深度卷积神经网络提取人脸特征,最后结合度量学习将卷积神经网络学到的特征映射到一个特征空间。由于卷积神经网络是将人脸图像继续非线性映射,由此得到的特征表达与人工设计的特征相比更加健壮,且人脸认证准确率更高。It can be seen that metric learning is to find a transformation space in which the distance of similar samples is reduced, and the distance between different types of samples is increased. Therefore, this step first searches for a nonlinear transformation through metric learning, transforming the face from the original pixel to a feature space, so that the similar face distance is small and the dissimilar face distance is large in this space. Then the facial features are extracted by the deep convolutional neural network. Finally, the features learned by the convolutional neural network are mapped to a feature space in combination with metric learning. Since the convolutional neural network continues the non-linear mapping of the face image, the feature expression thus obtained is more robust than the artificially designed feature, and the face authentication accuracy is higher.
S104,若所述度量距离大于预设的阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征不相似。 S104. If the metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
S105,若所述度量距离小于或等于所述阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征相似。S105. If the metric distance is less than or equal to the threshold, confirm that the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
在S103的具体实施例中,最后得到的100维特征将进行度量学习,该过程采用的损失函数如下:In a specific embodiment of S103, the resulting 100-dimensional feature will be subjected to metric learning, and the loss function employed in the process is as follows:
Figure PCTCN2016079158-appb-000007
Figure PCTCN2016079158-appb-000007
其中
Figure PCTCN2016079158-appb-000008
表示广义的逻辑损失函数。(Xi,Xj)∈P表示样本集合,lij表示样本的类别,lij=1表示Xi和Xj是同一个人,lij=-1表示Xi和Xj不是同一个人,W是模型的参数,FW(Xi)表示当前模型参数为W时,映射到100维的特征的值。
Figure PCTCN2016079158-appb-000009
表示两个人脸在特征空间中的距离,距离越小表示两个人脸越相似。当(Xi,Xj)是同一个人时,lij=1,损失函数随着
Figure PCTCN2016079158-appb-000010
的增大而增大,相应的当(Xi,Xj)不是同一个人时损失函数随着
Figure PCTCN2016079158-appb-000011
的增大而减小,τ表示是否是同一个人的阈值。
among them
Figure PCTCN2016079158-appb-000008
Represents a generalized logical loss function. (X i , X j ) ∈ P denotes a sample set, l ij denotes a class of samples, l ij =1 means that X i and X j are the same person, and l ij = -1 means that X i and X j are not the same person, W Is the parameter of the model, and F W (X i ) indicates the value of the feature mapped to 100-dimensional when the current model parameter is W.
Figure PCTCN2016079158-appb-000009
Indicates the distance between two faces in the feature space. The smaller the distance, the more similar the two faces are. When (X i , X j ) is the same person, l ij =1, the loss function follows
Figure PCTCN2016079158-appb-000010
Increases and increases, correspondingly when (X i , X j ) is not the same person, the loss function
Figure PCTCN2016079158-appb-000011
It increases and decreases, and τ indicates whether it is the threshold of the same person.
Figure PCTCN2016079158-appb-000012
Figure PCTCN2016079158-appb-000012
通过最小化损失函数可以得到模型的参数W。优选的,技术人员可以采用链式求导法则求得对应参数的梯度并使用随机梯度下降法(SGD)来优化计算模型的参数,其他能够实现优化效果的计算模型同样在本申请的保护范围之内。The parameter W of the model can be obtained by minimizing the loss function. Preferably, the technician can use the chain derivation rule to obtain the gradient of the corresponding parameter and use the stochastic gradient descent method (SGD) to optimize the parameters of the calculation model. Other calculation models capable of achieving the optimization effect are also within the protection scope of the present application. Inside.
基于上述说明,当一对图像输入时,分别检测图中的人脸,根据人脸区域进行特征点提取与人脸对齐。然后根据之前步骤中训练得到的模型进行特征提取并将特征映射到100维度的空间中,最后计算两个人脸特征的欧式距离,当距离大于等于τ是表示不是同一个人,否则就是同一个人。 Based on the above description, when a pair of images is input, the faces in the map are respectively detected, and feature point extraction and face alignment are performed according to the face region. Then, according to the model obtained in the previous step, the feature extraction is performed and the feature is mapped into the space of 100 dimensions. Finally, the Euclidean distance of the two facial features is calculated. When the distance is greater than or equal to τ, it means that it is not the same person, otherwise it is the same person.
以上方案详细描述了如何针对一组待识别图像判断其是否相似的过程,具体的实现场景中该过程可以由客户端以及服务器共同完成。在该实现场景中,用户可以使用诸如智能手机、平板电脑等移动终端进行图片与信息的上传,也可通过PC终端上传图片及相关信息。作为对图像进行处理的主体,服务器可以为系统运营商预先架设的数据服务器或者网络服务器。The above solution describes in detail how to determine whether a group of images to be identified is similar or not. In a specific implementation scenario, the process can be completed by the client and the server. In this implementation scenario, the user can use a mobile terminal such as a smart phone or a tablet to upload images and information, and also upload images and related information through the PC terminal. As a subject for processing an image, the server may be a data server or a web server pre-configured by the system operator.
作为用户与服务器之间的纽带,客户端主要用于将用户的输入内容转发至服务器,由服务器根据用户输入的内容对用户的身份进行验证,最终客户端根据服务器返回的验证结果向用户进行展示。以下首先对客户端侧的相似图像识别方法进行介绍,如图5所示,包括以下步骤:As a link between the user and the server, the client is mainly used to forward the user's input content to the server, and the server verifies the identity of the user according to the content input by the user, and finally the client displays the verification result according to the server. . The following first introduces the similar image recognition method on the client side, as shown in FIG. 5, including the following steps:
S501,接收用户的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息。S501. Receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user.
需要说明的是,本实施例中对客户端的形式并不做限定,客户端可为PC设备,也可以为移动端设备。但是均能够向用户提供图片上传以及信息输入的功能,具体的,客户端首先获取所述用户上传的图像以及所述用户输入的信息,随后将所述图像作为所述第一待识别图像,以及将所述信息作为所述认证信息,最后根据所述第一待识别图像以及所述认证信息生成所述身份认证请求。It should be noted that, in this embodiment, the form of the client is not limited, and the client may be a PC device or a mobile device. However, both can provide the user with the function of image uploading and information input. Specifically, the client first acquires the image uploaded by the user and the information input by the user, and then uses the image as the first image to be recognized, and Using the information as the authentication information, and finally generating the identity authentication request according to the first to-be-identified image and the authentication information.
S502,将所述身份认证请求发送至服务器,以使所述服务器根据所述认证信息获取与所述用户对应的第二待识别图像。S502. Send the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information.
在获取到用户的认证信息后,服务器即可据此获取该用户对应的第二待识别图像。在具体的实施例中,服务器根据用户提供的身份信息,在数据库中查询该用户身份证中的图像,并将此图像作为第二待识别图像,从而确定用户上传的自身的图像是否与其身份证图像匹配。After obtaining the authentication information of the user, the server may obtain the second to-be-identified image corresponding to the user according to the data. In a specific embodiment, the server queries the database for the image in the user ID according to the identity information provided by the user, and uses the image as the second image to be identified, thereby determining whether the image uploaded by the user is the same as the ID card. Image matching.
S503,接收所述服务器发送的身份认证响应。 S503. Receive an identity authentication response sent by the server.
在本实施例中,身份认证响应为身份认证成功响应或身份认证失败响应,其中身份认证成功响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征相似之后生成的,而身份认证失败响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征不相似之后生成的。In this embodiment, the identity authentication response is an identity authentication success response or an identity authentication failure response, wherein the identity authentication success response is that the server confirms that the first to-be-identified image is similar to the specified feature of the second to-be-identified image. And then generated, and the identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
S504,根据所述身份认证响应向所述用户展示认证结果。S504. Display an authentication result to the user according to the identity authentication response.
基于身份认证成功响应或是身份认证失败响应,本步骤的具体实施过程如下:Based on the identity authentication success response or the identity authentication failure response, the specific implementation process of this step is as follows:
(1)当所述客户端接收到所述身份认证成功响应时,所述客户端向所述用户展示预设的与所述身份认证成功响应对应的界面;(1) When the client receives the identity authentication success response, the client displays the preset interface corresponding to the identity authentication success response to the user;
(2)当所述客户端接收到所述身份认证失败响应时,所述客户端向所述用户展示预设的与所述身份认证失败响应对应的界面,以及向所述用户展示是否需要进行人工验证的提示信息。(2) when the client receives the identity authentication failure response, the client displays the preset interface corresponding to the identity authentication failure response to the user, and shows whether the user needs to perform Manually verified prompt information.
由于本申请是由设备自动地对一组待识别图像进行判断,因此为了进一步避免误差所带来的影响,在向用户返回失败响应的同时,会同时向用户展示是否需要进行人工验证的提示信息。如果用户认为需要重新提交人工审核的话,那么即重新通告客户端输入人工验证请求,而客户端在接收到所述用户的人工验证请求后,即将身份认证请求发送至预设的服务端。Since the present application automatically judges a group of images to be recognized by the device, in order to further avoid the influence of the error, when the failure response is returned to the user, the prompt information indicating whether manual verification is required is simultaneously displayed to the user. . If the user thinks that the manual review needs to be resubmitted, then the client re-advertises the manual verification request, and after receiving the manual verification request from the user, the client sends the identity authentication request to the preset server.
以上为客户端的流程,主要用于实现用户与服务器之间的交互,以下实施例为服务器侧的相似图像识别方法,如图6所示,包括如下步骤:The above is the process of the client, and is mainly used to implement the interaction between the user and the server. The following embodiment is a similar image recognition method on the server side, as shown in FIG. 6, including the following steps:
S601,接收由所述客户端发送的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;S601. Receive an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user.
S602,根据所述认证信息查询与所述用户对应的第二待识别图像;S602. Query, according to the authentication information, a second to-be-identified image corresponding to the user.
S603,获取第一待识别图像中与指定特征对应的待对比区域; S603. Acquire an area to be compared corresponding to the specified feature in the first to-be-identified image.
S604,将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;S604. Align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, where the standard image corresponds to the specified feature. ;
S605,确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;S605. Determine a metric distance between the normalized image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the normalized image of the second to-be-identified image a distance generation in the feature space, wherein a distance of the similar normalized image in the feature space is less than a distance of the non-similar normalized image in the feature space;
S606,若所述度量距离大于预设的阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,并向所述客户端返回身份验证失败响应;S606. If the metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image, and return an identity verification failure response to the client.
S607,若所述度量距离小于或等于所述阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征相似,并向所述客户端返回身份验证成功响应。S607. If the metric distance is less than or equal to the threshold, confirm that the first to-be-identified image is similar to the specified feature of the second to-be-identified image, and return an identity verification success response to the client.
为达到以上技术目的,本申请还提出了一种相似图像识别设备,如图7所示,包括:To achieve the above technical purpose, the present application also proposes a similar image recognition device, as shown in FIG. 7, comprising:
获取模块710,用于获取第一待识别图像中与指定特征对应的待对比区域;The obtaining module 710 is configured to obtain an area to be compared corresponding to the specified feature in the first to-be-identified image;
对齐模块720,用于将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;The aligning module 720 is configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Corresponding to the specified feature;
确定模块730,用于确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征 空间的距离;a determining module 730, configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and A normalized image of the second image to be identified is generated in a distance in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a non-similar normalized image in the feature Distance of space;
识别模块740,用于在所述度量距离大于预设的阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,以及在所述度量距离小于或等于所述阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征相似。The identification module 740 is configured to confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image when the metric distance is greater than a preset threshold, and that the metric distance is less than or equal to the The threshold is confirmed to be similar to the specified feature of the second image to be recognized.
在具体的应用场景中,所述确定模块具体用于:In a specific application scenario, the determining module is specifically configured to:
根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature, and acquiring a plurality of keys in the to-be-contrast area and the specified feature by using a preset key point regression model The key point coordinates corresponding to the point feature.
在具体的应用场景中,所述对齐模块具体用于:In a specific application scenario, the alignment module is specifically configured to:
根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。Mapping each key point coordinate of the to-be-identified area to a key point coordinate of the aligned image according to the parameter M, wherein the parameter M is according to each key point coordinate of the standard image and the labeled image Specifies the keypoint coordinates of the image corresponding to the feature.
在具体的应用场景中,还包括:In specific application scenarios, it also includes:
调整模块,用于将所述归一化图像的分辨率调整至预设的分辨率。And an adjustment module, configured to adjust a resolution of the normalized image to a preset resolution.
在具体的应用场景中,所述获取模块具体用于:In a specific application scenario, the acquiring module is specifically configured to:
通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
在具体的应用场景中,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。In a specific application scenario, the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
在具体的应用场景中,所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不 相似的归一化图像。In a specific application scenario, the convolutional neural network parameters are obtained according to the labeled image, and the labeled image includes normalized images with specified features being similar to each other and designated features are not mutually exclusive. A similar normalized image.
本申请还提出了一种客户端,如图8所示,包括:The application also proposes a client, as shown in FIG. 8, comprising:
接收模块810,用于接收用户的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;The receiving module 810 is configured to receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
发送模块820,用于将所述身份认证请求发送至服务器,以使所述服务器根据所述认证信息获取与所述用户对应的第二待识别图像;The sending module 820 is configured to send the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
所述接收模块810,还用于接收所述服务器发送的身份认证响应;The receiving module 810 is further configured to receive an identity authentication response sent by the server.
展示模块830,用于根据所述身份认证响应向所述用户展示认证结果。The displaying module 830 is configured to display the authentication result to the user according to the identity authentication response.
在具体的应用场景中,所述接收模块具体用于:In a specific application scenario, the receiving module is specifically configured to:
获取所述用户上传的图像以及所述用户输入的信息,将所述图像作为所述第一待识别图像,以及将所述信息作为所述认证信息,根据所述第一待识别图像以及所述认证信息生成所述身份认证请求。Acquiring the image uploaded by the user and the information input by the user, using the image as the first image to be recognized, and using the information as the authentication information, according to the first image to be recognized and the The authentication information generates the identity authentication request.
在具体的应用场景中,所述身份认证响应为身份认证成功响应或身份认证失败响应,还包括:In a specific application scenario, the identity authentication response is an identity authentication success response or an identity authentication failure response, and further includes:
所述身份认证成功响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征相似之后生成的;The identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
所述身份认证失败响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征不相似之后生成的。The identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
在具体的应用场景中,所述展示模块,具体用于在当所述接收模块接收到所述身份认证成功响应时,向所述用户展示预设的与所述身份认证成功响应对应的界面;或,所述展示模块,具体用于在当所述接收模块接收到所述身份认证失败响应时,向所述用户展示预设的与所述身份认证失败响应对应的界面,以及向所述用户展示是否需要进行人工验证的提示信息。In a specific application scenario, the displaying module is specifically configured to: when the receiving module receives the identity authentication success response, display the preset interface corresponding to the identity authentication success response to the user; Or the displaying module is specifically configured to: when the receiving module receives the identity authentication failure response, display, to the user, a preset interface corresponding to the identity authentication failure response, and to the user Show tips for manual verification.
在具体的应用场景中,当所述接收模块在所述展示模块向所述用户展示 预设的与所述身份认证失败响应对应的界面以及向所述用户展示是否需要进行人工验证的提示之后,还接收到所述用户的人工验证请求,所述接收模块指示所述发送模块将所述身份认证请求发送至预设的服务端。In a specific application scenario, when the receiving module displays to the user in the display module Receiving a manual verification request corresponding to the identity authentication failure response and a prompt to the user to indicate whether manual verification is required, the receiving module instructing the sending module to The identity authentication request is sent to the preset server.
本申请实施例还提出了一种服务器,如图9所示,包括:The embodiment of the present application further provides a server, as shown in FIG. 9, including:
接收模块910,用接收由所述客户端发送的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;The receiving module 910 is configured to receive an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
查询模块920,用于根据所述认证信息查询与所述用户对应的第二待识别图像;The querying module 920 is configured to query, according to the authentication information, a second to-be-identified image corresponding to the user;
获取模块930,用于获取第一待识别图像中与指定特征对应的待对比区域;The obtaining module 930 is configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image;
对齐模块940,用于将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;An alignment module 940, configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Corresponding to the specified feature;
确定模块950,用于确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;a determining module 950, configured to determine a metric distance between the normalized image of the first to-be-identified image and the normalized image of the second to-be-identified image, the metric distance according to the normalized image and a normalized image of the second image to be identified is generated in a distance in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space ;
识别模块960,用于在所述度量距离大于预设的阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,以及在所述度量距离小于或等于所述阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征相似;The identification module 960 is configured to confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image when the metric distance is greater than a preset threshold, and that the metric distance is less than or equal to the Confirming, at the threshold, that the first to-be-identified image is similar to a specified feature of the second to-be-identified image;
发送模块970,用于在所述识别模块确认所述第一待识别图像与所述第二待识别图像的指定特征不相似时向所述客户端返回身份验证失败响应,以及 在所述识别模块确认所述第一待识别图像与所述第二待识别图像的指定特征相似时向所述客户端返回身份验证成功响应。The sending module 970 is configured to: when the identifying module confirms that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image, return an identity verification failure response to the client, and And when the identifying module confirms that the first to-be-identified image is similar to the specified feature of the second to-be-identified image, returning an identity verification success response to the client.
在具体的应用场景中,所述确定模块具体用于:In a specific application scenario, the determining module is specifically configured to:
根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature, and acquiring a plurality of keys in the to-be-contrast area and the specified feature by using a preset key point regression model The key point coordinates corresponding to the point feature.
在具体的应用场景中,所述对齐模块具体用于:In a specific application scenario, the alignment module is specifically configured to:
根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。Mapping each key point coordinate of the to-be-identified area to a key point coordinate of the aligned image according to the parameter M, wherein the parameter M is according to each key point coordinate of the standard image and the labeled image Specifies the keypoint coordinates of the image corresponding to the feature.
在具体的应用场景中,还包括:In specific application scenarios, it also includes:
调整模块,用于将所述归一化图像的分辨率调整至预设的分辨率。And an adjustment module, configured to adjust a resolution of the normalized image to a preset resolution.
在具体的应用场景中,所述获取模块具体用于:In a specific application scenario, the acquiring module is specifically configured to:
通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
在具体的应用场景中,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。In a specific application scenario, the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and a right corner region.
在具体的应用场景中,所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。In a specific application scenario, the convolutional neural network parameters are trained according to the labeled image, and the labeled image includes a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到本申 请可以通过硬件实现,也可以借助软件加必要的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案可以以软件产品的形式体现出来,该软件产品可以存储在一个非易失性存储介质(可以是CD-ROM,U盘,移动硬盘等)中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施场景所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand the present application. It can be implemented in hardware or by means of software plus the necessary general hardware platform. Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), including several The instructions are for causing a computer device (which may be a personal computer, server, or network device, etc.) to perform the methods described in various implementation scenarios of the present application.
本领域技术人员可以理解附图只是一个优选实施场景的示意图,附图中的模块或流程并不一定是实施本申请所必须的。A person skilled in the art can understand that the drawings are only a schematic diagram of a preferred implementation scenario, and the modules or processes in the drawings are not necessarily required to implement the application.
本领域技术人员可以理解实施场景中的装置中的模块可以按照实施场景描述进行分布于实施场景的装置中,也可以进行相应变化位于不同于本实施场景的一个或多个装置中。上述实施场景的模块可以合并为一个模块,也可以进一步拆分成多个子模块。A person skilled in the art may understand that the modules in the apparatus in the implementation scenario may be distributed in the apparatus for implementing the scenario according to the implementation scenario description, or may be correspondingly changed in one or more devices different from the implementation scenario. The modules of the above implementation scenarios may be combined into one module, or may be further split into multiple sub-modules.
上述本申请序号仅仅为了描述,不代表实施场景的优劣。The above serial numbers are only for the description, and do not represent the advantages and disadvantages of the implementation scenario.
以上公开的仅为本申请的几个具体实施场景,但是,本申请并非局限于此,任何本领域的技术人员能思之的变化都应落入本申请的保护范围。 The above disclosure is only a few specific implementation scenarios of the present application, but the present application is not limited thereto, and any changes that can be made by those skilled in the art should fall within the protection scope of the present application.

Claims (25)

  1. 一种相似图像识别方法,其特征在于,包括:A similar image recognition method, comprising:
    获取第一待识别图像中与指定特征对应的待对比区域;Obtaining an area to be compared corresponding to the specified feature in the first to-be-identified image;
    将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;Aligning an image in the to-be-identified area with a preset standard image, and using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the specified feature;
    确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;Determining a metric distance between the normalized image and a normalized image of the second image to be recognized, the metric distance being characterized according to the normalized image and the normalized image of the second image to be recognized Distance generation in space, wherein the distance of the similar normalized image in the feature space is less than the distance of the non-similar normalized image in the feature space;
    若所述度量距离大于预设的阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征不相似;If the metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image;
    若所述度量距离小于或等于所述阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征相似。And if the metric distance is less than or equal to the threshold, confirming that the first to-be-identified image is similar to a specified feature of the second to-be-identified image.
  2. 如权利要求1所述的方法,其特征在于,获取第一待识别图像中与指定特征对应的待对比区域,具体为:The method according to claim 1, wherein the area to be compared corresponding to the specified feature in the first to-be-identified image is obtained, specifically:
    根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域;Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature;
    通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。The key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-contrast area are obtained by a preset key point regression model.
  3. 如权利要求2所述的方法,其特征在于,将所述待识别区域中的图像与预设的标准图像进行对齐,具体为:The method according to claim 2, wherein the image in the area to be identified is aligned with a preset standard image, specifically:
    根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标;Mapping the coordinates of each key point of the to-be-identified area to the key point coordinates of the aligned image according to the parameter M;
    其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像 中与所述指定特征对应的图像的关键点坐标生成的。Wherein the parameter M is a coordinate of each key point according to the standard image and an image that has been labeled The key point coordinates of the image corresponding to the specified feature are generated.
  4. 如权利要求3所述的方法,其特征在于,在将对齐后的图像作为所述第一待识别图像的归一化图像之后,还包括:The method of claim 3, further comprising: after the aligned image is used as the normalized image of the first image to be recognized,
    将所述归一化图像的分辨率调整至预设的分辨率。The resolution of the normalized image is adjusted to a preset resolution.
  5. 如权利要求1所述的方法,其特征在于,确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,具体为:The method according to claim 1, wherein the metric distance between the normalized image and the normalized image of the second image to be recognized is determined, specifically:
    通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
    根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
    确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
  6. 如权利要求1-5任一项所述的方法,其特征在于,所述指定特征具体为脸部区域,所述关键点特征至少包括左眼区域、右眼区域、鼻子区域、左嘴角区域以及右嘴角区域。The method according to any one of claims 1 to 5, wherein the designated feature is specifically a face region, and the key feature includes at least a left eye region, a right eye region, a nose region, a left corner region, and Right corner area.
  7. 如权利要求6所述的方法,其特征在于,The method of claim 6 wherein:
    所述卷积神经网络参数是根据已标注图像训练得到,所述已标注图像包括指定特征互相相似的归一化图像以及指定特征互不相似的归一化图像。The convolutional neural network parameters are trained based on an annotated image comprising a normalized image in which the specified features are similar to each other and a normalized image in which the specified features are not similar to each other.
  8. 一种相似图像识别设备,其特征在于,包括:A similar image recognition device, comprising:
    获取模块,用于获取第一待识别图像中与指定特征对应的待对比区域;An acquiring module, configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image;
    对齐模块,用于将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;An alignment module, configured to align an image in the to-be-identified area with a preset standard image, and use the aligned image as a normalized image of the first to-be-identified image, the standard image and the Specify the feature correspondence;
    确定模块,用于确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似 的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;a determining module, configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the Generating a normalized image of the second image to be recognized in the feature space, wherein The distance of the normalized image in the feature space is less than the distance of the non-similar normalized image in the feature space;
    识别模块,用于在所述度量距离大于预设的阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,以及在所述度量距离小于或等于所述阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征相似。An identification module, configured to confirm, when the metric distance is greater than a preset threshold, that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and that the metric distance is less than or equal to the threshold It is confirmed that the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
  9. 如权利要求8所述的设备,其特征在于,所述确定模块具体用于:The device according to claim 8, wherein the determining module is specifically configured to:
    根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature, and acquiring a plurality of keys in the to-be-contrast area and the specified feature by using a preset key point regression model The key point coordinates corresponding to the point feature.
  10. 如权利要求9所述的设备,其特征在于,所述对齐模块具体用于:The device according to claim 9, wherein the alignment module is specifically configured to:
    根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。Mapping each key point coordinate of the to-be-identified area to a key point coordinate of the aligned image according to the parameter M, wherein the parameter M is according to each key point coordinate of the standard image and the labeled image Specifies the keypoint coordinates of the image corresponding to the feature.
  11. 如权利要求8所述的设备,其特征在于,所述获取模块具体用于:The device according to claim 8, wherein the obtaining module is specifically configured to:
    通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
    根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
    确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
  12. 一种相似图像识别方法,应用于客户端,其特征在于,该方法包括:A similar image recognition method is applied to a client, and the method includes:
    接收用户的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;Receiving an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
    将所述身份认证请求发送至服务器,以使所述服务器根据所述认证信息获取与所述用户对应的第二待识别图像; Sending the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
    接收所述服务器发送的身份认证响应;Receiving an identity authentication response sent by the server;
    根据所述身份认证响应向所述用户展示认证结果。The authentication result is presented to the user according to the identity authentication response.
  13. 如权利要求12所述的方法,其特征在于,接收用户的身份认证请求,具体为:The method of claim 12, wherein the receiving the user's identity authentication request is:
    获取所述用户上传的图像以及所述用户输入的信息;Obtaining an image uploaded by the user and information input by the user;
    将所述图像作为所述第一待识别图像,以及将所述信息作为所述认证信息;Using the image as the first to-be-identified image, and using the information as the authentication information;
    根据所述第一待识别图像以及所述认证信息生成所述身份认证请求。And generating the identity authentication request according to the first to-be-identified image and the authentication information.
  14. 如权利要求13所述的方法,其特征在于,所述身份认证响应为身份认证成功响应或身份认证失败响应,还包括:The method of claim 13, wherein the identity authentication response is an identity authentication success response or an identity authentication failure response, and further includes:
    所述身份认证成功响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征相似之后生成的;The identity authentication success response is generated by the server after confirming that the first to-be-identified image is similar to the specified feature of the second to-be-identified image;
    所述身份认证失败响应为所述服务器在确认所述第一待识别图像与所述第二待识别图像的指定特征不相似之后生成的。The identity authentication failure response is generated by the server after confirming that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image.
  15. 如权利要求14所述的方法,其特征在于,根据所述身份认证响应向所述用户展示认证结果,具体为:The method according to claim 14, wherein the authentication result is displayed to the user according to the identity authentication response, specifically:
    当接收到所述身份认证成功响应时,向所述用户展示预设的与所述身份认证成功响应对应的界面;When receiving the identity authentication success response, displaying, by the user, a preset interface corresponding to the identity authentication success response;
    当接收到所述身份认证失败响应时,向所述用户展示预设的与所述身份认证失败响应对应的界面,以及向所述用户展示是否需要进行人工验证的提示信息。When receiving the identity authentication failure response, the user is presented with a preset interface corresponding to the identity authentication failure response, and prompting the user whether the manual verification is required.
  16. 如权利要求15所述的方法,其特征在于,在向所述用户展示预设的与所述身份认证失败响应对应的界面以及向所述用户展示是否需要进行人工验证的提示之后,还包括:The method according to claim 15, wherein after the user is presented with the preset interface corresponding to the identity authentication failure response and the user is prompted to perform manual verification, the method further includes:
    若接收到所述用户的人工验证请求,将所述身份认证请求发送至预设的 服务端。Sending the identity authentication request to a preset if a manual verification request of the user is received Server.
  17. 一种客户端,其特征在于,包括:A client, comprising:
    接收模块,用于接收用户的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;a receiving module, configured to receive an identity authentication request of the user, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
    发送模块,用于将所述身份认证请求发送至服务器,以使所述服务器根据所述认证信息获取与所述用户对应的第二待识别图像;a sending module, configured to send the identity authentication request to the server, so that the server acquires a second to-be-identified image corresponding to the user according to the authentication information;
    所述接收模块,还用于接收所述服务器发送的身份认证响应;The receiving module is further configured to receive an identity authentication response sent by the server;
    展示模块,用于根据所述身份认证响应向所述用户展示认证结果。And a display module, configured to display the authentication result to the user according to the identity authentication response.
  18. 一种相似图像识别方法,应用于服务器,其特征在于,该方法包括:A similar image recognition method is applied to a server, the method comprising:
    接收由客户端发送的身份认证请求,所述身份认证请求携带用户上传的第一待识别图像以及所述用户的认证信息;Receiving an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
    根据所述认证信息查询与所述用户对应的第二待识别图像;Querying, according to the authentication information, a second to-be-identified image corresponding to the user;
    获取第一待识别图像中与指定特征对应的待对比区域;Obtaining an area to be compared corresponding to the specified feature in the first to-be-identified image;
    将所述待识别区域中的图像与预设的标准图像进行对齐,并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;Aligning an image in the to-be-identified area with a preset standard image, and using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the specified feature;
    确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;Determining a metric distance between the normalized image and a normalized image of the second image to be recognized, the metric distance being characterized according to the normalized image and the normalized image of the second image to be recognized Distance generation in space, wherein the distance of the similar normalized image in the feature space is less than the distance of the non-similar normalized image in the feature space;
    若所述度量距离大于预设的阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,并向所述客户端返回身份验证失败响应;If the metric distance is greater than a preset threshold, confirm that the first to-be-identified image is not similar to the specified feature of the second to-be-identified image, and return an identity verification failure response to the client;
    若所述度量距离小于或等于所述阈值,确认所述第一待识别图像与所述第二待识别图像的指定特征相似,并向所述客户端返回身份验证成功响应。If the metric distance is less than or equal to the threshold, confirm that the first to-be-identified image is similar to the specified feature of the second to-be-identified image, and return an identity verification success response to the client.
  19. 如权利要求18所述的方法,其特征在于,获取第一待识别图像中与 指定特征对应的待对比区域,具体为:The method of claim 18, wherein acquiring the first image to be identified is Specify the area to be compared corresponding to the feature, specifically:
    根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域;Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature;
    通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。The key point coordinates corresponding to the plurality of key point features of the specified feature in the to-be-contrast area are obtained by a preset key point regression model.
  20. 如权利要求19所述的方法,其特征在于,将所述待识别区域中的图像与预设的标准图像进行对齐,具体为:The method according to claim 19, wherein the image in the area to be identified is aligned with a preset standard image, specifically:
    根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标;Mapping the coordinates of each key point of the to-be-identified area to the key point coordinates of the aligned image according to the parameter M;
    其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。The parameter M is generated according to coordinates of each key point of the standard image and key point coordinates of an image corresponding to the specified feature in the labeled image.
  21. 如权利要求18所述的方法,其特征在于,确定所述归一化图像与第二待识别图像的归一化图像之间的度量距离,具体为:The method according to claim 18, wherein determining a metric distance between the normalized image and the normalized image of the second image to be recognized is specifically:
    通过卷积神经网络提取所述归一化图像中的指定特征;Extracting a specified feature in the normalized image by a convolutional neural network;
    根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
    确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
  22. 一种服务器,其特征在于,包括:A server, comprising:
    接收模块,用接收由所述客户端发送的身份认证请求,所述身份认证请求携带所述用户上传的第一待识别图像以及所述用户的认证信息;Receiving, by the receiving module, an identity authentication request sent by the client, where the identity authentication request carries the first to-be-identified image uploaded by the user and the authentication information of the user;
    查询模块,用于根据所述认证信息查询与所述用户对应的第二待识别图像;a querying module, configured to query, according to the authentication information, a second to-be-identified image corresponding to the user;
    获取模块,用于获取第一待识别图像中与指定特征对应的待对比区域;An acquiring module, configured to acquire an area to be compared corresponding to the specified feature in the first to-be-identified image;
    对齐模块,用于将所述待识别区域中的图像与预设的标准图像进行对齐, 并将对齐后的图像作为所述第一待识别图像的归一化图像,所述标准图像与所述指定特征对应;An alignment module, configured to align an image in the area to be identified with a preset standard image, And using the aligned image as a normalized image of the first to-be-identified image, the standard image corresponding to the designated feature;
    确定模块,用于确定所述第一待识别图像的所述归一化图像与第二待识别图像的归一化图像之间的度量距离,所述度量距离根据所述归一化图像以及所述第二待识别图像的归一化图像在特征空间中的距离生成,其中,相似的归一化图像在所述特征空间的距离小于非相似的归一化图像在所述特征空间的距离;a determining module, configured to determine a metric distance between the normalized image of the first to-be-identified image and a normalized image of the second to-be-identified image, the metric distance according to the normalized image and the Calculating a distance of the normalized image of the second image to be recognized in the feature space, wherein a distance of the similar normalized image in the feature space is smaller than a distance of the non-similar normalized image in the feature space;
    识别模块,用于在所述度量距离大于预设的阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征不相似,以及在所述度量距离小于或等于所述阈值时确认所述第一待识别图像与所述第二待识别图像的指定特征相似;An identification module, configured to confirm, when the metric distance is greater than a preset threshold, that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and that the metric distance is less than or equal to the threshold Confirming that the first to-be-identified image is similar to a specified feature of the second to-be-identified image;
    发送模块,用于在所述识别模块确认所述第一待识别图像与所述第二待识别图像的指定特征不相似时向所述客户端返回身份验证失败响应,以及在所述识别模块确认所述第一待识别图像与所述第二待识别图像的指定特征相似时向所述客户端返回身份验证成功响应。a sending module, configured to return an identity verification failure response to the client when the identification module confirms that the first to-be-identified image is not similar to a specified feature of the second to-be-identified image, and confirm in the identification module And returning the identity verification success response to the client when the first to-be-identified image is similar to the specified feature of the second to-be-identified image.
  23. 如权利要求22所述的服务器,其特征在于,所述确定模块具体用于:The server according to claim 22, wherein the determining module is specifically configured to:
    根据与所述指定特征对应的检测算法确定所述第一待识别图像中的所述待对比区域,通过预设的关键点回归模型获取所述待对比区域中与所述指定特征的多个关键点特征对应的关键点坐标。Determining the to-be-contrast area in the first to-be-identified image according to a detection algorithm corresponding to the specified feature, and acquiring a plurality of keys in the to-be-contrast area and the specified feature by using a preset key point regression model The key point coordinates corresponding to the point feature.
  24. 如权利要求23所述的服务器,其特征在于,所述对齐模块具体用于:The server according to claim 23, wherein the alignment module is specifically configured to:
    根据参数M将所述待识别区域的各关键点坐标映射为对齐后的图像的关键点坐标,其中,所述参数M为根据所述标准图像的各关键点坐标以及已标注图像中与所述指定特征对应的图像的关键点坐标生成的。Mapping each key point coordinate of the to-be-identified area to a key point coordinate of the aligned image according to the parameter M, wherein the parameter M is according to each key point coordinate of the standard image and the labeled image Specifies the keypoint coordinates of the image corresponding to the feature.
  25. 如权利要求22所述的服务器,其特征在于,所述获取模块具体用于:The server according to claim 22, wherein the obtaining module is specifically configured to:
    通过卷积神经网络提取所述归一化图像中的指定特征; Extracting a specified feature in the normalized image by a convolutional neural network;
    根据卷积神经网络以及距离度量损失函数确定所述指定特征在映射至特征空间后的特征值,并将所述特征值作为所述归一化图像的特征值;Determining, according to the convolutional neural network and the distance metric loss function, the feature value of the specified feature after mapping to the feature space, and using the feature value as the feature value of the normalized image;
    确定所述归一化图像的特征值与所述第二待识别图像的归一化图像的特征值之间的欧式距离,将所述欧式距离作为所述度量距离。 Determining an Euclidean distance between a feature value of the normalized image and a feature value of a normalized image of the second to-be-identified image, the Euclidean distance being used as the metric distance.
PCT/CN2016/079158 2015-05-07 2016-04-13 Similar image recognition method and device WO2016177259A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510229654.6 2015-05-07
CN201510229654.6A CN106203242B (en) 2015-05-07 2015-05-07 Similar image identification method and equipment

Publications (1)

Publication Number Publication Date
WO2016177259A1 true WO2016177259A1 (en) 2016-11-10

Family

ID=57217488

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/079158 WO2016177259A1 (en) 2015-05-07 2016-04-13 Similar image recognition method and device

Country Status (2)

Country Link
CN (1) CN106203242B (en)
WO (1) WO2016177259A1 (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108804996A (en) * 2018-03-27 2018-11-13 腾讯科技(深圳)有限公司 Face verification method, apparatus, computer equipment and storage medium
CN109345770A (en) * 2018-11-14 2019-02-15 深圳市尼欧科技有限公司 A kind of child leaves in-vehicle alarm system and child leaves interior alarm method
CN109508623A (en) * 2018-08-31 2019-03-22 杭州千讯智能科技有限公司 Item identification method and device based on image procossing
CN110084161A (en) * 2019-04-17 2019-08-02 中山大学 A kind of rapid detection method and system of skeleton key point
CN111079644A (en) * 2019-12-13 2020-04-28 四川新网银行股份有限公司 Method for recognizing external force to assist photographing based on distance and joint point and storage medium
CN112464689A (en) * 2019-09-06 2021-03-09 佳能株式会社 Method, device and system for generating neural network and storage medium for storing instructions
CN113568571A (en) * 2021-06-28 2021-10-29 西安电子科技大学 Image Deduplication Method Based on Residual Neural Network
CN113688737A (en) * 2017-12-15 2021-11-23 北京市商汤科技开发有限公司 Face image processing method, face image processing device, electronic apparatus, storage medium, and program
CN113744769A (en) * 2021-09-06 2021-12-03 盐城市聚云网络科技有限公司 Storage device for computer information security product
WO2022242713A1 (en) * 2021-05-21 2022-11-24 北京字跳网络技术有限公司 Image alignment method and device
US12314342B2 (en) 2019-03-26 2025-05-27 Huawei Technologies Co., Ltd. Object recognition method and apparatus
CN120411983A (en) * 2025-05-08 2025-08-01 南通神盾信息科技有限公司 Undocumented comparison information system, device and inspection method for OCR recognition and network electronic identity authentication

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106897390B (en) * 2017-01-24 2019-10-15 北京大学 Object Accurate Retrieval Method Based on Deep Metric Learning
CN108428242B (en) 2017-02-15 2022-02-08 宏达国际电子股份有限公司 Image processing apparatus and method thereof
CN108573201A (en) * 2017-03-13 2018-09-25 金德奎 A kind of user identity identification matching process based on face recognition technology
CA3034688C (en) * 2017-06-30 2021-11-30 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for verifying authenticity of id photo
CN107451965B (en) * 2017-07-24 2019-10-18 深圳市智美达科技股份有限公司 Distorted face image correction method, device, computer equipment and storage medium
CN108012080B (en) * 2017-12-04 2020-02-04 Oppo广东移动通信有限公司 Image processing method, image processing device, electronic equipment and computer readable storage medium
CN108932727B (en) * 2017-12-29 2021-08-27 浙江宇视科技有限公司 Face tracking method and device
CN110110189A (en) 2018-02-01 2019-08-09 北京京东尚科信息技术有限公司 Method and apparatus for generating information
CN108921209A (en) * 2018-06-21 2018-11-30 杭州骑轻尘信息技术有限公司 Image identification method, device and electronic equipment
CN109459873A (en) * 2018-11-12 2019-03-12 广州小鹏汽车科技有限公司 A kind of test method, device, Auto-Test System and storage medium
CN110781917B (en) * 2019-09-18 2021-03-02 北京三快在线科技有限公司 Method and device for detecting repeated image, electronic equipment and readable storage medium
US11610391B2 (en) * 2019-12-30 2023-03-21 Industrial Technology Research Institute Cross-domain image comparison method and system using semantic segmentation
CN112508109B (en) * 2020-12-10 2023-05-19 锐捷网络股份有限公司 Training method and device for image recognition model
CN112560971B (en) * 2020-12-21 2024-07-16 上海明略人工智能(集团)有限公司 Image classification method and system for active learning self-iteration
CN114359933B (en) * 2021-11-18 2022-09-20 珠海读书郎软件科技有限公司 Cover image identification method
CN114596594A (en) * 2022-01-20 2022-06-07 北京极豪科技有限公司 A fingerprint image matching method, device, medium and program product
CN116310420B (en) * 2023-03-22 2025-10-03 浙江大学嘉兴研究院 A method and device for measuring image similarity based on neighborhood difference

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030146913A1 (en) * 2002-02-07 2003-08-07 Hong Shen Object-correspondence identification without full volume registration
CN101669824A (en) * 2009-09-22 2010-03-17 浙江工业大学 Biometrics-based device for detecting indentity of people and identification
CN102629320A (en) * 2012-03-27 2012-08-08 中国科学院自动化研究所 Ordinal measurement statistical description face recognition method based on feature level
CN103207898A (en) * 2013-03-19 2013-07-17 天格科技(杭州)有限公司 Method for rapidly retrieving similar faces based on locality sensitive hashing
CN103678984A (en) * 2013-12-20 2014-03-26 湖北微模式科技发展有限公司 Method for achieving user authentication by utilizing camera

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101510257B (en) * 2009-03-31 2011-08-10 华为技术有限公司 Human face similarity degree matching method and device
CN102375970B (en) * 2010-08-13 2016-03-30 北京中星微电子有限公司 A kind of identity identifying method based on face and authenticate device
CN103824051B (en) * 2014-02-17 2017-05-03 北京旷视科技有限公司 Local region matching-based face search method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030146913A1 (en) * 2002-02-07 2003-08-07 Hong Shen Object-correspondence identification without full volume registration
CN101669824A (en) * 2009-09-22 2010-03-17 浙江工业大学 Biometrics-based device for detecting indentity of people and identification
CN102629320A (en) * 2012-03-27 2012-08-08 中国科学院自动化研究所 Ordinal measurement statistical description face recognition method based on feature level
CN103207898A (en) * 2013-03-19 2013-07-17 天格科技(杭州)有限公司 Method for rapidly retrieving similar faces based on locality sensitive hashing
CN103678984A (en) * 2013-12-20 2014-03-26 湖北微模式科技发展有限公司 Method for achieving user authentication by utilizing camera

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113688737A (en) * 2017-12-15 2021-11-23 北京市商汤科技开发有限公司 Face image processing method, face image processing device, electronic apparatus, storage medium, and program
CN108804996A (en) * 2018-03-27 2018-11-13 腾讯科技(深圳)有限公司 Face verification method, apparatus, computer equipment and storage medium
CN108804996B (en) * 2018-03-27 2022-03-04 腾讯科技(深圳)有限公司 Face verification method and device, computer equipment and storage medium
CN109508623A (en) * 2018-08-31 2019-03-22 杭州千讯智能科技有限公司 Item identification method and device based on image procossing
CN109345770A (en) * 2018-11-14 2019-02-15 深圳市尼欧科技有限公司 A kind of child leaves in-vehicle alarm system and child leaves interior alarm method
US12314342B2 (en) 2019-03-26 2025-05-27 Huawei Technologies Co., Ltd. Object recognition method and apparatus
CN110084161A (en) * 2019-04-17 2019-08-02 中山大学 A kind of rapid detection method and system of skeleton key point
CN112464689A (en) * 2019-09-06 2021-03-09 佳能株式会社 Method, device and system for generating neural network and storage medium for storing instructions
CN111079644A (en) * 2019-12-13 2020-04-28 四川新网银行股份有限公司 Method for recognizing external force to assist photographing based on distance and joint point and storage medium
WO2022242713A1 (en) * 2021-05-21 2022-11-24 北京字跳网络技术有限公司 Image alignment method and device
CN113568571A (en) * 2021-06-28 2021-10-29 西安电子科技大学 Image Deduplication Method Based on Residual Neural Network
CN113568571B (en) * 2021-06-28 2024-06-04 西安电子科技大学 Image de-duplication method based on residual neural network
CN113744769A (en) * 2021-09-06 2021-12-03 盐城市聚云网络科技有限公司 Storage device for computer information security product
CN120411983A (en) * 2025-05-08 2025-08-01 南通神盾信息科技有限公司 Undocumented comparison information system, device and inspection method for OCR recognition and network electronic identity authentication

Also Published As

Publication number Publication date
CN106203242A (en) 2016-12-07
CN106203242B (en) 2019-12-24

Similar Documents

Publication Publication Date Title
WO2016177259A1 (en) Similar image recognition method and device
US10755084B2 (en) Face authentication to mitigate spoofing
JP6754619B2 (en) Face recognition method and device
WO2020207189A1 (en) Method and device for identity authentication, storage medium, and computer device
US20230334089A1 (en) Entity recognition from an image
WO2021012526A1 (en) Face recognition model training method, face recognition method and apparatus, device, and storage medium
WO2018086607A1 (en) Target tracking method, electronic device, and storage medium
CN110472460B (en) Face image processing method and device
WO2022188697A1 (en) Biological feature extraction method and apparatus, device, medium, and program product
US10956738B1 (en) Identity authentication using an inlier neural network
CN105874474A (en) Systems and methods for facial representation
CN111091075A (en) Face recognition method and device, electronic equipment and storage medium
WO2018072028A1 (en) Face authentication to mitigate spoofing
WO2019033567A1 (en) Method for capturing eyeball movement, device and storage medium
US12192207B2 (en) Media data based user profiles
TW201822150A (en) Image-based discrimination method and device and computing device to solve the technical problem of poor consistency in the discrimination result of the pictures caused by manually selecting a plurality of discriminating conditions in performing discrimination on the pictures
WO2022078168A1 (en) Identity verification method and apparatus based on artificial intelligence, and computer device and storage medium
CN113591603A (en) Certificate verification method and device, electronic equipment and storage medium
KR20220000851A (en) Dermatologic treatment recommendation system using deep learning model and method thereof
CN118552826A (en) Visible light and infrared image target detection method and device based on dual-stream attention
CN114743277B (en) Liveness detection method, device, electronic device, storage medium and program product
Bhoir et al. A decision-making tool for creating and identifying face sketches
CN117218398A (en) Data processing method and related device
CN114722051B (en) Bioinformation updating method, device, equipment and medium
US12413596B2 (en) Enhanced authentication using a secure document

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: 16789253

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: 16789253

Country of ref document: EP

Kind code of ref document: A1