CN116935479B - Face recognition method and device, electronic equipment and storage medium - Google Patents

Face recognition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116935479B
CN116935479B CN202311190106.8A CN202311190106A CN116935479B CN 116935479 B CN116935479 B CN 116935479B CN 202311190106 A CN202311190106 A CN 202311190106A CN 116935479 B CN116935479 B CN 116935479B
Authority
CN
China
Prior art keywords
identified
face
target
face image
recognized
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311190106.8A
Other languages
Chinese (zh)
Other versions
CN116935479A (en
Inventor
李彦江
周龙
孙奥
李寅秋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Weiling Qingdao Network Security Research Institute Co ltd
Original Assignee
Weiling Qingdao Network Security Research Institute Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Weiling Qingdao Network Security Research Institute Co ltd filed Critical Weiling Qingdao Network Security Research Institute Co ltd
Priority to CN202311190106.8A priority Critical patent/CN116935479B/en
Publication of CN116935479A publication Critical patent/CN116935479A/en
Application granted granted Critical
Publication of CN116935479B publication Critical patent/CN116935479B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/168Feature extraction; Face representation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6218Protecting access to data via a platform, e.g. using keys or access control rules to a system of files or objects, e.g. local or distributed file system or database
    • G06F21/6245Protecting personal data, e.g. for financial or medical purposes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Bioethics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Computer Hardware Design (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Medical Informatics (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Artificial Intelligence (AREA)
  • Computing Systems (AREA)
  • Evolutionary Computation (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The application discloses a face recognition method, a face recognition device, electronic equipment and a storage medium, and relates to the technical field of computers, wherein the face recognition method comprises the following steps: acquiring a face image to be recognized, and extracting steganography data to be recognized from the face image to be recognized; extracting face features to be recognized of a face image to be recognized, matching the face features to be recognized with the face features in a database, and determining target face features with highest matching degree; determining a target verification code and a target identification code corresponding to the target face characteristics; judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not, and judging whether the similarity between the target identification code and the verification code to be identified is larger than or equal to a second preset value or not; and if so, determining the target face image as a face recognition result of the face image to be recognized. The application can effectively resist attack of the countering sample, improve the overall accuracy of face recognition and improve the safety of face image recognition.

Description

Face recognition method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a face recognition method, a device, an electronic apparatus, and a storage medium.
Background
In the related art, facial image recognition needs to extract feature data of a facial image through a neural network, search and match the feature data with feature templates stored in a database, and judge a matching result by using similarity. The challenge sample attack is a malicious attack aiming at a machine learning model, noise which is difficult to be perceived by human eyes is added to an image by the attack, so that the model is wrongly judged, the machine learning model cannot effectively recognize the challenge sample attack, and the safety of a human face image recognition technology is poor.
Therefore, how to effectively identify and fight against sample attack and improve the security of face image identification is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a face recognition method and device, electronic equipment and a computer readable storage medium, which can effectively recognize and fight against sample attack and improve the safety of face image recognition.
In order to achieve the above object, the present application provides a face recognition method, including:
acquiring a face image to be recognized, and extracting steganography data to be recognized from the face image to be recognized; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
Extracting face features to be recognized of the face image to be recognized, matching the face features to be recognized with the face features in a database, and determining target face features with highest matching degree;
determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not, and judging whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not;
and if so, determining the target face image as a face recognition result of the face image to be recognized.
The step of obtaining the face image to be recognized comprises the following steps:
acquiring an original face image to be identified, and determining a preset steganography feature and a preset steganography position;
processing the original face image to be recognized by using the first preset encryption algorithm to obtain the verification code to be recognized, and processing the identity information of the original face image to be recognized by using the second preset encryption algorithm to obtain the recognition code to be recognized;
Generating steganographic data based on the preset steganographic feature, the verification code to be identified and the identification code to be identified, and writing the steganographic data into the preset steganographic position in the original face image to be identified to generate the face image to be identified.
The processing the original face image to be identified by using the first preset encryption algorithm to obtain the verification code to be identified includes:
and processing the original face image to be recognized by using an SM3 encryption algorithm to obtain the verification code to be recognized.
The processing the identity information of the original face image to be identified by using the second preset encryption algorithm to obtain the identification code to be identified includes:
and processing the identity information of the original face image to be identified by using an SM4 encryption algorithm to obtain the identification code to be identified.
Before determining whether the similarity between the target verification code and the verification code to be identified is greater than or equal to a first preset value and whether the similarity between the target identification code and the verification code to be identified is greater than or equal to a second preset value, the method further comprises:
judging whether the steganographic features contained in the steganographic data to be identified are consistent with the preset steganographic features or not;
And if so, executing the step of judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value and whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value.
After the step of judging whether the similarity between the target verification code and the verification code to be identified is greater than or equal to a first preset value and the step of judging whether the similarity between the target identification code and the verification code to be identified is greater than or equal to a second preset value, the method further comprises the steps of:
if any item is not, sequencing the face features in the database according to the matching degree between the face features in the database and the face features to be identified from large to small;
determining the face features which are in the front preset quantity in the sequencing result and have the matching degree larger than a third preset value except the face features with the highest matching degree as candidate face features;
and sequentially re-determining the candidate face features as the target face features according to the sequencing result, and re-entering the step of determining the target verification codes and the target identification codes corresponding to the target face features.
Wherein, still include:
if the target face features meeting the condition that the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value and the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value do not exist, judging that the face identification fails, and determining the face image to be identified as a countersample image generated under the condition of attack.
To achieve the above object, the present application provides a face recognition apparatus comprising:
the acquisition module is used for acquiring a face image to be identified and extracting steganography data to be identified from the face image to be identified; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
the matching module is used for extracting the face characteristics to be identified of the face image to be identified, matching the face characteristics to be identified with the face characteristics in the database, and determining the target face characteristics with the highest matching degree;
The first determining module is used for determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
the first judging module is used for judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not and whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not;
and the second determining module is used for determining the target face image as a face recognition result of the face image to be recognized when the similarity between the target verification code and the verification code to be recognized is larger than or equal to a first preset value and the similarity between the target recognition code and the recognition code to be recognized is larger than or equal to a second preset value.
To achieve the above object, the present application provides an electronic device including:
a memory for storing a computer program;
And a processor for implementing the steps of the face recognition method as described above when executing the computer program.
To achieve the above object, the present application provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the face recognition method as described above.
According to the scheme, the face recognition method provided by the application comprises the following steps: acquiring a face image to be recognized, and extracting steganography data to be recognized from the face image to be recognized; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm; extracting face features to be recognized of the face image to be recognized, matching the face features to be recognized with the face features in a database, and determining target face features with highest matching degree; determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm; judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not, and judging whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not; and if so, determining the target face image as a face recognition result of the face image to be recognized.
According to the face recognition method provided by the application, the verification code and the identification code of the face image information are generated based on the cryptographic algorithm, the steganography data are formed and steganographically written in the face image, no influence is caused on the visible content of the face image, and the double matching of the verification code and the identification code is used, so that the attack of a countersample can be effectively resisted according to the comprehensive consideration of the similarity, the overall accuracy of face recognition is improved, and the safety of face image recognition is improved. The application also discloses a face recognition device, electronic equipment and a computer readable storage medium, and the technical effects can be achieved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application as claimed.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art. The accompanying drawings are included to provide a further understanding of the disclosure, and are incorporated in and constitute a part of this specification, illustrate the disclosure and together with the description serve to explain, but do not limit the disclosure. In the drawings:
FIG. 1 is a flow chart of a face recognition method according to an exemplary embodiment;
FIG. 2 is a flow chart illustrating another face recognition method according to an example embodiment;
fig. 3 is a block diagram of a face recognition apparatus according to an exemplary embodiment;
fig. 4 is a block diagram of an electronic device, according to an example embodiment.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. It will be apparent that the described embodiments are only some, but not all, embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. In addition, in the embodiments of the present application, "first", "second", etc. are used to distinguish similar objects and are not necessarily used to describe a particular order or precedence.
The embodiment of the application discloses a face recognition method, which can effectively recognize and fight against sample attack and improve the safety of face image recognition.
Referring to fig. 1, a flowchart of a face recognition method according to an exemplary embodiment is shown, as shown in fig. 1, including:
S101: acquiring a face image to be recognized, and extracting steganography data to be recognized from the face image to be recognized; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
the execution body of the embodiment may be a server, so as to determine a face recognition result of the face image to be recognized, that is, determine a target face image matched with the face image to be recognized in the database.
In this step, a face image to be recognized is obtained, and the steganographic data to be recognized is extracted at a preset steganographic position in the face image to be recognized, which includes a verification code to be recognized obtained by processing the face image to be recognized with a first preset encryption algorithm, and a recognition code to be recognized obtained by processing identity information of the face image to be recognized with a second preset encryption algorithm, where the identity information is, for example, an unrepeatable identity (ID, identity Document), and the steganographic data may also include preset steganographic features.
As a possible implementation manner, the acquiring the face image to be identified includes: acquiring an original face image to be identified, and determining a preset steganography feature and a preset steganography position; processing the original face image to be recognized by using the first preset encryption algorithm to obtain the verification code to be recognized, and processing the identity information of the original face image to be recognized by using the second preset encryption algorithm to obtain the recognition code to be recognized; generating steganographic data based on the preset steganographic feature, the verification code to be identified and the identification code to be identified, and writing the steganographic data into the preset steganographic position in the original face image to be identified to generate the face image to be identified.
In specific implementation, an original face image to be recognized is obtained, image preprocessing is carried out on the original face image to be recognized, and first, a preset steganography feature and a preset steganography position are determined. Secondly, the first preset encryption algorithm is utilized to process the original face image to be recognized to obtain the verification code to be recognized, and preferably, the SM3 encryption algorithm can be utilized to process the original face image to be recognized to obtain the verification code to be recognized. Then, the identity information of the original face image to be recognized is processed by using a second preset encryption algorithm to obtain the recognition code to be recognized, and preferably, the identity information of the original face image to be recognized can be processed by using an SM4 encryption algorithm to obtain the recognition code to be recognized. And the authentication code to be identified and the result of the identification code to be identified are unique, which are determined by the encryption algorithm properties of SM3 and SM 4. Furthermore, the steganography data is generated based on the preset steganography feature, the verification code and the identification code, and it is to be noted that, due to the algorithm feature, the encryption result length of the SM3 is fixed, the verification code length does not need to be represented separately, but the encryption result of the SM4 is affected by the identity information length, so that the identification code length needs to be recorded, and the complete sequence of the steganography data can be as follows: the steganographic feature |to-be-identified verification code |to-be-identified identification code length|to-be-identified identification code is preset. Finally, the steganography data are converted into 01bit strings, and the image steganography technology (LSB, least Significant Bit) is used for writing the steganography data into specific positions of the images to generate new face images with additional verification codes and identification codes, namely the face images to be identified. The image steganography technology utilizes the least significant bit of the pixel to encode ciphertext information into a face image, and the slight modification of the pixel cannot be recognized by naked eyes, so that the interference on a face recognition model is extremely low.
Based on SM3 cryptographic technology, generating verification codes corresponding to identity information, effectively protecting face image identity information, preventing face image identity leakage, encrypting image information based on SM4 cryptographic technology, generating identification codes in ciphertext state, under the condition that accurate matching cannot be achieved, presetting steganography features as features using the image preprocessing method, based on the information steganography technology of pictures, guaranteeing high availability of pictures under the condition that visual content of the pictures is not modified, and providing an effective path for discriminating correct face images by face recognition models.
The preprocessing process of the original face image to be recognized can be executed by the client or the server, and is not particularly limited herein. When the face image is executed by the client, the preprocessed face image to be recognized is transmitted to the server through a network.
S102: extracting face features to be recognized of the face image to be recognized, matching the face features to be recognized with the face features in a database, and determining target face features with highest matching degree;
in a specific implementation, the database of the server stores face features, identity information and image information in advance. In the step, the face features to be recognized of the face image to be recognized are extracted and matched with the face features in the database, and the target face feature with the highest matching degree is selected. Therefore, in this embodiment, the server only needs to acquire the face features, the identity information and the image information in the database, so that the face recognition of the face image to be recognized can be realized, and the complete face image in the database is not required to be acquired.
S103: determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
in the step, corresponding image information and identity information are searched in a database according to the characteristics of the target face, verification codes and identification codes are generated by using the same identity information and the same image information through the same algorithm, the image information is processed through a first preset encryption algorithm to obtain a target verification code, and the identity information is processed through a second preset encryption algorithm to obtain the target identification code.
S104: judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not, and judging whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not; if both are, then enter S105;
s105: and determining the target face image as a face recognition result of the face image to be recognized.
In specific implementation, if the face image to be identified is a face image carrying steganographic information and the image information is not damaged, the target verification code is consistent with the verification code to be identified, the target identification code is consistent with the identification code to be identified, the face identification result is correct, and the target face image corresponding to the target face feature is determined as the face identification result of the face image to be identified.
However, if the image is slightly damaged, the verification code and the identification code may not be completely matched, at this time, the similarity between the target verification code and the verification code to be identified and the similarity between the target identification code and the identification code to be identified are calculated, and whether the identities are identical is determined according to the similarity between the verification code and the identification code. Firstly, judging whether the steganographic features contained in the steganographic data to be identified are consistent with preset steganographic features or not; if the similarity is consistent, judging whether the similarity between the target verification code and the verification code to be identified is greater than or equal to a first preset value, and whether the similarity between the target identification code and the verification code to be identified is greater than or equal to a second preset value; if the face recognition results are correct, determining the target face image corresponding to the target face features as the face recognition result of the face image to be recognized. The first preset value and the second preset value may be the same or different, and are not particularly limited herein.
Based on the detection of the steganography characteristic value, whether the picture is generated by using the image preprocessing method can be rapidly judged, the countermeasure sample generated by the attack can be effectively identified, based on the detection of the verification code, whether the identity information carried by the image is consistent with the face recognition detection result is judged, based on the detection of the identification code, the image information carried by the image is obtained, whether the identity information carried by the image is consistent with the identity information corresponding to the face recognition detection result is judged, based on the similarity analysis, the steganography characteristic value, the verification code and the identification code extracted from the image are comprehensively compared with the verification identification code calculated according to the face recognition result, and whether the identities are identical is judged.
According to the face recognition method provided by the embodiment of the application, the verification code and the identification code of the face image information are generated based on the cryptographic algorithm, the steganography data are formed and steganographically written in the face image, no influence is caused on the visible content of the face image, and the double matching of the verification code and the identification code is used, and according to the similarity comprehensive consideration, the attack of a countersample can be effectively resisted, the overall accuracy of face recognition is improved, and the safety of face image recognition is improved.
The embodiment of the application discloses a face recognition method, and compared with the previous embodiment, the technical scheme is further described and optimized. Specific:
Referring to fig. 2, a flowchart of another face recognition method according to an exemplary embodiment is shown, as shown in fig. 2, including:
s201: acquiring a face image to be recognized, and extracting steganography data to be recognized from the face image to be recognized; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
s202: extracting face features to be recognized of the face image to be recognized, matching the face features to be recognized with the face features in a database, and determining target face features with highest matching degree;
s203: determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
S204: judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not, and judging whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not; if both are, then go to S205; if either one is not, then enter S206;
s205: determining the target face image as a face recognition result of the face image to be recognized;
s206: sorting the face features in the database according to the matching degree between the face features in the database and the face features to be identified from large to small;
s207: determining the face features which are in the front preset quantity in the sequencing result and have the matching degree larger than a third preset value except the face features with the highest matching degree as candidate face features;
s208: and sequentially redetermining the candidate face features as the target face features according to the sequencing result, and re-entering step S203.
It can be understood that, in general, the face recognition cannot reach 100% of accuracy, and the artificial intelligent face recognition model has higher feature matching to the correct face, however, in the face recognition model, the generated challenge sample image is most likely to be set up as the final recognition result of the model judgment with the highest matching degree, so as to cause recognition errors or misjudgment.
Therefore, in this embodiment, if the similarity of the verification code or the identification code is low, that is, the similarity between the target verification code and the identification code to be identified is smaller than the first preset value, or, if the similarity between the target identification code and the identification code to be identified is smaller than the second preset value, the facial features in the database are sorted according to the degree of matching between the facial features to be identified and the facial features to be identified from large to small, the facial features with the preset number of ranks and the degree of matching being greater than the third preset value are selected, for example, the facial features with the rank being 5 and the degree of matching being greater than 80% are selected, the facial features selected except the facial feature with the highest degree of matching are determined to be the facial features to be candidates, the first facial feature to be candidates is redetermined according to the sorting result, and then step S203 is re-entered, if the similarity between the target verification code and the identification code to be greater than or equal to the first preset value and the similarity between the target identification code to the facial features to be identified is greater than or equal to the second preset value, otherwise, the facial features to be the target image to be re-identified is re-entered as the target facial feature to be determined as the target facial feature.
As a preferred embodiment, the present embodiment further includes: if the target face features meeting the condition that the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value and the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value do not exist, judging that the face identification fails, and determining the face image to be identified as a countersample image generated under the condition of attack.
In a specific implementation, if any candidate face feature does not meet the requirement that the similarity between the target verification code and the verification code to be identified is greater than or equal to a first preset value, and the similarity between the target identification code and the identification code to be identified is greater than or equal to a second preset value, the face identification fails, and the face image is judged to be an anti-sample image generated under the condition of being attacked.
Therefore, in the embodiment, on the premise that the optimal face recognition result cannot be matched, the results with suboptimal matching degree are verified, so that the accuracy of face recognition is improved.
The following describes a face recognition device according to an embodiment of the present application, and the face recognition device described below and the face recognition method described above may be referred to each other.
Referring to fig. 3, a structure diagram of a face recognition apparatus according to an exemplary embodiment is shown, as shown in fig. 3, including:
the acquiring module 301 is configured to acquire a face image to be identified, and extract steganography data to be identified from the face image to be identified; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
the matching module 302 is configured to extract a face feature to be identified of the face image to be identified, match the face feature to be identified with a face feature in a database, and determine a target face feature with the highest matching degree;
a first determining module 303, configured to determine a target verification code and a target identification code corresponding to the target face feature; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
A first judging module 304, configured to judge whether a similarity between the target verification code and the verification code to be identified is greater than or equal to a first preset value, and whether a similarity between the target identification code and the identification code to be identified is greater than or equal to a second preset value;
the second determining module 305 is configured to determine the target face image as a face recognition result of the face image to be recognized when the similarity between the target verification code and the verification code to be recognized is greater than or equal to a first preset value and the similarity between the target identification code and the identification code to be recognized is greater than or equal to a second preset value.
According to the face recognition device provided by the embodiment of the application, the verification code and the identification code of the face image information are generated based on the cryptographic algorithm, the steganography data are formed and steganographically written in the face image, no influence is caused on the visible content of the face image, and the double matching of the verification code and the identification code is used, and according to the similarity comprehensive consideration, the attack of a countersample can be effectively resisted, the overall accuracy of face recognition is improved, and the safety of face image recognition is improved.
On the basis of the above embodiment, as a preferred implementation manner, the obtaining module 301 includes:
The acquisition unit is used for acquiring the original face image to be identified and determining a preset steganography feature and a preset steganography position;
the processing unit is used for processing the original face image to be identified by utilizing the first preset encryption algorithm to obtain the verification code to be identified, and processing the identity information of the original face image to be identified by utilizing the second preset encryption algorithm to obtain the identification code to be identified;
the generating unit is used for generating steganographic data based on the preset steganographic feature, the verification code to be identified and the identification code to be identified, writing the steganographic data into the preset steganographic position in the original face image to be identified, and generating the face image to be identified.
On the basis of the above embodiment, as a preferred implementation manner, the processing unit is specifically configured to: processing the original face image to be recognized by using an SM3 encryption algorithm to obtain the verification code to be recognized; and processing the identity information of the original face image to be identified by using an SM4 encryption algorithm to obtain the identification code to be identified.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
The second judging module is used for judging whether the steganographic features contained in the steganographic data to be identified are consistent with the preset steganographic features or not; if so, the workflow of the first determination module 304 is initiated.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
the sorting module is used for sorting the face features in the database according to the matching degree between the face features in the database and the face features to be identified when the similarity between the target verification code and the verification code to be identified is greater than or equal to a first preset value and the similarity between the target identification code and the identification code to be identified is greater than or equal to a second preset value;
the third determining module is used for determining the face features which are in the front preset number in the sequencing result and have the matching degree larger than a third preset value, except the face features with the highest matching degree, as candidate face features;
and a fourth determining module, configured to sequentially redetermine the candidate face features to the target face features according to the sorting result, and restart the workflow of the first determining module 303.
On the basis of the above embodiment, as a preferred implementation manner, the method further includes:
and the judging module is used for judging that the face identification fails when no target face features exist, wherein the target face features meet the condition that the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value and the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value, and determining the face image to be identified as an anti-sample image generated under the condition of attack.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Based on the hardware implementation of the program modules, and in order to implement the method according to the embodiment of the present application, the embodiment of the present application further provides an electronic device, and fig. 4 is a block diagram of an electronic device according to an exemplary embodiment, and as shown in fig. 4, the electronic device includes:
a communication interface 1 capable of information interaction with other devices such as network devices and the like;
and the processor 2 is connected with the communication interface 1 to realize information interaction with other devices and is used for executing the face recognition method provided by one or more technical schemes when running the computer program. And the computer program is stored on the memory 3.
Of course, in practice, the various components in the electronic device are coupled together by a bus system 4. It will be appreciated that the bus system 4 is used to enable connected communications between these components. The bus system 4 comprises, in addition to a data bus, a power bus, a control bus and a status signal bus. But for clarity of illustration the various buses are labeled as bus system 4 in fig. 4.
The memory 3 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device. Examples of such data include: any computer program for operating on an electronic device.
It will be appreciated that the memory 3 may be either volatile memory or nonvolatile memory, and may include both volatile and nonvolatile memory. Wherein the nonvolatile Memory may be Read Only Memory (ROM), programmable Read Only Memory (PROM, programmable Read-Only Memory), erasable programmable Read Only Memory (EPROM, erasable Programmable Read-Only Memory), electrically erasable programmable Read Only Memory (EEPROM, electrically Erasable Programmable Read-Only Memory), magnetic random access Memory (FRAM, ferromagnetic random access Memory), flash Memory (Flash Memory), magnetic surface Memory, optical disk, or compact disk Read Only Memory (CD-ROM, compact Disc Read-Only Memory); the magnetic surface memory may be a disk memory or a tape memory. The volatile memory may be random access memory (RAM, random Access Memory), which acts as external cache memory. By way of example, and not limitation, many forms of RAM are available, such as static random access memory (SRAM, static Random Access Memory), synchronous static random access memory (SSRAM, synchronous Static Random Access Memory), dynamic random access memory (DRAM, dynamic Random Access Memory), synchronous dynamic random access memory (SDRAM, synchronous Dynamic Random Access Memory), double data rate synchronous dynamic random access memory (ddr SDRAM, double Data Rate Synchronous Dynamic Random Access Memory), enhanced synchronous dynamic random access memory (ESDRAM, enhanced Synchronous Dynamic Random Access Memory), synchronous link dynamic random access memory (SLDRAM, syncLink Dynamic Random Access Memory), direct memory bus random access memory (DRRAM, direct Rambus Random Access Memory). The memory 3 described in the embodiments of the present application is intended to comprise, without being limited to, these and any other suitable types of memory.
The method disclosed in the above embodiment of the present application may be applied to the processor 2 or implemented by the processor 2. The processor 2 may be an integrated circuit chip with signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in the processor 2 or by instructions in the form of software. The processor 2 described above may be a general purpose processor, DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. The processor 2 may implement or perform the methods, steps and logic blocks disclosed in embodiments of the present application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in the embodiment of the application can be directly embodied in the hardware of the decoding processor or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium in the memory 3 and the processor 2 reads the program in the memory 3 to perform the steps of the method described above in connection with its hardware.
The corresponding flow in each method of the embodiments of the present application is implemented when the processor 2 executes the program, and for brevity, will not be described in detail herein.
In an exemplary embodiment, the present application also provides a storage medium, i.e. a computer storage medium, in particular a computer readable storage medium, for example comprising a memory 3 storing a computer program executable by the processor 2 for performing the steps of the method described above. The computer readable storage medium may be FRAM, ROM, PROM, EPROM, EEPROM, flash Memory, magnetic surface Memory, optical disk, CD-ROM, etc.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware associated with program instructions, where the foregoing program may be stored in a computer readable storage medium, and when executed, the program performs steps including the above method embodiments; and the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
Alternatively, the above-described integrated units of the present application may be stored in a computer-readable storage medium if implemented in the form of software functional modules and sold or used as separate products. Based on such understanding, the technical solutions of the embodiments of the present application may be embodied essentially or in part in the form of a software product stored in a storage medium, including instructions for causing an electronic device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a removable storage device, ROM, RAM, magnetic or optical disk, or other medium capable of storing program code.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A face recognition method, comprising:
acquiring a face image to be recognized, and extracting steganography data to be recognized from the face image to be recognized; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
extracting face features to be recognized of the face image to be recognized, matching the face features to be recognized with the face features in a database, and determining target face features with highest matching degree;
determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
Judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not, and judging whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not;
if yes, determining the target face image as a face recognition result of the face image to be recognized;
the step of obtaining the face image to be recognized comprises the following steps:
acquiring an original face image to be identified, and determining a preset steganography feature and a preset steganography position;
processing the original face image to be recognized by using the first preset encryption algorithm to obtain the verification code to be recognized, and processing the identity information of the original face image to be recognized by using the second preset encryption algorithm to obtain the recognition code to be recognized;
generating steganographic data based on the preset steganographic feature, the verification code to be identified and the identification code to be identified, and writing the steganographic data into the preset steganographic position in the original face image to be identified to generate the face image to be identified.
2. The face recognition method according to claim 1, wherein the processing the original face image to be recognized by using the first preset encryption algorithm to obtain the verification code to be recognized includes:
And processing the original face image to be recognized by using an SM3 encryption algorithm to obtain the verification code to be recognized.
3. The face recognition method according to claim 1, wherein the processing the identity information of the original face image to be recognized by using the second preset encryption algorithm to obtain the recognition code to be recognized includes:
and processing the identity information of the original face image to be identified by using an SM4 encryption algorithm to obtain the identification code to be identified.
4. The face recognition method according to claim 1, wherein before determining whether the similarity between the target verification code and the verification code to be recognized is greater than or equal to a first preset value, and whether the similarity between the target identification code and the recognition code to be recognized is greater than or equal to a second preset value, further comprises:
judging whether the steganographic features contained in the steganographic data to be identified are consistent with the preset steganographic features or not;
and if so, executing the step of judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value and whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value.
5. The face recognition method according to claim 1, wherein after the determining whether the similarity between the target verification code and the verification code to be recognized is greater than or equal to a first preset value, and whether the similarity between the target identification code and the recognition code to be recognized is greater than or equal to a second preset value, further comprises:
if any item is not, sequencing the face features in the database according to the matching degree between the face features in the database and the face features to be identified from large to small;
determining the face features which are in the front preset quantity in the sequencing result and have the matching degree larger than a third preset value except the face features with the highest matching degree as candidate face features;
and sequentially re-determining the candidate face features as the target face features according to the sequencing result, and re-entering the step of determining the target verification codes and the target identification codes corresponding to the target face features.
6. The face recognition method of claim 5, further comprising:
if the target face features meeting the condition that the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value and the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value do not exist, judging that the face identification fails, and determining the face image to be identified as a countersample image generated under the condition of attack.
7. A face recognition device, comprising:
the acquisition module is used for acquiring a face image to be identified and extracting steganography data to be identified from the face image to be identified; the to-be-identified steganography data comprises to-be-identified verification codes and to-be-identified identification codes, wherein the to-be-identified verification codes are obtained by processing the to-be-identified face image through a first preset encryption algorithm, and the to-be-identified identification codes are obtained by processing identity information of the to-be-identified face image through a second preset encryption algorithm;
the matching module is used for extracting the face characteristics to be identified of the face image to be identified, matching the face characteristics to be identified with the face characteristics in the database, and determining the target face characteristics with the highest matching degree;
the first determining module is used for determining a target verification code and a target identification code corresponding to the target face characteristics; the target verification code is obtained by processing a target face image corresponding to the target face feature by using a first preset encryption algorithm, and the target identification code is obtained by processing identity information of the target face image by using a second preset encryption algorithm;
The first judging module is used for judging whether the similarity between the target verification code and the verification code to be identified is larger than or equal to a first preset value or not and whether the similarity between the target identification code and the identification code to be identified is larger than or equal to a second preset value or not;
the second determining module is used for determining the target face image as a face recognition result of the face image to be recognized when the similarity between the target verification code and the verification code to be recognized is larger than or equal to a first preset value and the similarity between the target recognition code and the recognition code to be recognized is larger than or equal to a second preset value;
wherein, the acquisition module includes:
the acquisition unit is used for acquiring the original face image to be identified and determining a preset steganography feature and a preset steganography position;
the processing unit is used for processing the original face image to be identified by utilizing the first preset encryption algorithm to obtain the verification code to be identified, and processing the identity information of the original face image to be identified by utilizing the second preset encryption algorithm to obtain the identification code to be identified;
the generating unit is used for generating steganographic data based on the preset steganographic feature, the verification code to be identified and the identification code to be identified, writing the steganographic data into the preset steganographic position in the original face image to be identified, and generating the face image to be identified.
8. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the face recognition method according to any one of claims 1 to 6 when executing the computer program.
9. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the face recognition method according to any one of claims 1 to 6.
CN202311190106.8A 2023-09-15 2023-09-15 Face recognition method and device, electronic equipment and storage medium Active CN116935479B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311190106.8A CN116935479B (en) 2023-09-15 2023-09-15 Face recognition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311190106.8A CN116935479B (en) 2023-09-15 2023-09-15 Face recognition method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116935479A CN116935479A (en) 2023-10-24
CN116935479B true CN116935479B (en) 2023-12-15

Family

ID=88388172

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311190106.8A Active CN116935479B (en) 2023-09-15 2023-09-15 Face recognition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116935479B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020124579A1 (en) * 2018-12-21 2020-06-25 华为技术有限公司 Method for verifying user identity, and electronic device
CN111368772A (en) * 2020-03-11 2020-07-03 杭州海康威视系统技术有限公司 Identity recognition method, device, equipment and storage medium
CN113762106A (en) * 2021-08-23 2021-12-07 深圳云天励飞技术股份有限公司 Face recognition method and device, electronic equipment and storage medium
CN114373209A (en) * 2021-12-30 2022-04-19 深圳云天励飞技术股份有限公司 Video-based face recognition method and device, electronic equipment and storage medium
CN115761840A (en) * 2022-10-24 2023-03-07 林义江 Face recognition protection system based on big data platform
CN116383793A (en) * 2023-04-23 2023-07-04 上海万雍科技股份有限公司 Face data processing method, device, electronic equipment and computer readable medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020124579A1 (en) * 2018-12-21 2020-06-25 华为技术有限公司 Method for verifying user identity, and electronic device
CN111368772A (en) * 2020-03-11 2020-07-03 杭州海康威视系统技术有限公司 Identity recognition method, device, equipment and storage medium
CN113762106A (en) * 2021-08-23 2021-12-07 深圳云天励飞技术股份有限公司 Face recognition method and device, electronic equipment and storage medium
CN114373209A (en) * 2021-12-30 2022-04-19 深圳云天励飞技术股份有限公司 Video-based face recognition method and device, electronic equipment and storage medium
CN115761840A (en) * 2022-10-24 2023-03-07 林义江 Face recognition protection system based on big data platform
CN116383793A (en) * 2023-04-23 2023-07-04 上海万雍科技股份有限公司 Face data processing method, device, electronic equipment and computer readable medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
杨雄 ; .云环境下融合FHE和人脸识别的身份认证方案.贵州大学学报(自然科学版).2019,(06),全文. *
龙玉倩 ; .人脸识别技术及其展望.数码世界.2019,(05),全文. *

Also Published As

Publication number Publication date
CN116935479A (en) 2023-10-24

Similar Documents

Publication Publication Date Title
US11210510B2 (en) Storing anonymized identifiers instead of personally identifiable information
CN109729383B (en) Double-recording video quality detection method and device, computer equipment and storage medium
JP6651565B2 (en) Biometric template security and key generation
US11615176B2 (en) Registration and verification of biometric modalities using encryption techniques in a deep neural network
US20190332755A1 (en) Secure chip, biological feature identification method, and biological feature template registration method
US20230076017A1 (en) Method for training neural network by using de-identified image and server providing same
WO2017215533A1 (en) Biological characteristic recognition device and method and biological characteristic template registration method
Liu et al. Data protection in palmprint recognition via dynamic random invisible watermark embedding
Dhruva et al. Novel algorithm for image processing based hand gesture recognition and its application in security
CN116935479B (en) Face recognition method and device, electronic equipment and storage medium
CN117197857A (en) Face counterfeiting attack detection and face recognition method, device and equipment
US20230133033A1 (en) System and method for processing a data subject rights request using biometric data matching
CN1427983A (en) Biometric identification, portable electronic device and electronic device acquiring biometric data therefor
CN116453196A (en) Face recognition method and system
CN110968275A (en) The anti-counterfeiting tracing system and method for the printed document
CN113239852B (en) Privacy image processing method, device and equipment based on privacy protection
Boragule et al. On-device Face Authentication System for ATMs and Privacy Preservation
CN114692222A (en) Image processing method and device
Pashalidis Simulated annealing attack on certain fingerprint authentication systems
CN115526282A (en) Watermark encryption method, watermark extraction method, device and storage medium
CN111931148A (en) Image processing method and device and electronic equipment
KR100919486B1 (en) Method for aligning concealed fingerprint data using partial geometric hashing, Method for authenticating fingerprint data using partial geometric hashing, Apparatus and System thereof
CN110222753A (en) Character recognition verification method, system, computer equipment, storage medium and chip
Vensila et al. Template protection in multimodal biometric system using watermarking approach
CN117272333B (en) Relational database watermark embedding and tracing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant