CN110321790A - The detection method and electronic equipment of a kind of pair of resisting sample - Google Patents

The detection method and electronic equipment of a kind of pair of resisting sample Download PDF

Info

Publication number
CN110321790A
CN110321790A CN201910425689.5A CN201910425689A CN110321790A CN 110321790 A CN110321790 A CN 110321790A CN 201910425689 A CN201910425689 A CN 201910425689A CN 110321790 A CN110321790 A CN 110321790A
Authority
CN
China
Prior art keywords
pixel value
shelter
electronic equipment
entropy
picture
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.)
Granted
Application number
CN201910425689.5A
Other languages
Chinese (zh)
Other versions
CN110321790B (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies 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 Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201910425689.5A priority Critical patent/CN110321790B/en
Publication of CN110321790A publication Critical patent/CN110321790A/en
Priority to PCT/CN2020/091027 priority patent/WO2020233564A1/en
Application granted granted Critical
Publication of CN110321790B publication Critical patent/CN110321790B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Image Analysis (AREA)
  • Telephone Function (AREA)
  • Collating Specific Patterns (AREA)

Abstract

The embodiment of the present application discloses the detection method of a kind of pair of resisting sample, (such as: the face payment of mobile phone applied to recognition of face scene, face unlock etc.), including: electronic equipment passes through the facial image at camera shooting equipment acquisition current time (such as: the face picture of shooting is made video recording the face picture of middle interception from the camera shooting of shooting), and judge within the scope of the human face region of the facial image with the presence or absence of shelter (such as: glasses, paster etc.), if it exists, then further judge whether the shelter is to resisting sample chaff interferent, if to resisting sample chaff interferent, then determine that the facial image is to resisting sample (explanation by attack resisting sample).This detection method does not need to carry out depth model training to a large amount of confrontation samples pictures, also it requires no knowledge about and generates to the generator of resisting sample using which kind of to resisting sample generating algorithm, the facial image that attacker is known in advance is not needed more, it can detect whether to exist to resisting sample, detection complexity is low, it is easy to accomplish.

Description

The detection method and electronic equipment of a kind of pair of resisting sample
Technical field
This application involves field of image recognition more particularly to the detection methods and electronic equipment of a kind of pair of resisting sample.
Background technique
Deep learning is the core technology of nowadays machine learning and artificial intelligence field application.In field of machine vision, It has become recognition of face, automatic Pilot, monitoring, security application in the main force.However, deep learning network is in input The slight perturbations having be it is very fragile, these slight perturbations will lead to the recognition result of deep learning network output error.Example Such as, in field of image recognition, (occur when the pixel value of the partial pixel point in deep learning network inputs picture changes Slight perturbations), then it will lead to the recognition result of deep learning network output error.This slight perturbations human eye is not noticeable, but But deep learning network can be cheated completely.It is this appropriate disturbance to be added in input picture to make deep learning network export The attack method of wrong identification result, which is referred to as, attacks resisting sample, wherein the input picture being added after disturbance, which is referred to as, fights sample This.An example to resisting sample attack as shown in Figure 1, to panda picture (i.e. input picture) be added it is a certain amount of be not easy by The disturbance (changing the pixel value of the partial pixel point of input picture) that human eye is discovered, as a result makes to export picture by deep learning net Network is mistakenly identified as gibbon.However the output picture is but no different with input picture in human eye.It is above-mentioned this resisting sample to be attacked The mode hit can only carry out (changing partial pixel point to the picture deposited in a device for the picture being already present in equipment Pixel value).And for face picture (the i.e. unlatching camera shooting that in recognition of face scene, equipment takes current time Real-time face picture) can not then do pixel interference processing.Based on this, then occur another form of attacking resisting sample Hit: attacker by wearing the confrontation sample article Jing Guo specially treated (such as to resisting sample glasses/spectacle-frame, confrontation on the face Sample paster etc.) mode, so that attacker is identified as preassigned people (i.e. victim) by face identification system.
Currently, for above two form (i.e. it is existing input picture in change partial pixel point pixel value, it is current when Carve shooting face picture with confrontation sample article) to resisting sample attack settling mode have following two: 1) will be right Resisting sample and original input picture are input in deep learning network collectively as training dataset, and by the training dataset Model training is carried out, confrontation sample detector is generated.Be can detecte out with the confrontation sample detector picture that inputs whether be To resisting sample.2) according to the recognition result of original input picture and to the letter of the difference degree between the recognition result of resisting sample Number (i.e. loss function), training generate denoising device, remove dryness processing to resisting sample to input with the denoising device and (remove pair The disturbance added in resisting sample).
However, above-mentioned settling mode all existing defects to resisting sample attack: 1) fighting sample detector can only detect By known confrontation pattern generator generation to resisting sample, and want that the confrontation sample detector is enable to detect all pairs Resisting sample then needs to be trained resisting sample for what is generated by the confrontation pattern generator of all kinds, and this operation is not Only cost is huge and is not easy to realize.2) denoising device can only be at having that known confrontation pattern generator generates to resisting sample Reason, and need to be known in advance and be attacked with the presence or absence of to resisting sample.Meanwhile this method also needs to be known in advance the original graph of attacker Recognition result of the piece in picture recognition system, that is, needing to be known in advance attacker is whom, this is difficult in practical application scene It realizes.
Summary of the invention
The embodiment of the present application first aspect provides the detection method of a kind of pair of resisting sample, which is applied to electronics The recognition of face scene (such as: face payment, the face unlock of mobile phone) of equipment, specifically includes:
Firstly, electronic equipment can equip the facial image at acquisition current time (as: current time shoots by camera shooting Face picture is made video recording the face picture of middle interception from the camera shooting that current time shoots).It should be noted that camera shooting equipment can be with Be on electronic equipment carry camera, be also possible to be physically separated with electronic equipment but be wirelessly connected camera (such as: The camera that mobile phone is not turned on included camera, the camera of mobile phone is damaged or the mobile phone does not carry, but deposit The hand-held camera of bluetooth connection is being carried out with the mobile phone), specifically camera shooting is equipped without limitation herein.Also need to illustrate Be, electronic equipment by the facial image at camera shooting equipment acquisition current time can there are many form, for example, it may be in response to Triggering to some operational order, the i.e. execution of some operational order can trigger electronic equipment and acquire current time by camera Facial image, it is in the open state always to be also possible to camera shooting equipment, as long as camera shooting equipment captures current time there are people Face image, electronic equipment just acquire the facial image, specifically herein to the shape of the facial image at electronic equipment acquisition current time Formula is without limitation.If detecting the presence of screening within the scope of human face region in the electronic equipment facial image that the moment shoots in this prior Block material (such as: glasses, paster), then electronic equipment can further judge whether the shelter is to resisting sample chaff interferent, if electric Sub- equipment determines that the shelter is to resisting sample chaff interferent, then electronic equipment can determine whether that the current time facial image of shooting is To resisting sample (i.e. by attack resisting sample).
In the embodiment of the present application, blocking within the scope of human face region in the facial image by judging current time shooting Whether object is to determine whether the facial image is to resisting sample to resisting sample chaff interferent.Confrontation used by the embodiment of the present application The detection method of sample is applied to recognition of face scene, and this detection method does not need to carry out a large amount of confrontation samples pictures deep Spend model training, also require no knowledge about generate to the generator of resisting sample using which kind of to resisting sample generating algorithm (including It is known or most newly generated to resisting sample generating algorithm), the facial image that attacker is known in advance is not needed more, can be examined It measures with the presence or absence of to resisting sample, resisting sample is attacked so that attacker be made to cannot achieve.And this detection method complexity It is low, it is easy to accomplish.
In conjunction with the embodiment of the present application in a first aspect, in the first embodiment of the embodiment of the present application first aspect, electricity Sub- equipment judges that shelter whether be to resisting sample chaff interferent may include: the pixel firstly, to all pixels point in shelter Value is calculated, and the picture entropy of the shelter is obtained;Later, with the picture entropy of calculated shelter with it is pre-set Threshold value (i.e. preset threshold) be compared, to judge whether shelter is to resisting sample chaff interferent.The preset threshold can root It is determined according to the first predetermined manner, for example, can be user according to warp by the preset threshold that first predetermined manner determines Value setting is tested, is also possible to based on the generation of deep learning network query function, specifically herein without limitation.Finally, if the picture Entropy is greater than above-mentioned preset threshold, it is determined that the shelter is to resisting sample chaff interferent.
In the embodiment of the present application, by calculating the picture entropy of shelter, and by the picture entropy and preset threshold phase Compare to judge that shelter whether to resisting sample chaff interferent, has practical operation.
In conjunction with the first embodiment of the embodiment of the present application first aspect, the second of the embodiment of the present application first aspect In kind embodiment, the picture entropy for be calculated the shelter to the pixel value of all pixels point in shelter be can wrap It includes: the pixel value of all pixels point in the shelter is decomposed into primary vector pixel value (alternatively referred to as X-axis picture in color space Element value), secondary vector pixel value (alternatively referred to as Y-axis pixel value) and third vector pixel value (alternatively referred to as Z axis pixel value), obtain To the first set of primary vector pixel value, the second set of secondary vector pixel value and to the third collection of third vector pixel value It closes;Later, the first picture entropy of first set, the second picture entropy of second set are calculated separately according to entropy calculation formula With the third picture entropy of third set;Finally, to the first picture entropy, the second picture entropy and the third picture entropy Value takes arithmetic mean of instantaneous value, and using the arithmetic mean of instantaneous value as the picture entropy of the shelter.In the embodiment of the present application, it illustrates The picture entropy of shelter how is calculated, i.e., is first decoupled all pixels point of shelter in color space, then basis Entropy calculation formula is calculated, this calculation is simple, conveniently, it is easy to operate.
In conjunction with second of embodiment of the embodiment of the present application first aspect, in the third of the embodiment of the present application first aspect In kind embodiment, above-mentioned entropy calculation formula be may is thatWherein, i be the first set, institute State the value of each element in second set or the third set, piFor the probability that the i occurs, H is the first picture entropy Value, the second picture entropy or the third picture entropy.That is, if when the shelter is grey picture, the shelter Value of the pixel value of middle all pixels point in color space (such as: RGB color model) in each reference axis is identical 's.Entropy calculation formula so can be passed through to the calculating of the picture entropy of the shelterIt obtains, Wherein, i is the pixel value of each pixel in shelter, piFor the probability that pixel value i occurs, H is just the figure of the shelter Piece entropy.If the shelter is color image, picture entropy of the shelter in each reference axis on color space Also used entropy calculation formula when still can be according to above-mentioned calculating grey pictureIt calculates It arrives.I.e. when calculating the first picture entropy in X-coordinate axle, i is just the value of each pixel value in first set, piJust it is The probability that i occurs, H is just the first picture entropy;When calculating the second picture entropy in Y-coordinate axle, i is just in second set The value of each pixel value, piThe probability just occurred for i, H is just second picture entropy;Third on calculating Z coordinate axis When picture entropy, i is just the value of each pixel value in third set, piThe probability just occurred for i, H is just third picture Entropy.
In the embodiment of the present application, one of specific entropy calculation formula is given, which is applicable in all Picture (including grey picture and color image), it is applied widely and have operability.
In conjunction with the first embodiment of the embodiment of the present application first aspect and the embodiment of the present application first aspect to Three kinds of embodiments, in the 4th kind of embodiment of the embodiment of the present application first aspect, if electronic equipment detects above-mentioned people There are shelters within the scope of human face region in face image, and the shelter is to resisting sample chaff interferent, which can be with Include:
Handle this to resisting sample according to the second predetermined manner, and will treated identifies to resisting sample, identified As a result.The purpose of processing is to can be to eliminate the influence to resisting sample chaff interferent and directly remove this to resisting sample chaff interferent, It is also possible to this being changed into common shelter to resisting sample chaff interferent, this is not limited here.
In the embodiment of the present application, after to above-mentioned processing is carried out to resisting sample chaff interferent, people in above-mentioned facial image It will be not present shelter in face regional scope or existing shelter be only common shelter, then electronic equipment then can be straight It connects and the facial image is identified, obtain recognition result.To treated, shelter carries out identifying again to be in order to prevent appearance The case where misrecognition, improves the user experience.
In conjunction with the 4th kind of embodiment of the embodiment of the present application first aspect, the 5th of the embodiment of the present application first aspect the In kind embodiment, the second predetermined manner may include:
A target pixel value is determined first, and the pixel value of all pixels point in resisting sample chaff interferent will be all modified as Target pixel value;Or, the pixel value to all pixels point in resisting sample chaff interferent is carried out algebraic linear transformation, i.e., it will fight sample The pixel value x of all pixels point does algebraic linear conversion process in this chaff interferent.For example, will be to all pictures in resisting sample chaff interferent The pixel value of vegetarian refreshments is revised as (255-x) or 0.5* (255-x), does not limit the form of algebraic linear conversion process herein specifically It is fixed.
In the embodiment of the present application, a variety of implementations of the second predetermined manner are given, more have flexibility.
In conjunction with the 5th kind of embodiment of the embodiment of the present application first aspect, the 6th of the embodiment of the present application first aspect the In kind of embodiment, determine target pixel value mode can also there are many, may include:
(i.e. arbitrary integer in 0-255) arbitrarily chooses a pixel value as target picture in the value range of pixel value Element value;
Or,
The pixel value (i.e. target pixel value) to any one pixel A in resisting sample chaff interferent is taken, sample then will be fought The pixel value of other all pixels is all revised as pixel value identical with pixel A in this chaff interferent;
Or,
The pixel value (i.e. target pixel value) of any one pixel B within the scope of human face region in the facial image is taken, so Afterwards pixel value identical with pixel B will be all revised as to the pixel value of pixel all in resisting sample chaff interferent;
Or,
Arithmetic mean of instantaneous value C (i.e. target picture is taken to the pixel value of all pixels point within the scope of human face region in the facial image Element value), then the pixel value of pixel all in resisting sample chaff interferent will be all revised as identical with arithmetic mean of instantaneous value C Pixel value.
In the embodiment of the present application, a variety of implementations of determining target pixel value are given, have flexibility.
In conjunction with the first embodiment of the embodiment of the present application first aspect and the embodiment of the present application first aspect to Six kinds of embodiments, in the 7th kind of embodiment of the embodiment of the present application first aspect, electronic equipment is determining the face figure As to be mentioned then the electronic equipment can be generated further after to resisting sample (i.e. recognition result be not electronic equipment owner) It wakes up and notifies, the alert notification is for prompting associated user's electronic equipment just by attacking resisting sample, for example, associated user can To be the owner (i.e. victim) of electronic equipment, then alert notification can remind victim to be handled in time (such as: modification Payment cipher, alarm), associated user is also possible to service businessman corresponding with electronic equipment (as: attacker uses victim Mobile phone pay on line in everybody happy supermarket, then corresponding service businessman is exactly the cash register platform of everybody happy supermarket).It reminds Notice will realize its prompting function, then there are many implementation, including but not limited to following several alerting patterns:
The alert notification is reminded in the form of voice broadcast, alarm bell etc. on an electronic device.
And/or
The alert notification is sent to server corresponding with the electronic equipment;
And/or
The alert notification is sent to the target electronic device with the electronic device association.
In the embodiment of the present application, it when determining electronic equipment just by attacking resisting sample, generates corresponding remind and leads to Know to remind associated user, specific practicability.
In conjunction with the embodiment of the present application first aspect the first embodiment to the 7th kind of embodiment, implement in the application In 8th kind of embodiment of example first aspect, determine that the first predetermined manner of preset threshold may include:
A large amount of (such as M, M >=1) normal facial images (referring to facial image) are obtained under line, these facial images It is hidden within the scope of human face region there is no any shelter (the face original image i.e. without increasing any disturbance) or in the presence of common Block material (such as: only wearing common glasses, bandage, mask);It later, can be by each the normal people got Pixel value is calculated in face image, and the picture entropy for obtaining each normal facial image (obtains M Target Photo entropy Value), the calculation of the picture entropy can be obtained by above-mentioned entropy calculation formula;Finally, by all normal face figures As corresponding picture entropy takes arithmetic mean of instantaneous value, obtained arithmetic mean of instantaneous value just can be used as preset threshold.
In the embodiment of the present application, a kind of mode of specific setting preset threshold is given, there is operability.
In conjunction with the first embodiment of the embodiment of the present application first aspect, the 9th of the embodiment of the present application first aspect the In kind embodiment, if above-mentioned picture entropy is less than or equal to the preset threshold, it is determined that the shelter is common shelter;It Afterwards, electronic equipment identifies the common shelter, obtains recognition result.
In the embodiment of the present application, it if the shelter is common shelter, is normally identified, is not influenced in this way The normal use of user improves the usage experience of user.
The embodiment of the present application second aspect provides a kind of electronic equipment, which may include: one or more Camera shooting equipment;One or more touch screens;One or more processors;One or more memories;
Wherein, which is stored with one or more computer programs, the one or more computer Program includes instruction, when the instruction is executed by the one or more processors, so that the electronic equipment executes following steps:
The facial image at current time is obtained, which is collected by camera shooting equipment;
Judge whether shelter is to resisting sample chaff interferent, which is located at human face region range in the facial image It is interior;
If the shelter is this to resisting sample chaff interferent, it is determined that the facial image is to resisting sample.
In conjunction with the embodiment of the present application second aspect, in the first embodiment of the embodiment of the present application second aspect, when When the instruction is executed by the electronic equipment, so that following steps can also be performed in the electronic equipment:
The pixel value of all pixels point in the shelter is calculated, the picture entropy of the shelter is obtained;
Judge whether the picture entropy is greater than preset threshold, which determines according to the first predetermined manner;
If the picture entropy is greater than the preset threshold, it is determined that the shelter is this to resisting sample chaff interferent.
In conjunction with the first embodiment of the embodiment of the present application second aspect, the second of the embodiment of the present application second aspect In kind embodiment, when the instruction is executed by the electronic equipment, so that following steps can also be performed in the electronic equipment:
The pixel value of all pixels point in the shelter is decomposed into primary vector pixel value, secondary vector in color space Pixel value and third vector pixel value obtain the first set of primary vector pixel value, the second set of secondary vector pixel value With the third set for arriving third vector pixel value;
The first picture entropy of the first set, the second picture of the second set are calculated separately according to entropy calculation formula The third picture entropy of entropy and the third set;
Determine that the arithmetic mean of instantaneous value of the first picture entropy, the second picture entropy and the third picture entropy blocks for this The picture entropy of object.
In conjunction with second of embodiment of the embodiment of the present application second aspect, in the third of the embodiment of the present application second aspect In kind embodiment, which may include:
Wherein, i is each member in the first set, the second set or the third set The value of element, piFor the probability that the i occurs, H is the first picture entropy, the second picture entropy or the third picture entropy.
In conjunction with the embodiment of the present application second aspect, the first embodiment of the embodiment of the present application second aspect to the third Embodiment is if the electronic equipment determines the shelter in the 4th kind of embodiment of the embodiment of the present application second aspect This is to resisting sample chaff interferent, then when the instruction is executed by the electronic equipment, so that following step can also be performed in the electronic equipment It is rapid:
This is handled to resisting sample according to the second predetermined manner;
Will treated identifies to resisting sample, obtain recognition result.
In conjunction with the 4th kind of embodiment of the embodiment of the present application second aspect, the 5th of the embodiment of the present application second aspect the In kind embodiment, which includes:
It determines target pixel value, and the pixel value to all pixels point in resisting sample chaff interferent is revised as the target picture Element value;
Or,
The pixel value to all pixels point in resisting sample chaff interferent is subjected to algebraic linear transformation.
In conjunction with the 5th kind of embodiment of the embodiment of the present application second aspect, the 6th of the embodiment of the present application second aspect the In kind embodiment, which includes:
A pixel value is arbitrarily chosen in the value range of pixel value as the target pixel value;
Or,
Determine that the pixel value to any one pixel in resisting sample chaff interferent is the target pixel value;
Or,
The pixel value for determining any one pixel face regional scope Nei is the target pixel value;
Or,
The arithmetic mean of instantaneous value for determining the pixel value of all pixels point in the face regional scope is the target pixel value.
In conjunction with the embodiment of the present application second aspect, the first embodiment of the embodiment of the present application second aspect to the 6th kind Embodiment determines the facial image in the electronic equipment in the 7th kind of embodiment of the embodiment of the present application second aspect After to resisting sample, then when the instruction is executed by the electronic equipment, so that the electronic equipment also executes the following steps:
Generate alert notification;
The voice broadcast alert notification;
And/or
The alert notification is sent to corresponding server;
And/or
The alert notification is sent to associated target electronic device.
In conjunction with the embodiment of the present application second aspect the first embodiment to the 7th kind of embodiment, implement in the application In 8th kind of embodiment of example second aspect, which includes:
It obtains M and refers to facial image, this is that shelter or presence are not present in people's face regional scope with reference to facial image The facial image of common shelter, wherein M >=1;
This M pixel value with reference to all pixels point in the object reference facial image in facial image is calculated, Obtain the Target Photo entropy of the object reference facial image;
Determine that the arithmetic mean of instantaneous value of M Target Photo entropy corresponding with this M reference facial image is default for this Threshold value.
In conjunction with the first embodiment of the embodiment of the present application second aspect, the 9th of the embodiment of the present application second aspect the In kind embodiment, if the picture entropy is less than or equal to the preset threshold, when the instruction is executed by the electronic equipment, make Obtaining the electronic equipment can also be performed following steps:
Determine that the shelter is common shelter;
The common shelter is identified, recognition result is obtained.
The embodiment of the present application third aspect also provides a kind of electronic equipment, which can specifically include:
Acquisition unit, for the facial image by camera shooting equipment acquisition current time;
Judging unit, for judging whether shelter is to resisting sample chaff interferent, which is located in the facial image Within the scope of human face region;
Determination unit, if being this to resisting sample chaff interferent for the shelter, it is determined that the facial image is to resisting sample.
It, should in the first embodiment of the embodiment of the present application third aspect in conjunction with the embodiment of the present application third aspect Judging unit includes:
Computation subunit calculates for the pixel value to all pixels point in the shelter, obtains the shelter Picture entropy;
Judgment sub-unit, for judging whether the picture entropy is greater than preset threshold, the preset threshold is default according to first Mode determines;
First determines subelement, if being greater than the preset threshold for the picture entropy, it is determined that the shelter is the confrontation Sample chaff interferent.
In conjunction with the first embodiment of the embodiment of the present application third aspect, the second of the embodiment of the present application third aspect In kind embodiment, which is specifically used for:
The pixel value of all pixels point in the shelter is decomposed into primary vector pixel value, secondary vector in color space Pixel value and third vector pixel value obtain the first set of primary vector pixel value, the second set of secondary vector pixel value With the third set for arriving third vector pixel value;
The first picture entropy of the first set, the second picture of the second set are calculated separately according to entropy calculation formula The third picture entropy of entropy and the third set;
Determine that the arithmetic mean of instantaneous value of the first picture entropy, the second picture entropy and the third picture entropy blocks for this The picture entropy of object.
In conjunction with second of embodiment of the embodiment of the present application third aspect, in the third of the embodiment of the present application third aspect In kind embodiment, which includes:
Wherein, i is each member in the first set, the second set or the third set The value of element, piFor the probability that the i occurs, H is the first picture entropy, the second picture entropy or the third picture entropy.
In conjunction with the embodiment of the present application third aspect, the first embodiment of the embodiment of the present application third aspect to the third Embodiment, in the 4th kind of embodiment of the embodiment of the present application third aspect, if the shelter is that this interferes resisting sample Object, the then electronic equipment further include:
Processing unit, for handling this to resisting sample according to the second predetermined manner;
Recognition unit, for will treated identifies to resisting sample, obtain recognition result.
In conjunction with the 4th kind of embodiment of the embodiment of the present application third aspect, the 5th of the embodiment of the present application third aspect the In kind embodiment, which includes:
It determines target pixel value, and the pixel value to all pixels point in resisting sample chaff interferent is revised as the target picture Element value;
Or,
The pixel value to all pixels point in resisting sample chaff interferent is subjected to algebraic linear transformation.
In conjunction with the 5th kind of embodiment of the embodiment of the present application third aspect, the 6th of the embodiment of the present application third aspect the In kind embodiment, which includes:
A pixel value is arbitrarily chosen in the value range of pixel value as the target pixel value;
Or,
Determine that the pixel value to any one pixel in resisting sample chaff interferent is the target pixel value;
Or,
The pixel value for determining any one pixel face regional scope Nei is the target pixel value;
Or,
The arithmetic mean of instantaneous value for determining the pixel value of all pixels point in the face regional scope is the target pixel value.
In conjunction with the embodiment of the present application third aspect, the first embodiment of the embodiment of the present application third aspect to the 6th kind Embodiment is determining that the facial image is to resisting sample in the 7th kind of embodiment of the embodiment of the present application third aspect Later, the electronic equipment further include:
Generation unit, for generating alert notification;
Unit is broadcasted, the voice broadcast alert notification is used for;
And/or
Transmission unit, for sending the alert notification to corresponding server;And/or to associated target electronic device Send the alert notification.
In conjunction with the embodiment of the present application third aspect the first embodiment to the 7th kind of embodiment, implement in the application In 8th kind of embodiment of the example third aspect, which includes:
It obtains M and refers to facial image, this is that shelter or presence are not present in people's face regional scope with reference to facial image The facial image of common shelter, wherein M >=1;
This M pixel value with reference to all pixels point in the object reference facial image in facial image is calculated, Obtain the Target Photo entropy of the object reference facial image;
Determine that the arithmetic mean of instantaneous value of M Target Photo entropy corresponding with this M reference facial image is default for this Threshold value.
In conjunction with the first embodiment of the embodiment of the present application third aspect, the 9th of the embodiment of the present application third aspect the In kind embodiment, the judging unit further include:
Second determines subelement, if being less than or equal to the preset threshold for the picture entropy, it is determined that the shelter is Common shelter;
The recognition unit is specifically also used to identify the common shelter, obtains recognition result.
The embodiment of the present application fourth aspect provides a kind of computer readable storage medium, in the computer readable storage medium It is stored with instruction, when run on a computer, allows computer to execute above-mentioned first aspect and first aspect is appointed It anticipates the detection method of possible implementation a kind of.
The 5th aspect of the embodiment of the present application provides a kind of computer program product comprising instruction, when it is transported on computers When row, computer is allowed to execute the detection side of any one possible implementation of above-mentioned first aspect and first aspect Method.
As can be seen from the above technical solutions, the embodiment of the present application has the advantage that
By camera shooting equipment, (such as: the camera carried on electronic equipment or is physically separated electronic equipment with electronic equipment But the camera being wirelessly connected) acquisition current time facial image (such as: the face picture of current time shooting or from current The camera shooting of moment shooting is made video recording the face picture of middle interception).If electronic equipment is in this prior in the facial image of moment shooting Shelter (such as: glasses, paster) is detected the presence of within the scope of human face region, then electronic equipment can further judge the shelter It whether is to resisting sample chaff interferent, if electronic equipment determines that the shelter is to resisting sample chaff interferent, electronic equipment be can determine whether The facial image of current time shooting is to resisting sample (i.e. by attack resisting sample).In the embodiment of the present application, lead to Cross whether the shelter in the facial image for judging current time shooting within the scope of human face region is to come really to resisting sample chaff interferent Whether the fixed facial image is to resisting sample.The detection method of resisting sample is known applied to face used by the embodiment of the present application Other scene, this detection method do not need to carry out depth model training to a large amount of confrontation samples pictures, require no knowledge about life yet The generator of pairs of resisting sample is (including known or most newly generated to resisting sample to resisting sample generating algorithm using which kind of Generating algorithm), the facial image that attacker is known in advance is not needed more, can be detected whether to exist to resisting sample, thus It cannot achieve attacker to attack resisting sample.And this detection method complexity is low, it is easy to accomplish.
Detailed description of the invention
Fig. 1 is the schematic diagram of an example to resisting sample attack in the prior art;
Fig. 2 is a kind of schematic diagram of embodiment in recognition of face application scenarios to resisting sample attack;
Fig. 3 is a schematic diagram for fighting corresponding relationship between sample article and victim;
Fig. 4 is another schematic diagram for fighting corresponding relationship between sample article and victim;
Fig. 5 is the schematic diagram that sample testing method is fought in the embodiment of the present application;
Fig. 6 is the schematic diagram of the calculated result of the picture entropy of several different pixels points distribution;
Fig. 7 is a kind of implementation handled in the embodiment of the present application the alert notification of generation;
Fig. 8 is another implementation handled in the embodiment of the present application the alert notification of generation;
Fig. 9 is the signal that the alert notification generated in the embodiment of the present application is sent to server corresponding with electronic equipment Figure;
Figure 10 is that the alert notification generated in the embodiment of the present application is sent to associated objects electricity corresponding with electronic equipment The schematic diagram of sub- equipment;
Figure 11 is a schematic diagram of electronic equipment in the embodiment of the present application;
Figure 12 is another schematic diagram of electronic equipment in the embodiment of the present application;
Figure 13 is the hardware architecture diagram of electronic equipment in the embodiment of the present application;
Figure 14 is the architecture diagram of electronic equipment in the embodiment of the present application.
Specific embodiment
In the application scenarios of recognition of face (such as: face payment, face unlock in mobile phone), since attacker can not Doing scrambling processing to the facial image that electronic equipment (such as: mobile phone) current time is taken (that is: can not be to the people that current time is taken The pixel value of pixel is modified in face image), therefore attacker can not realize confrontation sample using mode corresponding with Fig. 1 This attack.In this case, attacker just realizes confrontation by wearing the confrontation sample articles such as scrambling glasses, scrambling paster Sample attack.By taking Fig. 2 as an example to this attack to resisting sample in the way of be illustrated: attacker A is worn by specially treated To resisting sample spectacle-frame a, (such as: the payment of the face in mobile phone is used in attacker A), electricity in the application scenarios of recognition of face Sub- equipment (such as: mobile phone) collects current time with (being denoted as the attack of frame a) to resisting sample spectacle-frame by camera The facial image of person A, then attacker A will be identified as victim V1 by the electronic equipment, to successfully complete the people of mobile phone Face payment function (it is assumed that the target facial image for the face payment being arranged in the mobile phone is victim V1), it is similar with this, Attacker B, attacker C can be using similar attack patterns (such as: wearing frame b respectively, frame c) is known respectively by electronic equipment Not at victim V2, victim V3.Wherein, a kind of above-mentioned identification application scenarios include: one with confrontation sample article Attacker can correspond to multiple victims, this corresponding multiple victim are that deep learning network is generating corresponding confrontation sample It is just had determined that when this article.As shown in figure 3, illustrated for fighting sample article as to resisting sample spectacle-frame, Generate to resisting sample spectacle-frame (being denoted as frame a1) before, attacker can first determine victim (such as: victim V11, Victim V12, victim V13) and victim's quantity (such as: 3) demand, it is later, deep according to the demand of attacker It spends learning network and corresponding frame a1 is generated using specific algorithm, in attacker's wearing after frame a1, so that it may electric Sub- equipment is identified as victim V11, victim V12 or victim V13.Similar, a kind of above-mentioned identification application scenarios may be used also The same victim can also be identified as by wearing the same confrontation sample article to include: multiple attackers.Such as Fig. 4 institute To show, is illustrated for fighting sample article as to resisting sample spectacle-frame, it is assumed that attacker's quantity is 3, i.e. attacker A11, Attacker A12, attacker A13 are worn respectively to resisting sample spectacle-frame (being denoted as frame a2), and deep learning network can root Attacker A11, attacker A12, attacker A13 with frame a2 are determined as victim V21 according to the demand of attacker. So, which of either attacker A11, attacker A12, attacker A13 wear upper frame a2, can be set by electronics It is standby to be identified as victim V21.
The above this mode to resisting sample attack to image identification system brings very big threat and to recognition result It causes strong influence (such as: wrong identification), this influence is possible to will cause serious consequence (such as: being identified as victim simultaneously It completes to pay on line, causes victim's financial losses;Or, being identified as victim and having unlocked the mobile phone of victim, cause aggrieved The privacy of person is leaked).For avoid it is this to resisting sample attack in recognition of face scene caused by adverse effect or serious Consequence, the embodiment of the present application provide the detection method of a kind of pair of resisting sample, and this detection method can be detected effectively currently Whether moment collected facial image is to resisting sample, so as to effectively prevent the successful implementation attacked resisting sample.
It should be noted that the detection method provided by the embodiments of the present application to resisting sample is applied to recognition of face scene, The realization body of the detection method includes electronic equipment, which fills equipped with camera shooting equipment (such as: camera) and display Standby (such as: liquid crystal display), can be the intelligent terminals such as mobile phone, tablet computer, smartwatch, specifically herein to electronic equipment not It limits.It should also be noted that, the description and claims of this application and term " first " in above-mentioned attached drawing, " the Two ", the (if present)s such as " third ", " the 4th " are to be used to distinguish similar objects, without for describe specific sequence or Precedence.It should be understood that the data used in this way are interchangeable under appropriate circumstances, so that the embodiments described herein can Implemented with the sequence other than the content for illustrating or describing herein.In addition, term " includes " and " having " and they Any deformation, it is intended that cover it is non-exclusive include, for example, containing the process, method of a series of steps or units, being System, product or equipment those of are not necessarily limited to be clearly listed step or unit, but may include be not clearly listed or For the intrinsic other step or units of these process, methods, product or equipment.
Fig. 5 is the schematic diagram that sample testing method is fought in the embodiment of the present application, and specific implementation is as follows:
501, the facial image at acquisition current time is equipped by camera shooting.
Electronic equipment can equip the facial image at acquisition current time by camera shooting.It should be noted that camera shooting equipment It can be the camera carried on electronic equipment, be also possible to be physically separated the camera being still wirelessly connected with electronic equipment (such as: the camera that mobile phone is not turned on included camera, the camera of mobile phone is damaged or the mobile phone does not carry, But exist and carried out the hand-held camera of bluetooth connection with the mobile phone), specifically camera shooting is equipped without limitation herein.Also need Bright, electronic equipment can be there are many form, for example, it may be ringing by the facial image at camera shooting equipment acquisition current time Triggering of the Ying Yu to some operational order, the i.e. execution of some operational order can trigger electronic equipment and be acquired currently by camera The facial image at moment is illustrated so that electronic equipment is mobile phone as an example: the operational order can be user and use mobile phone to businessman The payment two dimensional code (such as: the payment two dimensional code of wechat or Alipay) of offer carries out delivery operation when barcode scanning, to guarantee payment Environmental security, the delivery operation need to verify the identity of user, the operational order can also be user on mobile phone certain Using the opening operation (such as: Web bank, telephone expenses inquiry) carried out, to ensure information security, which is also required to pair The identity of user is verified.In the embodiment of the present application, without limitation to the form of operational order.User is to operational order Execution can trigger electronic equipment and verify to the identity of user, and wherein one of verification mode is exactly to get to current time Facial image is identified that is, the above-mentioned delivery operation of user, opening operation etc. will trigger electronic equipment and open camera pair The face of the user is shot, and obtains the facial image at current time.It should be noted that face of the electronic equipment to user It is shot, can be the picture directly shot, be also possible to the video recording of shooting, then intercept out picture from the video recording, specifically Herein without limitation to the acquisition modes of the facial image at current time.Electronic equipment passes through camera shooting equipment acquisition current time Facial image can also be camera shooting equipment always in unlatching other than it can be in response to the triggering to some operational order State, as long as camera shooting equipment captures current time there are facial image, electronic equipment acquires the facial image.In the application In embodiment, the form of the facial image at current time is acquired without limitation to electronic equipment.
502, judge with the presence or absence of shelter within the scope of human face region, if so, 503 are thened follow the steps, if it is not, then executing step Rapid 504.
It, will be to face in the facial image after electronic equipment gets the facial image at current time by camera shooting equipment The detection of shelter is carried out in regional scope, i.e., with the presence or absence of such as glasses, spectacle-frame, paster et al. within the scope of detection human face region For the shelter of wearing.If in the face regional scope, there are shelters, then follow the steps 503, if the face regional scope It is interior that shelter is not present, then follow the steps 504.
503, judge whether the shelter is to resisting sample chaff interferent, if so, 505 are thened follow the steps, if it is not, then executing step Rapid 504.
If electronic equipment detects in above-mentioned facial image within the scope of human face region there are shelter, electronic equipment is into one Step judges whether the shelter is to resisting sample chaff interferent.If the shelter is to then follow the steps 505 to resisting sample chaff interferent, If the shelter is not to then follow the steps 504 to resisting sample chaff interferent.
It should be noted that referring to resisting sample chaff interferent in the embodiment of the present application to implement to attack as mesh resisting sample , as obtained by deep learning network training have confrontation sample attribute chaff interferent, such as to resisting sample spectacle-frame (such as Fig. 2, scheme 3, frame a described in Fig. 4, frame b, frame c, frame a1, frame a2), corresponding sample paster etc., specifically herein to confrontation sample The form of this chaff interferent is without limitation.
To in resisting sample attack form under recognition of face scene, due to having resisting sample chaff interferent with properties spy Point: huge and variation of pixel value variation of a small range pixel is irregular, and showing as visually is beautiful in colour.Base In this, in some embodiments of the application, electronic equipment can be through but not limited to the method calculated using picture entropy The pixel value of shelter pixel is analyzed, to judge whether the shelter is to resisting sample shelter.Specifically introducing Before the detailed step of the method, some concepts being likely to occur in the embodiment of the present application are first introduced.
Firstly, introducing the concept of color space, color is different feeling of the eyes of people for different frequency light, color It is both (light of different frequency) and subjective perception of objective reality, is recognized difference.Based on this, in order to more objective, quasi- True is described color, and there have been the concepts of color space (alternatively referred to as colour gamut).By establishing colour model, with one Dimension, two dimension, three-dimensional even space-time coordinate indicate a certain color, Color Range, that is, color that this coordinate system can define Color space.The type of current commonly used color space mainly has primaries mode (RGB), four color separation modes of printing (CMYK), color model (Lab) etc..For ease of description, in the embodiment of the present application, being by primaries mode of color space Example is illustrated.Primaries mode, and can be described as RGB color model or RGB color model, it is a kind of additive color model, it will Red (Red), green (Green), blue (Blue) these three primary colors coloured light be added in different proportions, it is a variety of more to generate The coloured light of sample, these diversified coloured light just define a color space, if by red amount be defined as X-coordinate axle, The amount of green is defined as Y-coordinate axle, the amount of blue is defined as Z coordinate axis (red, green, the amount and X-coordinate axle, Y-coordinate of blue Axis, Z coordinate axis are unique corresponding respectively, only illustrate one of definition mode here, specifically without limitation), thus A three-dimensional space can be obtained, every kind of possible color has a unique position in this three-dimensional space.RGB color mould Type has a variety of different implementation methods according to the difference of actual use device systems ability.Wherein, the most commonly used is red, green Each Color Channel has 256 color grades (integer that the value range of color grade is 0-255) in color, blue.Based on such RGB color The color space of model can show as 256 × 256 × 256 ≈, 16,700,000 color, and some implementation methods can also use every kind The more color grades of primary colors (such as 512 color grades), can thus realize higher more accurate color density in same range.Wherein, Each color grade is the pixel value of the pixel of corresponding position in picture.Understand for ease of description, with the color grade of every kind of primary colors It is illustrated for being 256:
Assuming that red amount is defined as X-coordinate axle, the amount of green is defined as Y-coordinate axle, the amount of blue is defined as Z coordinate Axis, then in one image, pixel value is that the color representation of RGB (255,0,0) is red, and pixel value is RGB (0,255,0) Color representation be green, pixel value be that the color representation of RGB (0,0,255) is blue.When in one image, pixel value exists Value at least two on each coordinate it is not identical when, then the image will appear as color image;When pixel value is in each seat When the value put on is all identical, then the image will appear as gray level image, for example, when the color grade of every kind of primary colors in three primary colors is all When 255, then the color representation of pixel value RGB (255,255,255) be just white, when every kind of primary colors in three primary colors color grade all When being 0, then the color representation of pixel value RGB (0,0,0) is just black, when the color grade of every kind of primary colors in three primary colors is all equal When, then the color representation of pixel value RGB (m, m, m) is just grey, and m is integer and 0 < m < 255, such as pixel value RGB It is 100 that (100,100,100), which just represent gray scale, and it is 50 that pixel value RGB (50,50,50), which just represents gray scale, and gray scale refers to artwork master The color depth of each pixel as in.
Secondly, introducing the concept of picture entropy, in simple terms, it is physics earliest that entropy, which is exactly for describing chaotic degree, It is used to describe the degree of substance confusion in, gradually amplification was used to fields such as informatics, iconologies to probabilistic later A kind of measurement.Information content is bigger, and uncertain just smaller, entropy is also bigger;Conversely, information content is smaller, uncertain bigger, entropy Also smaller.According to the characteristic of entropy, so that it may judge the randomness and unordered degree of an event by calculating entropy.It is based on This just introduces the concept of picture entropy in the embodiment of the present application, and the distribution that picture entropy is used to react pixel value in image is special Sign, picture entropy is bigger, then corresponding image color is more gorgeous, image information contained amount is also bigger.
In the following, being discussed in detail how electronic equipment in the embodiment of the present application judges to hide by method that picture entropy calculates Whether block material is to resisting sample shelter, and the step of judging may include:
A, the pixel value of all pixels point in shelter is calculated, obtains the picture entropy of the shelter;
Electronic equipment can be carried out by corresponding entropy calculation formula come the pixel value to all pixels point in shelter It calculates, to obtain the picture entropy of the shelter.Including but do not restrict driving in the following way:
If 1) shelter is grey picture, the pixel value of all pixels point is in RGB color model in the shelter Value in each reference axis is identical.It so can be through but not limited to the calculating of the picture entropy of the shelter Entropy calculation formulaTo obtain, wherein i is the pixel value of each pixel in shelter, piFor The probability that pixel value i occurs, H is just the picture entropy of the shelter.Fig. 6 (when shelter is grey picture) illustrates several The calculated result of the picture entropy H of different pixels point distribution: when the pixel value of all pixels point in shelter is in RGB color model In value be RGB (255,255,255) or when value is (0,0,0) RGB, then obtained according to above-mentioned entropy calculation formula The picture entropy H1=H2=0 of the shelter;When in shelter in the pixel Distribution value such as Fig. 6 of pixel the right two kinds of distribution shapes When formula, the shelter picture entropy obtained according to above-mentioned entropy calculation formula is respectively H3=1.0413 and H4=1.3476.
If 2) shelter is color image, the pixel value of all pixels point in the shelter is decomposed into color space Primary vector pixel value (alternatively referred to as X-axis pixel value), secondary vector pixel value (alternatively referred to as Y-axis pixel value) and third vector Pixel value (alternatively referred to as Z axis pixel value) obtains the first set of primary vector pixel value, the second collection of secondary vector pixel value Close and to third vector pixel value third set;Later, the first figure of first set is calculated separately according to entropy calculation formula The third picture entropy of piece entropy, the second picture entropy of second set and third set;Finally, to the first picture entropy, institute It states second picture entropy and the third picture entropy takes arithmetic mean of instantaneous value, and using the arithmetic mean of instantaneous value as the figure of the shelter Piece entropy.
It should be noted that the picture entropy in each reference axis can also in some embodiments of the application The entropy calculation formula used when with according to above-mentioned calculating grey pictureIt is calculated.I.e. as calculating X When the first picture entropy in reference axis, i is just the value of each pixel value in first set, piThe probability just occurred for i, H is just the first picture entropy;When calculating the second picture entropy in Y-coordinate axle, i is just each pixel value in second set Value, piThe probability just occurred for i, H is just second picture entropy;When calculating the third picture entropy on Z coordinate axis, i It is just the value of each pixel value in third set, piThe probability just occurred for i, H is just third picture entropy.
For ease of understanding, it is illustrated so that the number of pixel in shelter is 4 as an example, it is assumed that this 4 in the shelter The pixel value of pixel in RGB color model be respectively RGB1 (120,50,80), RGB2 (30,90,40), RGB3 (70, 140,200), (100,160,20) RGB4, then the pixel value of this 4 pixels will be separately disassembled by electronic equipment (120,0,0), (0,50,0), (0,0,80), (30,0,0), (0,90,0), (0,0,40), (70,0,0), (0,140,0), (0, 0,200), (100,0,0), (0,160,0), (0,0,20).The first set of the primary vector pixel value so obtained is just { (120,0,0), (30,0,0), (70,0,0), (100,0,0) }, the second set of secondary vector pixel value be just (0,50, 0), (0,90,0), (0,140,0), (0,160,0) }, the third set of third vector pixel value be just (0,0,80), (0,0, 40), (0,0,200), (0,0,20) }.Later, electronic equipment can be according to entropy calculation formulaPoint Do not calculate each set in picture entropy, thus obtain the first picture entropy Hx of first set, second set second The third picture entropy Hz of picture entropy Hy, third set.Finally, can be by H=(Hx+Hy+Hz)/3 as the shelter Picture entropy.
B, judge whether the picture entropy is greater than preset threshold;
Later, compared with the picture entropy of calculated shelter and pre-set threshold value (i.e. preset threshold) Compared with to judge whether shelter is to resisting sample chaff interferent.It should be noted that preset threshold in the embodiment of the present application can be with It obtains in several ways, can be what user set based on experience value, be also possible to generate based on deep learning network query function , specifically herein without limitation.Preferably, in some embodiments of the application, preset threshold can be in the following way It determines: obtaining a large amount of (such as M, M >=1) normal facial images (referring to facial image), the people of these facial images under line There is no any shelter (the face original images i.e. without increasing any disturbance) in face regional scope;Later, can pass through Pixel value in each the normal facial image got is calculated, the picture of each normal facial image is obtained The calculation of entropy, the picture entropy can be obtained by above-mentioned entropy calculation formula;Finally, by all normal face figures As corresponding picture entropy takes arithmetic mean of instantaneous value, obtained arithmetic mean of instantaneous value just can be used as preset threshold.
If c, the picture entropy is greater than preset threshold, it is determined that the shelter is to resisting sample chaff interferent.
If electronic equipment determines that the picture entropy of shelter is greater than preset threshold, it is determined that the shelter is dry to resisting sample Disturb object.
504, the facial image is identified, obtains recognition result.
If electronic equipment detects that there is no shelters within the scope of human face region in above-mentioned facial image, or, electronic equipment Detect that existing shelter is not to resisting sample chaff interferent (although blocking within the scope of human face region in above-mentioned facial image Object or there are common shelter (such as: only wearing common glasses, bandage, mask), but there is no attack resisting sample Situation, such as: in step 503, if electronic equipment determines that the picture entropy of shelter is less than or equal to threshold value, it is determined that the screening Block material be common shelter), illustrate to be not subject to attack resisting sample, then electronic equipment then directly to the facial image into Row identification, obtains recognition result.At present for the face identification system of existing electronic equipment, normal small-scale face is hidden Gear (such as wear glasses, paste bandage) will not influence the recognition result of face identification system.Use mobile phone to businessman with user For delivery operation when the payment two dimensional code of offer carries out barcode scanning: mobile phone gets the facial image, it will with authenticated The target facial image that the delivery operation can be opened is compared, if comparing through (the i.e. facial image and target face figure It is same people as consistent), then illustrate payment environment safety, above-mentioned delivery operation can be completed in mobile phone;If comparing not by (i.e. The facial image and target facial image are inconsistent, are not same people), then illustrate that payment environment is dangerous, mobile phone can stop Above-mentioned delivery operation.
505, determine that the facial image is to resisting sample.
If electronic equipment detects that there are shelters within the scope of human face region in above-mentioned facial image, and the shelter is pair Resisting sample chaff interferent, electronic equipment will determine that the facial image is to illustrate the electronic equipment just by resisting sample resisting sample Attack.
506, resisting sample is handled to described.
Preferably, in some embodiments of the application, when electronic equipment determine the facial image be to resisting sample it Afterwards, further this can also handle resisting sample, the purpose of processing be in order to eliminate the influence to resisting sample chaff interferent, It can be and directly remove this to resisting sample chaff interferent, be also possible to this being changed into common shelter to resisting sample chaff interferent, have Body is not construed as limiting herein.In some embodiments of the application, it can be handled in the following way:
A, a target pixel value is determined first, and the pixel value of all pixels point in resisting sample chaff interferent will all be modified At target pixel value.
It should be noted that determining that target pixel value can also be including but unlimited there are many mode in the embodiment of the present application In:
(i.e. arbitrary integer in 0-255) arbitrarily chooses a pixel value as target picture in the value range of pixel value Element value;
Or,
The pixel value (i.e. target pixel value) to any one pixel A in resisting sample chaff interferent is taken, sample then will be fought The pixel value of other all pixels is all revised as pixel value identical with pixel A in this chaff interferent;
Or,
The pixel value (i.e. target pixel value) of any one pixel B within the scope of human face region in the facial image is taken, so Afterwards pixel value identical with pixel B will be all revised as to the pixel value of pixel all in resisting sample chaff interferent;
Or,
Arithmetic mean of instantaneous value C (i.e. target picture is taken to the pixel value of all pixels point within the scope of human face region in the facial image Element value), then the pixel value of pixel all in resisting sample chaff interferent will be all revised as identical with arithmetic mean of instantaneous value C Pixel value.
B, the pixel value to all pixels point in resisting sample chaff interferent is subjected to algebraic linear transformation.
Algebraic linear conversion process will be done to the pixel value x of all pixels point in resisting sample chaff interferent.For example, sample will be fought The pixel value of all pixels point is revised as (255-x) or 0.5* (255-x) in this chaff interferent, specifically converts herein to algebraic linear The form of processing is without limitation.
507, will treated identifies to resisting sample, obtain recognition result.
After to above-mentioned processing is carried out to resisting sample chaff interferent, it will not be deposited within the scope of human face region in above-mentioned facial image It is only common shelter in shelter or existing shelter, then electronic equipment then can directly carry out the facial image Identification, obtains recognition result.Specific identification method is similar with above-mentioned steps 504, and it will not go into details herein.If right to treated After resisting sample identification, if obtained recognition result is the owner of electronic equipment, illustrate that above-mentioned is false triggering;If obtained identification It as a result is not the owner of electronic equipment, it is preferred that in some embodiments of the application, if electronic equipment determines the face figure It seem really to resisting sample (i.e. recognition result be not electronic equipment owner), then the electronic equipment can be generated further Alert notification, the alert notification is for prompting associated user's electronic equipment just by attacking resisting sample, for example, associated user The owner (i.e. victim) that can be electronic equipment, then alert notification can remind victim to be handled in time (such as: repairing Change payment cipher, alarm), associated user is also possible to service businessman corresponding with electronic equipment, and (such as: attacker uses victim Mobile phone pay on line in everybody happy supermarket, then corresponding service businessman is exactly the cash register platform of everybody happy supermarket).It mentions Awake notice will realize its prompting function, then there are many implementations, and including but not limited to following several alerting patterns are (for convenient for reason Solution is illustrated so that electronic equipment is mobile phone as an example):
A, the alert notification is reminded in the form of voice broadcast, alarm bell etc. on mobile phone.
This alerting pattern of alert notification is primarily to cause user around mobile phone (such as: just in the service of cash register Personnel, other customers around attacker etc.) note that make attacker fear to actively abandon this time resisting sample is attacked Hit or make the user of surrounding to attacker this time to resisting sample attack carry out intervene so that it is halted attacks.As shown in fig. 7, working as It is to resisting sample, then mobile phone can be with voice that mobile phone, which is determined through the facial image at the camera collected current time of mobile phone, Broadcasting " just by attacking resisting sample, asks non-payment!" or (such as: " this mobile phone is doubtful stolen, user similar to reminded contents It please non-payment!", " this mobile phone is being illegally used, and grabs bad egg fastly!" etc.), the word content that specifically voice is played herein Concrete form without limitation.In addition, mobile phone can also be and broadcast other than it can be voice broadcasting related content and reminded Alarm bell is put, to play similar reminding effect, the form of expression of alarm bell is also possible to a variety of, and as shown in Figure 8: mobile phone can issue " beep!Too!Beep!Too!" alarm bell sound, " toot can also be issued!Toot!Toot!" alarm bell sound, specifically herein to alarm bell The form of expression without limitation.
B, the alert notification is sent to corresponding server by mobile phone.
The alert notification that mobile phone generates can also further be sent to server corresponding with the mobile phone (such as: carrying out The merchant platform paid on line), as shown in figure 9, when the mistake paid on line to merchant platform payment is used in attacker Cheng Zhong, when mobile phone detects that the facial image of the attacker of current time shooting is to resisting sample, then mobile phone will be to correspondence Gathering merchant platform send alert notification, remind businessman this time payment process it is dangerous, merchant platform receives the alert notification, Can the active termination payment process, to guarantee the financial security of victim.
C, the alert notification is sent to other target electronic devices with the mobile phone association by mobile phone.
The alert notification that the mobile phone generates can also further be sent to other target electronic devices with the mobile phone association. As shown in Figure 10, if being victim B by the owner of the mobile phone a attacked resisting sample, victim B is in addition to possessing the mobile phone Except a, also possess mobile phone b, tablet computer c, smartwatch d, victim B is by mobile phone a, mobile phone b, tablet computer c, smartwatch D is associated in advance (such as: having been registered with unified ID account before, content can be shared), then mobile phone b, plate Computer c, smartwatch d be exactly in the embodiment of the present application with other associated target electronic devices of mobile phone a.If attacker is right The mobile phone a of victim B, which is carried out, attacks resisting sample, then mobile phone a will generate an alert notification (such as: the alert notification It can be that " mobile phone a by attacking resisting sample, please just intervene!"), which can be sent to mobile phone b, tablet computer c Or at least one of smartwatch d, if such victim B is just adorning oneself with smartwatch d, or, mobile phone b or plate is used Computer c, that victim B can know that the mobile phone a of oneself is illegally used by attacker in time, victim B can and Shi Jinhang intervenes, such as: payment cipher is changed in other target electronic devices, is alarmed to relevant departments.
The embodiment of the present application can carry out the division of functional module, example according to the example of above-mentioned detection method to electronic equipment Such as, each functional module of each function division can be corresponded to, two or more functions can also be integrated at one It manages in module.Above-mentioned integrated module both can take the form of hardware realization, can also use the form of software function module It realizes.It should be noted that being schematical, only a kind of logic function stroke to the division of module in the embodiment of the present application Point, there may be another division manner in actual implementation.
For example, Figure 11 shows the schematic diagram of a kind of electronic equipment, electronic equipment provided by the embodiments of the present application be can wrap It includes:
Acquisition unit 1101, for the facial image by camera shooting equipment acquisition current time;
Judging unit 1102, for judging whether shelter is to resisting sample chaff interferent, which is located at the face figure As within the scope of human face region;
Determination unit 1103, if being this to resisting sample chaff interferent for the shelter, it is determined that the facial image is confrontation Sample.
Preferably, in some embodiments of the application, judging unit 1102 can also include more subelements, with It realizes more multi-functional.It as shown in figure 12, is another schematic diagram of electronic equipment provided by the embodiments of the present application, electronic equipment tool Body includes: acquisition unit 1201, judging unit 1202, determination unit 1203.Wherein, acquisition unit 1201, judging unit 1202, Determination unit 1203 is similar with the function that the acquisition unit 1101 in Figure 11, judging unit 1102, determination unit 1103 are realized, It will not go into details herein.In the embodiment of the present application, judging unit 1202 can further include:
Computation subunit 12021 calculates for the pixel value to all pixels point in the shelter, obtains this and block The picture entropy of object;
Judgment sub-unit 12022, for judging whether the picture entropy is greater than preset threshold, the preset threshold is according to first Predetermined manner determines;
First determines subelement 12023, if being greater than the preset threshold for the picture entropy, it is determined that the shelter is should To resisting sample chaff interferent.
Preferably, in the embodiment of the present application, judging unit 1202 can further include second and determine subelement 12024, it is specifically used for: if the picture entropy is less than or equal to the preset threshold, it is determined that the shelter is common shelter.
Preferably, which may include: firstly, obtaining M with reference to facial image, this refers to facial image For the facial image that shelter is not present in face regional scope, wherein M >=1;Later, to this M with reference in facial image The pixel value of all pixels point is calculated in object reference facial image, obtains the Target Photo of the object reference facial image Entropy;Finally, the arithmetic mean of instantaneous value for determining M Target Photo entropy corresponding with this M reference facial image is that this is pre- If threshold value.
Preferably, in some embodiments of the application, computation subunit 12021 specifically be can be also used for:
The pixel value of all pixels point in the shelter is decomposed into primary vector pixel value, secondary vector in color space Pixel value and third vector pixel value obtain the first set of primary vector pixel value, the second set of secondary vector pixel value With the third set for arriving third vector pixel value;And the first picture entropy of the first set is calculated separately according to entropy calculation formula The third picture entropy of value, the second picture entropy of the second set and the third set;Later, the first picture entropy is determined The arithmetic mean of instantaneous value of value, the second picture entropy and the third picture entropy is the picture entropy of the shelter.
Preferably, in some embodiments of the application, entropy calculation formula may include:Wherein, i be the first set, in the second set or the third set each element value, piFor the probability that the i occurs, H is the first picture entropy, the second picture entropy or the third picture entropy.
Preferably, in some embodiments of the application, electronic equipment can also include more units to realize more It is multi-functional, for example, then electronic equipment can also be wrapped further when judging unit 1202 determines that shelter is to resisting sample chaff interferent It includes:
Processing unit 1204, for handling this to resisting sample according to the second predetermined manner;
Recognition unit 1205, for will treated identifies to resisting sample, obtain recognition result.
Preferably, in the embodiment of the present application, if judging unit 1202, which has still further comprised second, determines subelement 12024, then the recognition unit 1205 can also be specifically used for identifying the common shelter, obtain recognition result.
Preferably, above-mentioned second predetermined manner may include: determining target pixel value, and by this in resisting sample chaff interferent The pixel value of all pixels point is revised as the target pixel value;Or, by the pixel to all pixels point in resisting sample chaff interferent Value carries out algebraic linear transformation.
Preferably, determine that target pixel value also may include following methods:
1) pixel value is arbitrarily chosen in the value range of pixel value as the target pixel value;
2) determine that the pixel value to any one pixel in resisting sample chaff interferent is the target pixel value;
3) pixel value for determining any one pixel face regional scope Nei is the target pixel value;
4) arithmetic mean of instantaneous value for determining the pixel value of all pixels point in the face regional scope is the target pixel value.
Preferably, in some embodiments of the application, determine that facial image is to resisting sample in determination unit 1203 Later, electronic equipment can further include:
Generation unit 1206, for generating alert notification;
Unit 1207 is broadcasted, the voice broadcast alert notification is used for;
And/or
Transmission unit 1208 is logical for sending the prompting to corresponding server and/or to associated target electronic device Know.
The specific function of electronic equipment and structure in the corresponding embodiment of Figure 11 and Figure 12 is for realizing earlier figures 4 The step of being handled into Figure 10 by electronic equipment, specifically it will not go into details herein.
It as shown in figure 13, is another schematic diagram of the embodiment of the present application electronic equipment.For purposes of illustration only, illustrating only and this Apply for the relevant part of embodiment, it is disclosed by specific technical details, please refer to the embodiment of the present application method part.The electronics is set Standby may include mobile phone, tablet computer, smartwatch, PC etc..The electronic equipment 100 may include processor 110, outside Portion's memory interface 120, internal storage 121, universal serial bus (universal serial bus, USB) interface 130, Charge management module 140, power management module 141, battery 142, antenna 1, antenna 2, mobile communication module 150, wireless communication Module 160, audio-frequency module 170, loudspeaker 170A, receiver 170B, microphone 170C, earphone interface 170D, sensor module 180, key 190, motor 191, indicator 192, camera shooting 193 (being referred to as camera 193) of equipment, display screen 194, and Subscriber Identity Module (subscriber identification module, SIM) card interface 195 etc..Wherein sensor module 180 may include pressure sensor 180A, gyro sensor 180B, baroceptor 180C, Magnetic Sensor 180D, acceleration Sensor 180E, range sensor 180F are touched close to optical sensor 180G, fingerprint sensor 180H, temperature sensor 180J Sensor 180K, ambient light sensor 180L, bone conduction sensor 180M etc..
It will be appreciated by persons skilled in the art that the structure of electronic equipment 100 shown in Figure 13 is not constituted to electricity The specific restriction of sub- equipment 100 may include components more more or fewer than diagram in other embodiments of the application, Perhaps certain components are combined and perhaps split certain components or different component layouts.The component of diagram can be soft with hardware The combination of part or software and hardware is realized.
It is specifically introduced below with reference to each component parts of the Figure 13 to electronic equipment 100:
Processor 110 may include one or more processing units, such as: processor 110 may include application processor (application processor, AP), modem processor, graphics processor (graphics processing Unit, GPU), image-signal processor (image signal processor, ISP), controller, Video Codec, number Signal processor (digital signal processor, DSP), baseband processor and/or neural network processor (neural-network processing unit, NPU) etc..Wherein, different processing units can be independent device, It can integrate in one or more processors.
Controller can generate operating control signal according to instruction operation code and clock signal, complete instruction fetch and execution The control of instruction.
Memory can also be set in processor 110, for storing instruction and data.In some embodiments, processor Memory in 110 is cache memory.The memory can save the instruction that processor 110 is just used or is recycled Or data.If processor 110 needs to reuse the instruction or data, can be called directly from the memory.It avoids Repeated access, reduces the waiting time of processor 110, thus improves the efficiency of system.
In some embodiments, processor 110 may include one or more interfaces.Interface may include integrated circuit (inter-integrated circuit, I2C) interface, integrated circuit built-in audio (inter-integrated circuit Sound, I2S) interface, pulse code modulation (pulse code modulation, PCM) interface, universal asynchronous receiving-transmitting transmitter (universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (mobile industry processor interface, MIPI), universal input export (general-purpose Input/output, GPIO) interface, Subscriber Identity Module (subscriber identity module, SIM) interface, and/or Universal serial bus (universal serial bus, USB) interface etc..
I2C interface is a kind of bi-directional synchronization universal serial bus, including serial data line (serial data line, SDA) He Yigen serial time clock line (derail clock line, SCL).In some embodiments, processor 110 may include Multiple groups I2C bus.Processor 110 can by different I2C bus interface distinguish coupled with touch sensors 180K, charger, Flash lamp, camera 193 etc..Such as: processor 110 can make processor by I2C interface coupled with touch sensors 180K 110 are communicated with touch sensor 180K by I2C bus interface, realize the touch function of electronic equipment 100.Similar, at this Apply in embodiment, processor 110 can be by I2C interface coupled image head 193, if camera collects current time Collected above-mentioned facial image can be transferred to processor 110 by I2C bus interface and carried out by facial image, camera Processing.
I2S interface can be used for voice communication.In some embodiments, processor 110 may include multiple groups I2S bus. Processor 110 can be coupled by I2S bus with audio-frequency module 170, be realized logical between processor 110 and audio-frequency module 170 Letter.In some embodiments, audio-frequency module 170 can also transmit audio signal to wireless communication module 160 by I2S interface, Realize the function of receiving calls by bluetooth headset.
Pcm interface can be used for voice communication, by analog signal sampling, quantization and coding.In some embodiments, sound Frequency module 170 can be coupled with wireless communication module 160 by pcm bus interface.In some embodiments, audio-frequency module 170 Audio signal can also be transmitted to wireless communication module 160 by pcm interface, realize the function to receive calls by bluetooth headset Energy.The I2S interface and the pcm interface may be used to voice communication.In some implementations of the embodiment of the present application, If electronic equipment 100 is by resisting sample is attacked, processor 110 can generate alert notification, if in the embodiment of the present application Processor 110 is coupled by I2S bus interface or pcm bus interface with audio-frequency module 170, then the alert notification is just Audio-frequency module 170 can be sent to.
UART interface is a kind of Universal Serial Bus, is used for asynchronous communication.The bus can be bidirectional communications bus. The data that it will be transmitted are converted between serial communication and parallel communications.In some embodiments, UART interface usually by with In connection processor 110 and wireless communication module 160.Such as: processor 110 passes through UART interface and wireless communication module 160 In bluetooth module communication, realize Bluetooth function.In some embodiments, audio-frequency module 170 can be by UART interface to nothing Line communication module 160 transmits audio signal, realizes the function that music is played by bluetooth headset.
MIPI interface can be used to connect the peripheral components such as processor 110 and display screen 194, camera 193.MIPI connects Mouth includes camera serial line interface (camera serial interface, CSI), display screen serial line interface (display Serial interface, DSI) etc..In some embodiments, processor 110 and camera 193 are communicated by CSI interface, real The shooting function of existing electronic equipment 100.Processor 110 and display screen 194 realize electronic equipment 100 by DSI interface communication Display function.Therefore, in the embodiment of the present application, processor 110 by I2C interface coupled image head 193 in addition to that can also may be used To be communicated by CSI interface with camera 193, that is to say, that if camera collects the facial image at current time, take the photograph It is handled as collected above-mentioned facial image not only can be transferred to processor 110 by I2C bus interface by head, it can also It is handled so that collected facial image is transferred to processor 110 by CSI interface.
GPIO interface can pass through software configuration.GPIO interface can be configured as control signal, may be alternatively configured as counting It is believed that number.In some embodiments, GPIO interface can be used for connecting processor 110 and camera 193, display screen 194, wirelessly Communication module 160, audio-frequency module 170, sensor module 180 etc..GPIO interface can be additionally configured to I2C interface, and I2S connects Mouthful, UART interface, MIPI interface etc..
Usb 1 30 is the interface for meeting USB standard specification, specifically can be Mini USB interface, and Micro USB connects Mouthful, USB Type C interface etc..Usb 1 30 can be used for connecting charger for the charging of electronic equipment 100, can be used for Data are transmitted between electronic equipment 100 and peripheral equipment.It can be used for connection earphone, audio played by earphone.The interface It can be also used for connecting other electronic equipments, such as AR equipment etc..
It is understood that the interface connection relationship of each intermodule of signal of the embodiment of the present invention, only schematically illustrates, The structure qualification to electronic equipment 100 is not constituted.In other embodiments of the application, electronic equipment 100 can also be used The combination of different interface connection type or multiple interfaces connection type in above-described embodiment.
Charge management module 140 is used to receive charging input from charger.Wherein, charger can be wireless charger, It is also possible to wired charger.In the embodiment of some wired chargings, charge management module 140 can pass through usb 1 30 Receive the charging input of wired charger.In the embodiment of some wireless chargings, charge management module 140 can pass through electronics The Wireless charging coil of equipment 100 receives wireless charging input.While charge management module 140 is that battery 142 charges, may be used also To be power electronic equipment by power management module 141.
Power management module 141 is for connecting battery 142, charge management module 140 and processor 110.Power management mould Block 141 receives the input of battery 142 and/or charge management module 140, is processor 110, internal storage 121, display screen 194, the power supply such as camera 193 and wireless communication module 160.Power management module 141 can be also used for monitoring battery capacity, Circulating battery number, the parameters such as cell health state (electric leakage, impedance).In some other embodiment, power management module 141 Also it can be set in processor 110.In further embodiments, power management module 141 and charge management module 140 can also To be set in the same device.
The wireless communication function of electronic equipment 100 can pass through antenna 1, antenna 2, mobile communication module 150, wireless communication Module 160, modem processor and baseband processor etc. are realized.
Antenna 1 and antenna 2 electromagnetic wave signal for transmitting and receiving.Each antenna in electronic equipment 100 can be used for covering Cover single or multiple communication bands.Different antennas can also be multiplexed, to improve the utilization rate of antenna.Such as: it can be by antenna 1 It is multiplexed with the diversity antenna of WLAN.In other embodiments, antenna can be used in combination with tuning switch.
Mobile communication module 150, which can provide, applies wirelessly communicating on electronic equipment 100 including 2G/3G/4G/5G etc. Solution.Mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (low noise amplifier, LNA) etc..Mobile communication module 150 can receive electromagnetic wave by antenna 1, and to received electricity Magnetic wave is filtered, and the processing such as amplification is sent to modem processor and is demodulated.Mobile communication module 150 can also be right The modulated modulated signal amplification of demodulation processor, switchs to electromagenetic wave radiation through antenna 1 and goes out.In some embodiments, it moves At least partly functional module of dynamic communication module 150 can be arranged in processor 110.In some embodiments, mobile logical At least partly functional module of letter module 150 can be arranged in the same device at least partly module of processor 110.
Modem processor may include modulator and demodulator.Wherein, modulator is used for low frequency base to be sent Band signal is modulated into high frequency signal.Demodulator is used to received electromagnetic wave signal being demodulated into low frequency baseband signal.Then solution Adjust device that the low frequency baseband signal that demodulation obtains is sent to baseband processor.Low frequency baseband signal is through baseband processor Afterwards, it is delivered to application processor.Application processor is defeated by audio frequency apparatus (being not limited to loudspeaker 170A, receiver 170B etc.) Voice signal out, in the embodiment of the present application, voice signal be exactly alert notification (such as: voice broadcast " just by resisting sample Attack, asks non-payment!" or alarm bell sound) or image or video (working as in such as the embodiment of the present application shown by display screen 194 The facial image or face video at preceding moment).In some embodiments, modem processor can be independent device.? In other embodiments, modem processor can be independently of processor 110, with mobile communication module 150 or other function Module is arranged in the same device.
It includes WLAN (wireless that wireless communication module 160, which can be provided and be applied on electronic equipment 100, Local area networks, WLAN) (such as Wireless Fidelity (wireless fidelity, Wi-Fi) network), bluetooth (bluetooth, BT), Global Navigation Satellite System (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), the short distance wireless communication technology (near field communication, NFC) are red The solution of the wireless communications such as outer technology (infrared, IR).Wireless communication module 160 can be integrated into few communication One or more devices of processing module.Wireless communication module 160 receives electromagnetic wave via antenna 2, by electromagnetic wave signal frequency modulation And filtering processing, by treated, signal is sent to processor 110.Wireless communication module 160 can also connect from processor 110 Signal to be sent is received, frequency modulation is carried out to it, is amplified, is switched to electromagenetic wave radiation through antenna 2 and go out.
In some embodiments, the antenna 1 of electronic equipment 100 and mobile communication module 150 couple, antenna 2 and channel radio Believe that module 160 couples, allowing electronic equipment 100, technology is communicated with network and other equipment by wireless communication.At this Apply in embodiment, the alert notification of generation can be sent to correspondence by mobile communication module 150 and antenna 1 by processor Server, or, being sent to other target electronic devices associated with it.The wireless communication technique may include global movement Communication system (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), CDMA access (code division multiple Access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), the time-division CDMA (time-division code division multiple access, TD-SCDMA), long term evolution (long Term evolution, LTE), BT, GNSS, WLAN, NFC, FM and/or IR technology etc..The GNSS may include that the whole world is defended Star positioning system (global positioning system, GPS), Global Navigation Satellite System (global navigation Satellite system, GLONASS), Beidou satellite navigation system (beidou navigation satellite System, BDS), quasi- zenith satellite system (quasi-zenith satellite system, QZSS) and/or star base enhancing system It unites (satellite based augmentation systems, SBAS).
Electronic equipment 100 realizes display function by GPU, display screen 194 and application processor etc..GPU is at image The microprocessor of reason, for example, in the embodiment of the present application, if what electronic equipment 100 shot by camera 193 is current time Face video extracted from the face video at current time then can be handled by GPU the face video Facial image.Connect display screen 194 and application processor.GPU is calculated for executing mathematics and geometry, is rendered for figure.Place Managing device 110 may include one or more GPU, execute program instructions to generate or change display information.
Display screen 194 is such as displayed for camera shooting in the embodiment of the present application and works as showing image, video etc. The face video or facial image at preceding moment.Display screen 194 includes display panel.Display panel can use liquid crystal display (liquid crystal display, LCD), Organic Light Emitting Diode (organic light-emitting diode, OLED), active matrix organic light-emitting diode or active-matrix organic light emitting diode (active-matrix organic Light emitting diode's, AMOLED), Flexible light-emitting diodes (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, light emitting diode with quantum dots (quantum dot light emitting Diodes, QLED) etc..In some embodiments, electronic equipment 100 may include 1 or N number of display screen 194, and N is greater than 1 Positive integer.
Electronic equipment 100 can be by ISP, camera 193, Video Codec, GPU, display screen 194 and at It manages device etc. and realizes shooting function, be exactly to pass through above-mentioned ISP in the embodiment of the present application, camera 193, Video Codec, GPU, display screen 194 and application processor etc. get the facial image at current time.
ISP is used to handle the data of the feedback of camera 193.For example, opening shutter when taking pictures, light is passed by camera lens It is delivered on camera photosensitive element, optical signal is converted to electric signal, and camera photosensitive element passes to the electric signal at ISP Reason, is converted into macroscopic image.ISP can also be to the noise of image, brightness, colour of skin progress algorithm optimization.ISP can be with Exposure to photographed scene, the parameter optimizations such as colour temperature.In some embodiments, ISP can be set in camera 193.
Camera 193 for capturing still image or video, such as the facial image at current time in the embodiment of the present application or Face video.Object generates optical imagery by camera lens and projects photosensitive element.Photosensitive element can be charge-coupled device (charge coupled device, CCD) or complementary metal oxide semiconductor (complementary metal-oxide- Semiconductor, CMOS) phototransistor.Optical signal is converted into electric signal by photosensitive element, later passes to electric signal ISP is converted into data image signal.Data image signal is output to DSP working process by ISP.DSP turns data image signal Change the RGB of standard, the picture signal of the formats such as YUV into.In some embodiments, electronic equipment 100 may include 1 or N number of Camera 193, N are the positive integer greater than 1.
Digital signal processor, in addition to can handle data image signal, can also handle it for handling digital signal His digital signal.For example, digital signal processor is used to carry out Fu to frequency point energy when electronic equipment 100 is when frequency point selects In leaf transformation etc..
Video Codec is used for compression of digital video or decompression.Electronic equipment 100 can be supported one or more Video Codec.In this way, electronic equipment 100 can play or record the video of a variety of coded formats, and such as: dynamic image is special Family's group (moving picture experts group, MPEG) 1, MPEG2, mpeg 3, MPEG4 etc..
NPU is neural network (neural-network, NN) computation processor, by using for reference biological neural network structure, Such as transfer mode between human brain neuron is used for reference, it, can also continuous self study to input information fast processing.Pass through NPU The application such as intelligent cognition of electronic equipment 100 may be implemented, such as: image recognition, recognition of face, speech recognition, text understanding Deng.
External memory interface 120 can be used for connecting external memory card, such as Micro SD card, realize that extension electronics is set Standby 100 storage capacity.External memory card is communicated by external memory interface 120 with processor 110, realizes that data store function Energy.Such as by music, the files such as video are stored in external memory card.
Internal storage 121 can be used for storing computer executable program code, and the executable program code includes Instruction.Internal storage 121 may include storing program area and storage data area.Wherein, storing program area can store operation system It unites, application program (such as sound-playing function, image player function etc.) needed at least one function etc..It storage data area can The data (such as audio data, phone directory etc.) etc. created in storage 100 use process of electronic equipment.In addition, storage inside Device 121 may include high-speed random access memory, can also include nonvolatile memory, for example, at least a disk storage Device, flush memory device, generic flash memory (universal flash storage, UFS) etc..Processor 110 passes through operation It is stored in the instruction of internal storage 121, and/or is stored in the instruction for the memory being set in processor, electronics is executed and sets Standby 100 various function application and data processing.
Electronic equipment 100 can pass through audio-frequency module 170, loudspeaker 170A, receiver 170B, microphone 170C, earphone Interface 170D and application processor etc. realize audio-frequency function.Such as music, recording etc., in the embodiment of the present application, just It is the voice broadcast or broadcasting alarm bell sound for realizing alert notification.
Audio-frequency module 170 is used to for digitized audio message to be converted into analog audio signal output, is also used for analogue audio frequency Input is converted to digital audio and video signals.Audio-frequency module 170 can be also used for audio-frequency signal coding and decoding.In some embodiments In, audio-frequency module 170 can be set in processor 110, or the partial function module of audio-frequency module 170 is set to processor In 110.
Loudspeaker 170A, also referred to as " loudspeaker ", for audio electrical signal to be converted to voice signal.Electronic equipment 100 can be with Music is listened to by loudspeaker 170A, or listens to hand-free call.
Receiver 170B, also referred to as " earpiece ", for audio electrical signal to be converted into voice signal.When electronic equipment 100 connects It answers a call or when voice messaging, it can be by the way that receiver 170B be answered voice close to human ear.
Microphone 170C, also referred to as " microphone ", " microphone ", for voice signal to be converted to electric signal.When making a phone call Or when sending voice messaging, voice signal can be input to microphone by mouth close to microphone 170C sounding by user 170C.At least one microphone 170C can be set in electronic equipment 100.In further embodiments, electronic equipment 100 can be set Two microphone 170C are set, in addition to collected sound signal, can also realize decrease of noise functions.In further embodiments, electronics is set Standby 100 can also be arranged three, four or more microphone 170C, realize that collected sound signal, noise reduction can also identify sound Directional recording function etc. is realized in source.
Earphone interface 170D is for connecting wired earphone.Earphone interface 170D can be usb 1 30, be also possible to Opening mobile electronic device platform (open mobile terminal platform, OMTP) standard interface of 3.5mm, the U.S. Cellular telecommunication industrial association (cellular telecommunications industry association of the USA, CTIA) standard interface.
Pressure signal can be converted into electric signal for experiencing pressure signal by pressure sensor 180A.In some implementations In example, pressure sensor 180A be can be set in display screen 194.Pressure sensor 180A
Type it is very much, such as resistive pressure sensor, inductance pressure transducer, capacitance pressure transducer, etc..Electricity Appearance formula pressure sensor can be the parallel-plate including at least two with conductive material.Pressure sensor is acted on when strong 180A, the capacitor between electrode change.Electronic equipment 100 determines the intensity of pressure according to the variation of capacitor.When there is touch operation Display screen 194 is acted on, electronic equipment 100 detects the touch operation intensity according to pressure sensor 180A.Electronic equipment 100 The position touched can also be calculated according to the detection signal of pressure sensor 180A.In some embodiments, identical touching is acted on Position, but the touch operation of different touch operation intensity are touched, different operational orders can be corresponded to.Such as: when there is touch operation When the touch operation that intensity is less than first pressure threshold value acts on short message application icon, the instruction for checking short message is executed.When When thering is touch operation of the touch operation intensity more than or equal to first pressure threshold value to act on short message application icon, execute newly-built The instruction of short message.
Gyro sensor 180B is determined for the athletic posture of electronic equipment 100.It in some embodiments, can be with Determine that electronic equipment 100 surrounds the angular speed of three axis (that is, x, y and z-axis) by gyro sensor 180B.Gyro sensors Device 180B can be used for shooting stabilization.Illustratively, when pressing shutter, gyro sensor 180B detection electronic equipment 100 is trembled Dynamic angle goes out the distance that lens module needs to compensate according to angle calculation, camera lens is allowed to offset electronic equipment by counter motion Stabilization is realized in 100 shake.Gyro sensor 180B can be also used for navigating, somatic sensation television game scene.
Baroceptor 180C is for measuring air pressure.In some embodiments, electronic equipment 100 passes through baroceptor The atmospheric pressure value that 180C is measured calculates height above sea level, auxiliary positioning and navigation.
Magnetic Sensor 180D includes Hall sensor.Electronic equipment 100 can use Magnetic Sensor 180D flip cover skin The folding of set.In some embodiments, when electronic equipment 100 is liding machine, electronic equipment 100 can be according to Magnetic Sensor The folding of 180D flip cover.And then according to the folding condition of the leather sheath detected or the folding condition of flip lid, setting flip lid is certainly The characteristics such as dynamic unlock.
Acceleration transducer 180E can detect the big of (the generally three axis) acceleration in all directions of electronic equipment 100 It is small.It can detect that size and the direction of gravity when electronic equipment 100 is static.It can be also used for identification electronic equipment posture, answer Switch for horizontal/vertical screen, the application such as pedometer.
Range sensor 180F, for measuring distance.Electronic equipment 100 can pass through infrared or laser distance measuring.? In some embodiments, photographed scene, electronic equipment 100 can use range sensor 180F ranging to realize rapid focus.
It may include such as light emitting diode (LED) and photodetector, such as photodiode close to optical sensor 180G. Light emitting diode can be infrared light-emitting diode.Electronic equipment 100 launches outward infrared light by light emitting diode.Electronics is set Standby 100 detect the infrared external reflection light from neighbouring object using photodiode.It, can be true when detecting sufficient reflected light Determining electronic equipment 100 nearby has object.When detecting insufficient reflected light, electronic equipment 100 can determine electronic equipment 100 do not have object nearby.Electronic equipment 100 can use to be pasted close to optical sensor 180G detection user's hand-hold electronic equipments 100 Nearly ear call, so that automatic distinguishing screen achievees the purpose that power saving.It can also be used for leather sheath mode, mouth close to optical sensor 180G Bag mode automatic unlocking and screen locking.
Ambient light sensor 180L is for perceiving environmental light brightness.Electronic equipment 100 can be according to the environment bright of perception Spend 194 brightness of automatic adjusument display screen.Automatic white balance adjustment when ambient light sensor 180L can also be used for taking pictures.Environment light Sensor 180L can also cooperate with close to optical sensor 180G, electronic equipment 100 be detected whether in pocket, with false-touch prevention.
Fingerprint sensor 180H is for acquiring fingerprint.The fingerprint characteristic that electronic equipment 100 can use acquisition realizes fingerprint Unlock accesses application lock, and fingerprint is taken pictures, fingerprint incoming call answering etc..
Temperature sensor 180J is for detecting temperature.In some embodiments, electronic equipment 100 utilizes temperature sensor The temperature of 180J detection, executes Temperature Treatment strategy.For example, when the temperature sensor 180J temperature reported is more than threshold value, electronics Equipment 100 executes the performance for reducing the processor being located near temperature sensor 180J, implements Thermal protection to reduce power consumption.? In other embodiments, when temperature is lower than another threshold value, electronic equipment 100 heats battery 142, leads to electricity to avoid low temperature The abnormal shutdown of sub- equipment 100.In some other embodiment, when temperature is lower than another threshold value, electronic equipment 100 is to battery 142 output voltage executes boosting, to avoid shutting down extremely caused by low temperature.
Touch sensor 180K, also referred to as " touch-control device ".Touch sensor 180K can be set in display screen 194, by touching It touches sensor 180K and display screen 194 forms touch screen, also referred to as " touch screen ".Touch sensor 180K acts on it for detecting On or near touch operation.The touch operation that touch sensor can will test passes to application processor, to determine touching Touch event type.Visual output relevant to touch operation can be provided by display screen 194.In further embodiments, it touches Touching sensor 180K also can be set in the surface of electronic equipment 100, different from the location of display screen 194.
The available vibration signal of bone conduction sensor 180M.In some embodiments, bone conduction sensor 180M can be with Obtain the vibration signal of human body part vibration bone block.Bone conduction sensor 180M can also contact human pulse, receive blood pressure and jump Dynamic signal.In some embodiments, bone conduction sensor 180M also can be set in earphone, be combined into bone conduction earphone.Sound Frequency module 170 can parse voice based on the vibration signal for the part vibration bone block that the bone conduction sensor 180M is obtained Signal realizes phonetic function.The blood pressure jitter solution that application processor can be obtained based on the bone conduction sensor 180M Heart rate information is analysed, realizes heart rate detecting function.
Key 190 includes power button, volume key etc..Key 190 can be mechanical key.It is also possible to touch-key. Electronic equipment 100 can receive key-press input, generate key letter related with the user setting of electronic equipment 100 and function control Number input.
Motor 191 can produce vibration prompt.Motor 191 can be used for calling vibration prompt, can be used for touching vibration Dynamic feedback.For example, acting on the touch operation of different application (such as taking pictures, audio broadcasting etc.), different vibrations can be corresponded to Feedback effects.The touch operation of 194 different zones of display screen is acted on, motor 191 can also correspond to different vibrational feedback effects. Different application scenarios (such as: time alarm receives information, alarm clock, game etc.) different vibrational feedback effects can also be corresponded to Fruit.Touch vibrational feedback effect can also be supported customized.
Indicator 192 can be indicator light, can serve to indicate that charged state, electric quantity change can be used for instruction and disappear Breath, missed call, notice etc..
SIM card interface 195 is for connecting SIM card.SIM card can be by being inserted into SIM card interface 195, or from SIM card interface 195 extract, and realization is contacting and separating with electronic equipment 100.Electronic equipment 100 can support 1 or N number of SIM card interface, N For the positive integer greater than 1.SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card etc..The same SIM Card interface 195 can be inserted into multiple cards simultaneously.The type of multiple cards may be the same or different.SIM card interface 195 Different types of SIM card can also be compatible with.SIM card interface 195 can also be with compatible external storage card.Electronic equipment 100 passes through SIM Card and network interaction realize the functions such as call and data communication.In some embodiments, electronic equipment 100 uses eSIM, That is: embedded SIM card.ESIM card can cannot separate in electronic equipment 100 with electronic equipment 100.
The specific function of electronic equipment 100 and structure in the corresponding embodiment of Figure 13 is for realizing earlier figures 4 to figure The step of being handled in 10 by electronic equipment, specifically it will not go into details herein.
The software systems of electronic equipment 100 can use layer architecture, event-driven framework, micronucleus framework, micro services frame Structure or cloud framework.The embodiment of the present application by taking the android system of layer architecture as an example, exemplary illustration electronic equipment 100 it is soft Part structure.
Figure 14 is the software architecture diagram of the electronic equipment 100 of the embodiment of the present application.
Software is divided into several layers by layer architecture, and each layer has clearly role and the division of labor.Pass through between layers Software interface communication.In some embodiments, android system is divided into four layers, from top to bottom respectively application layer, answered With process block rack-layer, (Android runtime) and system library and inner nuclear layer when Android is run.
Application layer may include a series of application packages.
As shown in figure 14, application package may include camera, picture library, calendar, call, map, navigation, WLAN, bluetooth, Music, video, the application programs such as short message.
Application framework layer provides Application Programming Interface (application for the application program of application layer Programming interface, API) and programming framework.Application framework layer includes some functions predetermined.
As shown in figure 14, application framework layer may include window manager, Content Provider, view system, phone Manager, resource manager, notification manager etc..
Window manager is for managing window writing routine.The available display screen size of window manager, judges whether there is shape State column, lock-screen, screen printing etc..
Content Provider is used to store and obtains data, and accesses these data by application program.The data It may include video, image, audio, the phone dialed and answered, browsing history and bookmark, telephone directory etc..Implement in the application In example, data can include the current time of camera acquisition facial image (including the facial image that directly takes or The facial image intercepted from face video), alert notification etc..
View system includes visible controls, such as the control of display text, shows the control etc. of picture.View system is available In building application program.What display interface can be made of one or more views.E.g., including the display of short massage notice icon Interface may include the view for showing text and the view for showing picture.
Telephone supervisor is for providing the communication function of electronic equipment 100.Such as talking state management (including connect, It hangs up).
Resource manager provides various resources, such as localized strings for application program, icon, picture, topology file, Video file etc..
Notification manager allows application program to show notification information in status bar, can be used for conveying and informs type Message, can be to disappear, without user's interaction automatically after short stay.For example notification manager be used to inform that downloading is completed, and disappear Breath prompting etc..Notification manager, which can also be, appears in the logical of system head status bar with chart or scroll bar textual form Know, for example, running background application program notice, can also be occur notice on the screen in the form of dialog box.Such as Text information is prompted in status bar, issues prompt tone, vibration of electronic equipment, indicator light flashing etc..
Android Runtime includes core library and virtual machine.Android runtime be responsible for Android system scheduling and Management.
Core library includes two parts: a part is the power function that java language needs to call, and another part is Android Core library.
Application layer and application framework layer operate in virtual machine.Virtual machine is by application layer and application program It is binary file that the java file of ccf layer, which executes,.Virtual machine is used to execute the management of Object Life Cycle, stack management, line Thread management, safety and the functions such as abnormal management and garbage reclamation.
System library may include multiple functional modules.Such as: surface manager (surface manager), media library (Media Libraries), three-dimensional graph process library (such as: OpenGL ES), 2D graphics engine (such as: SGL) etc..
Surface manager provides 2D and 3D figure layer for being managed to display subsystem for multiple application programs Fusion.
Media library supports a variety of common audios, video format playback and recording and static image file etc..Media library It can support a variety of audio/video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG etc..
Three-dimensional graph process library is for realizing 3-D graphic drawing, image rendering, synthesis and figure layer process etc..
2D graphics engine is the drawing engine that 2D draws.
Inner nuclear layer is the layer between hardware and software.Inner nuclear layer includes at least display driving, webcam driver, and audio is driven It is dynamic, sensor driving.
The scene of facial image, example when acquiring current by camera below with reference to electronic equipment in the embodiment of the present application Property illustrates the workflow of 100 software of electronic equipment and hardware.
When touch sensor 180K receives touch operation, corresponding hardware interrupts are sent to inner nuclear layer.Inner nuclear layer will touch It touches operation and is processed into original input event (including touch coordinate, the information such as timestamp of touch operation).Original input event quilt It is stored in inner nuclear layer.Application framework layer obtains original input event from inner nuclear layer, identifies control corresponding to the incoming event Part.It is to touch single-click operation with the touch operation, for control corresponding to the single-click operation is the control of camera applications icon, Camera applications call the interface of application framework layer, start camera applications, and then by calling inner nuclear layer to start webcam driver, lead to Cross the facial image (or the face video at capture current time) that camera 193 captures current time.
The software configuration of electronic equipment can be based on software shown in Figure 14 in the corresponding embodiment of above-mentioned Fig. 4 to Figure 10 Structure, software configuration shown in Figure 14 can the corresponding step for executing above-mentioned Fig. 4 into Figure 10 in embodiment of the method, herein not It repeats one by one again.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to process or function described in the embodiment of the present application.The computer can To be general purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line) or wireless (such as infrared, wireless, microwave) mode to another web-site, Computer, server or data center are transmitted.The computer readable storage medium can be what computer can store Any usable medium either includes the data storage devices such as one or more usable mediums integrated server, data center. The usable medium can be magnetic medium, and (for example, floppy disk, hard disk, tape), optical medium (such as DVD) or semiconductor are situated between Matter (such as solid state hard disk) etc..

Claims (23)

1. the detection method of a kind of pair of resisting sample is applied to recognition of face scene characterized by comprising
The facial image at acquisition current time is equipped by camera shooting;
Judge whether shelter is to resisting sample chaff interferent, and the shelter is located at human face region range in the facial image It is interior;
If the shelter is described to resisting sample chaff interferent, it is determined that the facial image is to resisting sample.
2. detection method according to claim 1, which is characterized in that described to judge whether shelter is to interfere resisting sample Object includes:
The pixel value of all pixels point in the shelter is calculated, the picture entropy of the shelter is obtained;
Judge whether the picture entropy is greater than preset threshold, the preset threshold is determined according to the first predetermined manner;
If the picture entropy is greater than the preset threshold, it is determined that the shelter is described to resisting sample chaff interferent.
3. detection method according to claim 2, which is characterized in that the picture to all pixels point in the shelter Plain value is calculated, and the picture entropy for obtaining the shelter includes:
The pixel value of all pixels point in the shelter is decomposed into primary vector pixel value, secondary vector picture in color space Element value and third vector pixel value, obtain the first set of primary vector pixel value, the second set of secondary vector pixel value and To the third set of third vector pixel value;
The first picture entropy of the first set, the second picture of the second set are calculated separately according to entropy calculation formula The third picture entropy of entropy and the third set;
Determine that the arithmetic mean of instantaneous value of the first picture entropy, the second picture entropy and the third picture entropy is described The picture entropy of shelter.
4. detection method according to claim 3, which is characterized in that the entropy calculation formula includes:
Wherein, i is each in the first set, the second set or the third set The value of element, piFor the probability that the i occurs, H is the first picture entropy, the second picture entropy or the third Picture entropy.
5. detection method described in any one of -4 according to claim 1, which is characterized in that if the shelter is the confrontation Sample chaff interferent, then the method also includes:
It is handled according to the second predetermined manner described to resisting sample;
Will treated identifies to resisting sample, obtain recognition result.
6. detection method according to claim 5, which is characterized in that second predetermined manner includes:
It determines target pixel value, and the pixel value to all pixels point in resisting sample chaff interferent is revised as the target picture Element value;
Or,
The pixel value to all pixels point in resisting sample chaff interferent is subjected to algebraic linear transformation.
7. detection method according to claim 6, which is characterized in that the determining target pixel value includes:
A pixel value is arbitrarily chosen in the value range of pixel value as the target pixel value;
Or,
Determine that the pixel value to any one pixel in resisting sample chaff interferent is the target pixel value;
Or,
The pixel value for determining any one pixel within the scope of the human face region is the target pixel value;
Or,
The arithmetic mean of instantaneous value for determining the pixel value of all pixels point within the scope of the human face region is the target pixel value.
8. detection method described in any one of -7 according to claim 1, which is characterized in that determining that the facial image is pair After resisting sample, the method also includes:
Generate alert notification;
Alert notification described in voice broadcast;
And/or
The alert notification is sent to corresponding server;
And/or
The alert notification is sent to associated target electronic device.
9. the detection method according to any one of claim 2-8, which is characterized in that first predetermined manner includes:
It obtains M and refers to facial image, described with reference to facial image is in people's face regional scope there is no shelter or there are general The facial image of logical shelter, wherein M >=1;
The described M pixel value with reference to all pixels point in the object reference facial image in facial image is calculated, is obtained To the Target Photo entropy of the object reference facial image;
Determine that the arithmetic mean of instantaneous value of M Target Photo entropy corresponding with described M reference facial image is described default Threshold value.
10. detection method according to claim 2, which is characterized in that
If the picture entropy is less than or equal to the preset threshold, it is determined that the shelter is common shelter;
The method also includes:
The common shelter is identified, recognition result is obtained.
11. a kind of electronic equipment characterized by comprising
One or more camera shooting equipment;
One or more touch screens;
One or more processors;
One or more memories;
One or more of memories are stored with one or more computer programs, one or more of computer program packets Instruction is included, when described instruction is executed by one or more of processors, so that the electronic equipment executes following steps:
The facial image at current time is obtained, the facial image is collected by camera shooting equipment;
Judge whether shelter is to resisting sample chaff interferent, and the shelter is located at human face region range in the facial image It is interior;
If the shelter is described to resisting sample chaff interferent, it is determined that the facial image is to resisting sample.
12. electronic equipment according to claim 11, which is characterized in that when described instruction is executed by the electronic equipment When, so that the electronic equipment also executes the following steps:
The pixel value of all pixels point in the shelter is calculated, the picture entropy of the shelter is obtained;
Judge whether the picture entropy is greater than preset threshold, the preset threshold is determined according to the first predetermined manner;
If the picture entropy is greater than the preset threshold, it is determined that the shelter is described to resisting sample chaff interferent.
13. electronic equipment according to claim 12, which is characterized in that when described instruction is executed by the electronic equipment When, so that the electronic equipment also executes the following steps:
The pixel value of all pixels point in the shelter is decomposed into primary vector pixel value, secondary vector picture in color space Element value and third vector pixel value, obtain the first set of primary vector pixel value, the second set of secondary vector pixel value and To the third set of third vector pixel value;
The first picture entropy of the first set, the second picture of the second set are calculated separately according to entropy calculation formula The third picture entropy of entropy and the third set;
Determine that the arithmetic mean of instantaneous value of the first picture entropy, the second picture entropy and the third picture entropy is described The picture entropy of shelter.
14. electronic equipment according to claim 13, which is characterized in that the entropy calculation formula includes:
Wherein, i is each in the first set, the second set or the third set The value of element, piFor the probability that the i occurs, H is the first picture entropy, the second picture entropy or the third Picture entropy.
15. electronic equipment described in any one of 1-14 according to claim 1, which is characterized in that if the electronic equipment determines The shelter be it is described to resisting sample chaff interferent, then when described instruction is executed by the electronic equipment, so that the electronics Equipment also executes the following steps:
It is handled according to the second predetermined manner described to resisting sample;
Will treated identifies to resisting sample, obtain recognition result.
16. electronic equipment according to claim 15, which is characterized in that second predetermined manner includes:
It determines target pixel value, and the pixel value to all pixels point in resisting sample chaff interferent is revised as the target picture Element value;
Or,
The pixel value to all pixels point in resisting sample chaff interferent is subjected to algebraic linear transformation.
17. electronic equipment according to claim 16, which is characterized in that the determining target pixel value includes:
A pixel value is arbitrarily chosen in the value range of pixel value as the target pixel value;
Or,
Determine that the pixel value to any one pixel in resisting sample chaff interferent is the target pixel value;
Or,
The pixel value for determining any one pixel within the scope of the human face region is the target pixel value;
Or,
The arithmetic mean of instantaneous value for determining the pixel value of all pixels point within the scope of the human face region is the target pixel value.
18. electronic equipment described in any one of 1-17 according to claim 1, which is characterized in that determined in the electronic equipment The facial image be to resisting sample after, then when described instruction is executed by the electronic equipment, so that the electronic equipment It also executes the following steps:
Generate alert notification;
Alert notification described in voice broadcast;
And/or
The alert notification is sent to corresponding server;
And/or
The alert notification is sent to associated target electronic device.
19. electronic equipment described in any one of 2-18 according to claim 1, which is characterized in that the first predetermined manner packet It includes:
It obtains M and refers to facial image, described with reference to facial image is in people's face regional scope there is no shelter or there are general The facial image of logical shelter, wherein M >=1;
The described M pixel value with reference to all pixels point in the object reference facial image in facial image is calculated, is obtained To the Target Photo entropy of the object reference facial image;
Determine that the arithmetic mean of instantaneous value of M Target Photo entropy corresponding with described M reference facial image is described default Threshold value.
20. electronic equipment according to claim 12, which is characterized in that if the picture entropy is less than or equal to described pre- If threshold value, then when described instruction is executed by the electronic equipment, so that the electronic equipment also executes the following steps:
Determine that the shelter is common shelter;
The common shelter is identified, recognition result is obtained.
21. a kind of electronic equipment characterized by comprising
The electronic equipment executes any one of corresponding software realization such as claim 1-10 institute by hardware or by hardware The detection method stated, the hardware or the software include the one or more and described in any item detection sides claim 1-10 The corresponding module of method.
22. a kind of computer readable storage medium, including instruction, when described instruction is run on computers, so that computer Execute such as detection method of any of claims 1-10.
23. a kind of computer program product comprising instruction, when run on a computer, so that computer executes such as right It is required that detection method described in any one of 1-10.
CN201910425689.5A 2019-05-21 2019-05-21 Method for detecting countermeasure sample and electronic equipment Active CN110321790B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910425689.5A CN110321790B (en) 2019-05-21 2019-05-21 Method for detecting countermeasure sample and electronic equipment
PCT/CN2020/091027 WO2020233564A1 (en) 2019-05-21 2020-05-19 Method and electronic device for detecting adversarial example

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910425689.5A CN110321790B (en) 2019-05-21 2019-05-21 Method for detecting countermeasure sample and electronic equipment

Publications (2)

Publication Number Publication Date
CN110321790A true CN110321790A (en) 2019-10-11
CN110321790B CN110321790B (en) 2023-05-12

Family

ID=68113242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910425689.5A Active CN110321790B (en) 2019-05-21 2019-05-21 Method for detecting countermeasure sample and electronic equipment

Country Status (2)

Country Link
CN (1) CN110321790B (en)
WO (1) WO2020233564A1 (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110705652A (en) * 2019-10-17 2020-01-17 北京瑞莱智慧科技有限公司 Countermeasure sample, generation method, medium, device and computing equipment thereof
CN110768971A (en) * 2019-10-16 2020-02-07 伍军 Confrontation sample rapid early warning method and system suitable for artificial intelligence system
CN111046379A (en) * 2019-12-06 2020-04-21 支付宝(杭州)信息技术有限公司 Anti-attack monitoring method and device
CN111325127A (en) * 2020-02-12 2020-06-23 上海云从汇临人工智能科技有限公司 Abnormal object judgment method, system, machine readable medium and equipment
CN111353403A (en) * 2020-02-24 2020-06-30 中国人民大学 Method and system for detecting confrontation sample of deep neural network image
CN111811657A (en) * 2020-07-07 2020-10-23 杭州海康威视数字技术股份有限公司 Method and device for correcting human face temperature measurement and storage medium
WO2020233564A1 (en) * 2019-05-21 2020-11-26 华为技术有限公司 Method and electronic device for detecting adversarial example
CN112001249A (en) * 2020-07-21 2020-11-27 山东师范大学 Method for canceling biological characteristics by generating sticker structure in physical world
CN112673381A (en) * 2020-11-17 2021-04-16 华为技术有限公司 Method and related device for identifying confrontation sample
CN113240028A (en) * 2021-05-24 2021-08-10 浙江大学 Anti-sample block attack detection method based on class activation graph
CN113591517A (en) * 2020-04-30 2021-11-02 华为技术有限公司 Living body detection method and related equipment
CN113936310A (en) * 2021-08-03 2022-01-14 秒针信息技术有限公司 Method and device for identifying confrontation sample mask
CN114661940A (en) * 2022-01-28 2022-06-24 宁波大学 Method for rapidly acquiring voice countermeasure sample under black box attack

Families Citing this family (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112488130B (en) * 2020-12-17 2023-08-15 苏州聚悦信息科技有限公司 AI micro hole wall detection method
CN113409407B (en) * 2021-05-17 2022-05-17 海南师范大学 Countermeasure sample defense method for acquiring low-frequency information based on average compression
CN113222056B (en) * 2021-05-28 2022-11-08 北京理工大学 Countercheck sample detection method for image classification system attack
CN114240732B (en) * 2021-06-24 2023-04-07 中国人民解放军陆军工程大学 Anti-patch generation method for attacking face verification model
CN113705620B (en) * 2021-08-04 2023-08-15 百度在线网络技术(北京)有限公司 Training method and device for image display model, electronic equipment and storage medium
CN115712893A (en) * 2021-08-20 2023-02-24 华为技术有限公司 Attack detection method and device
CN113947409A (en) * 2021-10-12 2022-01-18 支付宝(杭州)信息技术有限公司 Sample generation method, payment method, sample generation system and related equipment
CN114333031A (en) * 2021-12-31 2022-04-12 北京瑞莱智慧科技有限公司 Vulnerability detection method and device of living body detection model and storage medium
CN115909020B (en) * 2022-09-30 2024-01-09 北京瑞莱智慧科技有限公司 Model robustness detection method, related device and storage medium
CN116935172A (en) * 2023-07-31 2023-10-24 北京瑞莱智慧科技有限公司 Image processing method, related device and storage medium
CN117934000B (en) * 2024-01-23 2024-07-02 武汉光谷康服信息科技有限公司 Face data analysis system for financial payment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160224853A1 (en) * 2013-05-09 2016-08-04 Tencent Technology (Shenzhen) Company Limited Systems and methods for real human face recognition
CN108171215A (en) * 2018-01-25 2018-06-15 河南大学 Face Pseudo-median filter and camouflage category detection method based on low-rank variation dictionary and rarefaction representation classification
CN109740615A (en) * 2018-12-29 2019-05-10 武汉大学 A kind of minimizing technology of pair of attack resistance sample disturbance

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108537271B (en) * 2018-04-04 2021-02-05 重庆大学 Method for defending against sample attack based on convolution denoising self-encoder
CN109214327B (en) * 2018-08-29 2021-08-03 浙江工业大学 Anti-face recognition method based on PSO
CN110321790B (en) * 2019-05-21 2023-05-12 华为技术有限公司 Method for detecting countermeasure sample and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160224853A1 (en) * 2013-05-09 2016-08-04 Tencent Technology (Shenzhen) Company Limited Systems and methods for real human face recognition
CN108171215A (en) * 2018-01-25 2018-06-15 河南大学 Face Pseudo-median filter and camouflage category detection method based on low-rank variation dictionary and rarefaction representation classification
CN109740615A (en) * 2018-12-29 2019-05-10 武汉大学 A kind of minimizing technology of pair of attack resistance sample disturbance

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2020233564A1 (en) * 2019-05-21 2020-11-26 华为技术有限公司 Method and electronic device for detecting adversarial example
CN110768971A (en) * 2019-10-16 2020-02-07 伍军 Confrontation sample rapid early warning method and system suitable for artificial intelligence system
CN110705652A (en) * 2019-10-17 2020-01-17 北京瑞莱智慧科技有限公司 Countermeasure sample, generation method, medium, device and computing equipment thereof
CN111046379A (en) * 2019-12-06 2020-04-21 支付宝(杭州)信息技术有限公司 Anti-attack monitoring method and device
CN111046379B (en) * 2019-12-06 2021-06-18 支付宝(杭州)信息技术有限公司 Anti-attack monitoring method and device
CN111325127A (en) * 2020-02-12 2020-06-23 上海云从汇临人工智能科技有限公司 Abnormal object judgment method, system, machine readable medium and equipment
CN111353403A (en) * 2020-02-24 2020-06-30 中国人民大学 Method and system for detecting confrontation sample of deep neural network image
CN113591517A (en) * 2020-04-30 2021-11-02 华为技术有限公司 Living body detection method and related equipment
CN111811657A (en) * 2020-07-07 2020-10-23 杭州海康威视数字技术股份有限公司 Method and device for correcting human face temperature measurement and storage medium
CN112001249A (en) * 2020-07-21 2020-11-27 山东师范大学 Method for canceling biological characteristics by generating sticker structure in physical world
CN112001249B (en) * 2020-07-21 2022-08-26 山东师范大学 Method for canceling biological characteristics by generating sticker structure in physical world
CN112673381A (en) * 2020-11-17 2021-04-16 华为技术有限公司 Method and related device for identifying confrontation sample
CN112673381B (en) * 2020-11-17 2022-04-12 华为技术有限公司 Method and related device for identifying confrontation sample
CN113240028A (en) * 2021-05-24 2021-08-10 浙江大学 Anti-sample block attack detection method based on class activation graph
CN113936310A (en) * 2021-08-03 2022-01-14 秒针信息技术有限公司 Method and device for identifying confrontation sample mask
CN114661940A (en) * 2022-01-28 2022-06-24 宁波大学 Method for rapidly acquiring voice countermeasure sample under black box attack
CN114661940B (en) * 2022-01-28 2023-08-08 宁波大学 Method suitable for quickly acquiring voice countermeasure sample under black box attack

Also Published As

Publication number Publication date
CN110321790B (en) 2023-05-12
WO2020233564A1 (en) 2020-11-26

Similar Documents

Publication Publication Date Title
CN110321790A (en) The detection method and electronic equipment of a kind of pair of resisting sample
CN110381282A (en) A kind of display methods and relevant apparatus of the video calling applied to electronic equipment
CN109766043A (en) The operating method and electronic equipment of electronic equipment
CN109034102A (en) Human face in-vivo detection method, device, equipment and storage medium
CN110798568B (en) Display control method of electronic equipment with folding screen and electronic equipment
CN110506416A (en) A kind of method and terminal of terminal switching camera
CN109934137A (en) A kind of photoelectricity fingerprint identification device, terminal and fingerprint identification method
CN109766036A (en) Message treatment method and electronic equipment
EP3859576B1 (en) Application permission management method and electronic device
CN110119684A (en) Image-recognizing method and electronic equipment
CN109976626A (en) A kind of switching method and electronic equipment of application icon
CN110336910A (en) A kind of private data guard method and terminal
CN114070928B (en) Method for preventing false touch and electronic equipment
CN110401768A (en) The method and apparatus for adjusting the working condition of electronic equipment
CN109033779A (en) A kind of unlock authentication method, wearable device and computer readable storage medium
CN110262877A (en) A kind of card processing method and equipment
CN115129196A (en) Application icon display method and terminal
CN110138999A (en) A kind of papers-scanning method and device for mobile terminal
CN110248037A (en) A kind of identity document scan method and device
CN109544172A (en) A kind of display methods and terminal device
CN114528581A (en) Safety display method and electronic equipment
CN108287738A (en) A kind of application control method and device
WO2021244186A1 (en) User health management and control method, and electronic device
CN115914461B (en) Position relation identification method and electronic equipment
CN111249728B (en) Image processing method, device and storage medium

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