Method and apparatus for identifying injection attack, and device, medium and program product
By acquiring and analyzing the degree of change in camera parameters of the first and second visual content, the problem of low accuracy in detecting injection attacks in liveness detection is solved, achieving higher recognition accuracy and a lower false positive rate.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2026-03-19
AI Technical Summary
In existing technologies, liveness detection methods have low accuracy in defending against injection attacks on deepfake images.
By acquiring the first and second visual content, the degree of change in the target camera parameters is determined to identify whether an injection attack exists.
It improves the accuracy of injection attack identification, reduces the impact of noise on the judgment results, and lowers the probability of false positives.
Smart Images

Figure CN2025095762_19032026_PF_FP_ABST
Abstract
Description
Injection attack identification method, device, equipment, medium and program product
[0001] The present application claims priority to the Chinese patent application No. 202411280347.6, filed on September 12, 2024, and entitled "Injection attack identification method, device, equipment, medium and program product", the whole content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the technical field of computers, in particular to an injection attack identification method, device, equipment, medium and program product. BACKGROUND
[0003] Face verification technology refers to a technology of verifying the authenticity of user identity information by using a face. In the related art, for face verification with high security requirements, a living body detection technology is usually used.
[0004] In the related art, during living body detection, a selfie photo or video recorded by a user is detected to confirm whether the current user is a real person.
[0005] However, with the development of face replacement technology, injection attacks have emerged, which refer to replacing photos or videos normally captured by a camera. The above-mentioned living body detection method has low accuracy in defending against injection attacks of images after face replacement. SUMMARY
[0006] The present application provides an injection attack identification method, device, equipment, medium and program product, which can not only identify injection attacks, but also has high accuracy of identification results. The technical solution includes the following contents.
[0007] According to an aspect of the present application, an injection attack identification method is provided, which includes the following steps.
[0008] In the process of performing object verification, a first visual content and a second visual content are obtained, the first visual content is used to represent the visual content output when a first electronic device is captured by using a target camera parameter with a first value, and the second visual content is used to represent the visual content output when the first electronic device is captured by using the target camera parameter with a second value;
[0009] Based on the first visual content and the second visual content, a change degree of the first visual content and the second visual content in the value of the target camera parameter is determined to obtain a first change degree;
[0010] A change degree between the first value and the second value is obtained to obtain a second change degree;
[0011] If the first variation degree is inconsistent with the second variation degree, it is determined that at least one of the first visual content and the second visual content is visual content used to perform the injection attack.
[0012] According to another aspect of the present application, there is provided an injection attack identification apparatus, the apparatus comprising the following modules.
[0013] The acquisition module is configured to acquire, in a process of performing object verification, first visual content and second visual content, the first visual content being used to represent visual content output by a first electronic device when the first electronic device is used to take a picture with a first value of a target camera parameter, and the second visual content being used to represent visual content output by the first electronic device when the first electronic device is used to take a picture with a second value of the target camera parameter.
[0014] The determination module is configured to determine, based on the first visual content and the second visual content, variation degrees of the first visual content and the second visual content with respect to the value of the target camera parameter, to obtain a first variation degree.
[0015] The acquisition module is further configured to acquire a variation degree between the first value and the second value, to obtain a second variation degree.
[0016] The determination module is configured to, if the first variation degree is inconsistent with the second variation degree, determine that at least one of the first visual content and the second visual content is visual content used to perform the injection attack.
[0017] According to an aspect of the present application, there is provided a computer device, the computer device comprising a processor and a memory, the memory storing a computer program, the computer program being loaded and executed by the processor to implement the injection attack identification method as described above.
[0018] According to another aspect of the present application, there is provided a computer readable storage medium, the storage medium storing a computer program, the computer program being loaded and executed by a processor to implement the injection attack identification method as described above.
[0019] According to another aspect of the present application, there is provided a computer program product or computer program, the computer program product or computer program comprising computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the injection attack identification method as described above.
[0020] To sum up, in the embodiment of the present application, in the process of performing object verification, the first visual content and the second visual content are obtained, the first visual content is used to represent the visual content output when the first electronic device is photographed by using the first value of the target camera parameter, and the second visual content is used to represent the visual content output when the first electronic device is photographed by using the second value of the target camera parameter. Then, based on the first visual content and the second visual content, the change degree of the first visual content and the second visual content in the value of the target camera parameter is determined to obtain the first change degree, the change degree between the first value and the second value is obtained to obtain the second change degree, and if the first change degree and the second change degree are inconsistent, at least one of the first visual content and the second visual content is determined as the visual content used to perform the injection attack. Since it is determined whether the change degree of the parameter value of the first visual content and the second visual content is consistent with the specified change degree of the parameter value to judge whether there is a risk of injection attack, the accuracy of identifying the injection attack can be improved, the change degree of the parameter value of the two visual contents is used as the verification target, which has higher accuracy, and is less affected by the foreground and background of the visual content, and the probability of misjudgment is smaller.
[0021] The technical scheme provided by the embodiment of the present application has at least the following beneficial effects:
[0022] Since the injection attack will replace the image output by the ISP (Image Signal Processor, image signal processor), and the target camera parameter is the camera parameter used by the ISP or the device before the imaging process, by determining whether the camera parameter of the visual content is consistent with the specified camera parameter, it can be determined whether the visual content is replaced. If it is determined that the camera parameter value of the visual content is consistent with the specified camera parameter value, it is considered that the photographed visual content is not replaced, that is, no injection attack occurs. If it is determined that the camera parameter value of the visual content is inconsistent with the specified camera parameter value, it is considered that the photographed visual content has been replaced, and there is a risk of injection attack.
[0023] In the present application, based on whether the change degree of the parameter value of the first visual content and the second visual content is consistent with the specified change degree of the parameter value, it is judged whether there is a risk of injection attack. The change degree of the parameter value is used as the verification target, and the effect of identifying the injection attack based on the parameter value can also be achieved.
[0024] And, a more fine-grained parameter value change degree is taken as the verification target instead of simply taking the parameter value as the verification target, which is conducive to excluding the influence of possible noise in the first electronic device on the final judgment result, and further improves the accuracy of the judgment result. For example, there may be noise in the first electronic device that causes slight disturbance to the imaging process, and then affects the camera parameters embodied by the final visual content. Therefore, if only the parameter value of the visual content is determined, it may be mistakenly thought that the disturbed visual content is the visual content used to perform the injection attack, and if the parameter value change degree of the two visual contents is determined, the influence of the noise on the camera parameters will be eliminated after the parameter value change degree is determined. BRIEF DESCRIPTION OF DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.
[0026] FIG. 1 is a schematic diagram of the execution position of the injection attack provided by the related art.
[0027] FIG. 2 is a schematic diagram of an injection attack identification system provided by an embodiment of the present application.
[0028] FIG. 3 is a flowchart of an injection attack identification method provided by an embodiment of the present application.
[0029] FIG. 4 is a flowchart of an exposure compensation change degree estimation method provided by an embodiment of the present application.
[0030] FIG. 5 is a flowchart of a color temperature difference value estimation method provided by an embodiment of the present application.
[0031] FIG. 6 is a schematic diagram of a color temperature difference value estimation method provided by an embodiment of the present application.
[0032] FIG. 7 is a flowchart of a color temperature difference value estimation network training method provided by an embodiment of the present application.
[0033] FIG. 8 is a flowchart of a scaling ratio change degree estimation method provided by an embodiment of the present application.
[0034] FIG. 9 is a flowchart of an injection attack identification method provided by another embodiment of the present application.
[0035] FIG. 10 is a structural block diagram of an injection attack identification apparatus provided by an embodiment of the present application.
[0036] FIG. 11 is a structural block diagram of a computer device according to an embodiment of the present application. DETAILED DESCRIPTION
[0037] For the purpose, technical solutions and advantages of the present application to be clearer, the embodiments of the present application will be further described in detail below with reference to the drawings.
[0038] First, the terms involved in the embodiments of the present application are briefly introduced.
[0039] Face verification: refers to the technology of verifying and auditing the authenticity of user identity information to ensure the legitimacy of user identity and prevent identity fraud, forgery and fraud. Generally, face verification technology includes certificate OCR (Optical Character Recognition) recognition, liveness detection, face-to-face comparison and other technologies to solve the demand for verifying user identity information in the industry, such as real-name registration, password modification, transaction withdrawal and other scenarios in the financial, operator, shared travel and other industries.
[0040] Liveness detection: refers to verifying whether the current user is a real person through technical means to prevent identity fraud and forgery. In liveness detection, the selfie photo or video recorded by the user will be detected to confirm whether the current user is a real person. In related technologies, in the liveness detection process of face verification, the defense against attacks is mainly achieved through motion liveness detection, environmental light liveness detection and other methods.
[0041] Motion liveness detection refers to detecting liveness by detecting the user's actions, such as shaking his head, nodding, blinking, opening his mouth, etc. Through the camera, the corresponding actions performed by the user are collected, and the action recognition technology is used to detect whether the actions performed by the user collected are consistent with the specified actions, and then determine whether the current user is a real person.
[0042] Environmental light liveness detection refers to obtaining a face image of a person showing a corresponding color by a light source emitting light of a color corresponding to a preset light emission parameter, and then performing liveness detection according to the color of the face image and the color of the light emitted by the light source, and then determining whether the collected user is a real person.
[0043] Injection attack: is a common type of attack against face verification technology. Attackers replace the normal images or videos captured by the user's camera with maliciously forged images or videos prepared in advance or synthesized in real time, and use the replaced images or videos for liveness detection to deceive the face verification system.
[0044] Fig. 1 shows an imaging process of a camera, in which light rays 101 are captured by a photosensitive element 102 in a lens to generate an analog signal 103, the analog signal 103 is converted into a digital signal by an analog / digital converter 104 to obtain an original image 105. The original image 105 is processed by an ISP (Image Signal Processor) 106 to obtain an output image 107, which is the image displayed on a screen and stored. An attacker replaces the output image 107 generated by the ISP with an injection image (a real-time synthesized image or a prepared image) 108 to implement an injection attack.
[0045] The first visual content is used to represent the visual content output when the first electronic device is used to take a picture with the first value of the target camera parameter. As can be seen from Fig. 1, due to the risk of injection attack, the first visual content can be the visual content obtained by taking a picture with the first value of the target camera parameter, or can be the visual content used to perform the injection attack. The first visual content includes any one of an image and a video.
[0046] The second visual content is used to represent the visual content output when the first electronic device is used to take a picture with the second value of the target camera parameter. As can be seen from Fig. 1, due to the risk of injection attack, the second visual content can be the visual content obtained by taking a picture with the second value of the target camera parameter, or can be the visual content used to perform the injection attack. The second visual content includes any one of an image and a video.
[0047] The target camera parameter is a camera parameter used by the image signal processor or a device before the image signal processor in the imaging process shown in Fig. 1. Optionally, the target camera parameter includes exposure compensation, color temperature, zoom ratio, focal length, aperture size, exposure time, white balance mode, color gain, and image cropping.
[0048] Fig. 2 is a schematic diagram of an injection attack identification system 200 provided by an example embodiment of the present application. The identification system 200 includes a first electronic device 210 and a background server 220.
[0049] The first electronic device 210 is installed with a first client, and the first client is a client with object verification requirements. For example, the first client is a payment application, and in the bank card withdrawal scene, the user needs to be verified to ensure that the withdrawal operation is performed by a real user. For another example, the first client is a government and people's livelihood client, and in some transaction handling scenarios, the user needs to be verified to ensure that the submitted transaction is performed by a real user, such as examination registration, driving license application, business registration, etc.
[0050] The background server 220 is a server supporting object verification.
[0051] In one embodiment, in response to the first electronic device 210 running the first client, before receiving the object verification request, the first visual content 230 is output by photographing with the first value of the target camera parameter. For example, when the first client is run for the first time, the first visual content 230 is obtained by photographing with the first value of the target camera parameter, and the first visual content 230 is not the visual content used to perform the injection attack. The first electronic device 210 sends the first visual content 230 to the background server 220. In response to the first electronic device 210 receiving the object verification request, the second visual content 240 is output by photographing with the second value of the target camera parameter, and the second visual content 240 can be the visual content used to perform the injection attack. The first electronic device 210 sends the second visual content 240 to the background server 220.
[0052] The background server 220 determines the first change degree 250 of the first visual content 230 and the second visual content 240 based on the target camera parameter, calculates the change degree between the first value 260 and the second value 270 of the target camera parameter to obtain the second change degree 280, and determines that the second visual content 240 is the visual content used to perform the injection attack when the first change degree 250 and the second change degree 280 are inconsistent.
[0053] Since the injection attack will replace the image output by the ISP, and the target camera parameter is the camera parameter used by the ISP or the device before the imaging process, whether the camera parameter value of the determined visual content is consistent with the specified camera parameter value can be used to determine whether the visual content is replaced. If the determined camera parameter value is consistent with the specified camera parameter value, it is considered that the photographed visual content is not replaced, that is, no injection attack occurs. If the determined camera parameter value is inconsistent with the specified camera parameter value, it is considered that the photographed visual content is replaced, and there is a risk of injection attack.
[0054] In the above embodiment, whether there is a risk of injection attack is determined based on whether the change degree of the determined parameter value of the first visual content and the second visual content is consistent with the specified change degree of the parameter value. Using the change degree of the parameter value as the verification target can also achieve the effect of identifying the injection attack based on the parameter value.
[0055] Also, a more fine-grained parameter value change degree is used as the verification target instead of simply using the parameter value as the verification target, which helps to exclude the influence of possible noise in the first electronic device on the final judgment result, and further improves the accuracy of the judgment result. For example, there may be noise in the first electronic device that causes slight disturbance to the imaging process, and thus affects the camera parameters embodied by the final visual content. Therefore, if only the parameter value of the visual content is determined, it may be mistakenly believed that the disturbed visual content is the visual content used to perform the injection attack. However, if the parameter value change degree of the two visual contents is determined, the influence of the noise on the camera parameters will be eliminated after the parameter value change degree is calculated.
[0056] In one embodiment, the device type of the first electronic device 210 includes at least one of a smartphone, a smartwatch, a vehicle terminal, a wearable device, a smart TV, a tablet computer, an e-book reader, an MP3 player, an MP4 player, a laptop computer, and a desktop computer.
[0057] The background server 220 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks, and basic cloud computing services such as big data and artificial intelligence platforms.
[0058] It should be noted that the information (including but not limited to user device information, user personal information, user photos, videos, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals involved in the present application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data need to comply with relevant laws, regulations, and standards of relevant countries and regions.
[0059] Also, the relevant information handler will follow the principles of legality, legitimacy, and necessity, clearly define the purpose, method, and scope of relevant information processing, obtain the consent of the relevant information subject, and take necessary technical and organizational measures to ensure the security of relevant information.
[0060] FIG. 3 shows a flowchart of an injection attack identification method provided by an example embodiment of the present application, which is taken as an example to illustrate the method performed by the background server 220 in FIG. 2. The method includes:
[0061] At step 320, in the process of performing object verification, the first visual content and the second visual content are obtained, the first visual content is used to represent the visual content output by the first electronic device when the target camera parameter is used to take a picture at a first value, and the second visual content is used to represent the visual content output by the first electronic device when the target camera parameter is used to take a picture at a second value.
[0062] Specifically, object verification refers to an operation of verifying the identity of an object. In this application, the object can be a user's body, an animal, a plant, or other objects, etc. In some embodiments, the object refers to a user, and in some verification scenarios, the identity of the user needs to be verified to ensure that the operation is performed by the user himself, such as bank card withdrawal, password modification, etc. In other embodiments, the object refers to an animal, and in some verification scenarios, the identity of the animal needs to be verified to ensure that it is a certain specific animal, for example, when a pet enters or exits a country, through animal verification, it is verified whether the pet entering the country is the pet leaving the country, so as to avoid pet smuggling behavior.
[0063] The first visual content is used to represent the visual content output by the first electronic device when the target camera parameter is used to take a picture at a first value. As can be seen from FIG. 1, due to the risk of injection attack, the first visual content may be the visual content obtained by taking a picture at the first value of the target camera parameter, or may be the visual content used to perform injection attack. The first visual content includes any one of an image and a video.
[0064] The second visual content is used to represent the visual content output by the first electronic device when the target camera parameter is used to take a picture at a second value. Similarly, due to the risk of injection attack, the second visual content may be the visual content obtained by taking a picture at the second value of the target camera parameter, or may be the visual content used to perform injection attack. The second visual content includes any one of an image and a video.
[0065] Optionally, in the case of object verification being verification of a human body, the first visual content and the second visual content are visual content containing a human body, such as a photo or a video containing a human body.
[0066] The target camera parameter is a camera parameter used by the image signal processor (ISP) or a device before the imaging process shown in FIG. 1. Optionally, the target camera parameter includes exposure compensation, color temperature, zoom ratio, focal length, aperture size, exposure time, white balance mode, color gain, and image cropping, etc.
[0067] In some embodiments, the first visual content and the second visual content are both images or videos; or, the first visual content is an image and the second visual content is a video; or, the first visual content is a video and the second visual content is an image. The present application focuses on whether the degree of change of the camera parameters is consistent, and both images and videos can carry camera parameters, so the present application does not limit the media types of the two.
[0068] In one embodiment, the first value of the target camera parameter is in the installation package of the first client. The background server places the first value of the target camera parameter in the installation package of the first client, and sends the installation package to the first electronic device, so that the first client is installed on the first electronic device. The first client is a client with object verification requirements. The second value of the target camera parameter is sent by the background server to the first electronic device when the object verification request is received. Optionally, the second value of the target camera parameter is a value randomly selected by the background server from a plurality of values. Random selection can prevent an attacker from simulating the second value through multiple experiments, and then modifying the target camera parameter of the injected visual content to the second value.
[0069] In another embodiment, the first value and the second value of the target camera parameter are sent by the background server to the first electronic device when the object verification request is received. Optionally, the first value and the second value of the target camera parameter are two different values randomly selected by the background server from a plurality of values. On the basis of random selection, the number of selected values is two, which also improves the difficulty of simulating the parameter value by an attacker, and thus improves the reliability of identifying injection attacks through camera parameters.
[0070] Step 340, based on the first visual content and the second visual content, determining the degree of change of the first visual content and the second visual content in the value of the target camera parameter, to obtain a first degree of change;
[0071] After the first electronic device outputs the first visual content and the second visual content, the first visual content and the second visual content are sent to the background server. The background server performs the determination process of the degree of change of the first visual content and the second visual content in the value of the target camera parameter.
[0072] In some embodiments, the background server predicts the degree of change of the first visual content and the second visual content in the value of the target camera parameter through a neural network model (optionally, a deep neural network). Unlike image processing algorithms, predicting through a neural network model will obtain more accurate results.
[0073] In one embodiment, the first degree of change can be in the form of a value difference, a value ratio, or other measures of the degree of change of the target camera parameter between the first visual content and the second visual content.
[0074] At step 360, the variation degree between the first value and the second value is obtained, and a second variation degree is obtained.
[0075] Specifically, the variation degree between the first value and the second value can be calculated.
[0076] After the variation degree of the first visual content and the second visual content in the value of the target camera parameter, i.e., the first variation degree, is determined, and the variation degree between the first value and the second value, i.e., the second variation degree, is calculated, the first variation degree and the second variation degree are compared to determine whether there is a risk of injection attack.
[0077] In an embodiment, the second variation degree can be in the form of a value difference, a value ratio, or other forms of measuring the variation degree of the value between the first value and the second value. The first variation degree and the second variation degree are in the same form of measuring the variation degree of the value.
[0078] At step 380, if the first variation degree and the second variation degree are inconsistent, at least one of the first visual content and the second visual content is determined as the visual content for performing the injection attack.
[0079] In an embodiment, the first visual content is used to represent the visual content output by the first electronic device when the first electronic device is used to capture an image using the first value of the target camera parameter before receiving the object verification request; and the second visual content is used to represent the visual content output by the first electronic device when the first electronic device is used to capture an image using the second value of the target camera parameter in response to the object verification request.
[0080] Illustratively, the first electronic device runs a first client that needs to perform object verification. Before the first client receives the object verification request, the visual content of the object is collected by using the default parameter value (the first value of the target camera parameter), and the first visual content is obtained. At this time, the first visual content is the visual content for reference, and the first visual content does not have the risk of injection attack. In response to the first client receiving the object verification request, the visual content of the object is collected by using the second value of the target camera parameter. At this time, the second visual content has the risk of injection attack. When the background server performs object verification, it verifies whether the second visual content is the visual content for performing the injection attack. Through the above process, it can be known that the first visual content for reference can be used multiple times to perform object verification, so that even if the parameter value variation degree is used for verification, it is not necessary to obtain multiple visual contents every time the object verification is performed, which improves the reuse rate of the first visual content, ensures the effect, and also does not perform too many operations.
[0081] In another embodiment, the first visual content is used to represent visual content output by the first electronic device when the first electronic device receives the object verification request and uses the first value of the target camera parameter to capture; and the second visual content is used to represent visual content output by the first electronic device when the first electronic device receives the object verification request and uses the second value of the target camera parameter to capture. At this time, both the first visual content and the second visual content have the risk of injection attack, and when the object verification is performed, whether the first visual content and the second visual content are visual content for performing injection attack is verified.
[0082] In some embodiments, a difference between the first change degree and the second change degree is calculated to obtain a first difference, and if a value of the first difference is less than a first difference threshold, it is determined that the first change degree and the second change degree are consistent, and it is determined that there is no risk of injection attack. Alternatively, if a ratio of the first difference to the second change degree is less than a second difference threshold, it is determined that the first change degree and the second change degree are consistent, and it is determined that there is no risk of injection attack. The first difference threshold and the second difference threshold can both be preset values. By using the relative difference (i.e., the ratio of the first difference to the second change degree) to measure whether they are consistent, more attention is paid to the relative situation between the first difference and the second change degree, so that the conclusion of whether the first change degree and the second change degree are consistent is more in line with the actual situation of this change, and the final conclusion is more accurate and reliable.
[0083] The injection attack identification method provided in this embodiment, by obtaining the first visual content and the second visual content in the process of performing object verification, the first visual content is used to represent visual content output by the first electronic device when the first electronic device uses the first value of the target camera parameter to capture, and the second visual content is used to represent visual content output by the first electronic device when the first electronic device uses the second value of the target camera parameter to capture. Then, based on the first visual content and the second visual content, the change degree of the first visual content and the second visual content in the value of the target camera parameter is determined to obtain the first change degree, the change degree between the first value and the second value is obtained to obtain the second change degree, and if the first change degree and the second change degree are inconsistent, it is determined that at least one of the first visual content and the second visual content is visual content for performing injection attack. Since it is determined whether the change degree of the parameter value of the first visual content and the second visual content is consistent with the specified change degree of the parameter value to determine whether there is a risk of injection attack, the accuracy of identifying injection attack can be improved, the change degree of the parameter value of the two visual contents is used as the verification target, which has higher accuracy and is less affected by the foreground and background of the visual content, and the probability of misjudgment is smaller.
[0084] According to the above embodiment shown in FIG. 3, the following three points are explained.
[0085] Firstly, the application uses the parameter value change degree of two visual contents as the verification target, which is different from using the similarity of two visual contents as the verification target. Assuming that the same exposure value is used when shooting two visual contents, but exposure occurs in the actual shooting process, which may cause the two visual contents actually shot to be dissimilar, but if the parameter value change degree of the exposure value of the two visual contents is judged, the two visual contents are consistent. That is, by using the parameter value change degree as the verification target, compared with using the similarity of visual contents as the verification target, it has higher accuracy.
[0086] Secondly, the application compares the parameter value change degree, which is less affected by the foreground and background of the visual content; if the similarity of two visual contents is compared, it is more affected by the foreground and background. For example, the first visual content and the second visual content have the same background, but the first visual content does not contain a face, and the second visual content contains a face, although the similarity of the two visual contents is small, but the parameter value is consistent, at this time, through the parameter value change degree, it can be judged that there is no injection attack risk, if the similarity of visual content is judged, it will be misjudged as existing injection attack risk. For another example, the foreground of the first visual content and the second visual content is a face, but the background changes greatly, although the similarity of the two visual contents is small, but the parameter value is consistent, similarly, through the parameter value change degree, it can be judged that there is no injection attack risk, if the similarity of visual content is judged, it will be misjudged as existing injection attack risk.
[0087] Thirdly, if the parameter value of the visual content is used as the verification target, it is necessary to accurately determine the parameter value of the visual content, that is, the accuracy of the determined parameter value is required to be high. The application uses the parameter value change degree of two visual contents as the verification target, which can not directly determine the parameter value of the visual content. Correspondingly, the change degree of the parameter value of the visual content is different from the direct determination of the parameter value of the visual content. For example, in the application, the change degree of the brightness is used to predict the change degree of the exposure compensation, and the neural network model is directly used to predict the change degree of the color temperature.
[0088] In addition, for the scheme provided by the application using the relative scaling ratio of two visual contents as the verification target, the scaling ratio is a relative parameter, for example, the scaling ratio 120%, which means that the size is scaled by 120% relative to the previous size, at this time, the scaling ratio will use a relative parameter value to represent, not an absolute parameter value, at this time, the direct comparison method of the parameter value of the visual content is not applicable, the comparison method of the parameter value change degree provided by the application is applicable.
[0089] In some embodiments, the first visual content is used to represent all or part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the first value of the target camera parameter; and the second visual content is used to represent all or part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the second value of the target camera parameter. The following are several possible implementations.
[0090] In a first implementation, the first visual content is used to represent part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the first value of the target camera parameter; and the second visual content is used to represent part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the second value of the target camera parameter.
[0091] When the first electronic device is used to take a picture with the first value of the target camera parameter, the first electronic device outputs first picture content; the first visual content is obtained by the background server by intercepting the first picture content; and the first picture content is used to represent all of the visual content output by the first electronic device when the first electronic device is used to take a picture with the first value of the target camera parameter. When the first electronic device is used to take a picture with the second value of the target camera parameter, the first electronic device outputs second picture content; the second visual content is obtained by the background server by intercepting the second picture content; and the second picture content is used to represent all of the visual content output by the first electronic device when the first electronic device is used to take a picture with the second value of the target camera parameter.
[0092] Taking object verification as an example of human body verification, optionally, the first electronic device is used to take a picture with the first value of the target camera parameter, and the first electronic device outputs first picture content; the background server extracts a preset face region on the first picture content to obtain the first visual content. For example, the background server extracts at least one of a nose tip region, an eye region, and a mouth region from the first picture content to obtain the first visual content.
[0093] Optionally, the first electronic device is used to take a picture with the second value of the target camera parameter, and the first electronic device outputs second picture content; the background server extracts the same preset face region on the second picture content to obtain the second visual content. For example, the background server extracts at least one of a nose tip region, an eye region, and a mouth region from the second picture content to obtain the second visual content.
[0094] In the above embodiment, only whether the parameter value change degree of the determined preset face region is consistent with the actual parameter value change degree is compared, and at this time, the interference caused by the actual parameter value change degree comparison of the background region is ignored. For example, when a person is walking, the background region will change rapidly, and the background change will affect the brightness of the background region before exposure compensation. When the target camera parameter used is exposure compensation, in order to compare whether the exposure compensation change degree is consistent, it is necessary to ensure that the brightness of the light collected before exposure compensation is almost consistent. Therefore, in this embodiment, the face region is cropped, and the exposure compensation change degree of the face region is compared, which can avoid the brightness interference caused by the background change, so that the exposure compensation can be used as the target camera parameter.
[0095] In a second implementation, the first visual content is used to represent all of the visual content output by the first electronic device when the first electronic device is used to capture an image using a first value of the target camera parameter; and the second visual content is used to represent all of the visual content output by the first electronic device when the first electronic device is used to capture an image using a second value of the target camera parameter.
[0096] At this time, the parameter change degree comparison is directly based on all of the visual content output by the first electronic device, without the need for additional image processing operations, which is simple to operate and can save the performance of the background server and improve the efficiency of the background server in identifying injection attacks.
[0097] In a third implementation, the first visual content is used to represent all of the visual content output by the first electronic device when the first electronic device is used to capture an image using a first value of the target camera parameter; and the second visual content is used to represent part of the visual content output by the first electronic device when the first electronic device is used to capture an image using a second value of the target camera parameter.
[0098] When the first electronic device is used to capture an image using a first value of the target camera parameter, the first visual content is output; when the first electronic device is used to capture an image using a second value of the target camera parameter, the second captured content is output; and the second visual content is obtained by the background server from the second captured content, and the second captured content is used to represent all of the visual content output by the first electronic device when the first electronic device is used to capture an image using a second value of the target camera parameter.
[0099] In some embodiments, the first visual content is visual content for reference, and the second visual content is visual content output by the first electronic device after receiving the object verification request. The first visual content is all visual content output by the first electronic device, which provides more accurate reference information for reference, so as to predict a more accurate degree of change of the camera parameter value. For example, the predicted camera parameter is exposure compensation, the first visual content is a first image, and the degree of change of the predicted exposure compensation is estimated according to the color of all pixel points of the first image to estimate the brightness of the first image. Since the first image is an uncut image output by the first electronic device, the color of all pixel points is retained, and therefore, the estimated brightness of the first image is more accurate.
[0100] The first electronic device outputs second shooting content when the first electronic device shoots by using the second value of the target camera parameter.
[0101] Taking object verification as an example of verification of a human body, the first electronic device can alternatively shoot by using the second value of the target camera parameter, output second shooting content, and the background server extracts a preset face region on the second shooting content to obtain the second visual content. For example, the background server extracts at least one of a nose tip region, an eye region, and a mouth region from the second shooting content to obtain the second visual content.
[0102] In the above embodiments, only the degree of change of the parameter value of the preset face region is compared with whether the actual degree of change of the parameter value is consistent, at this time, the interference caused by the actual parameter value comparison of the background region is ignored, for example, the background region will change rapidly when a person is walking.
[0103] For the case where the target camera parameter includes exposure compensation (ISP uses the camera parameter):
[0104] In the optional embodiment based on FIG. 3, step 340 includes steps 420 to 480. As shown in FIG. 4, FIG. 4 shows a flowchart of a method for identifying an injection attack provided by an example embodiment of the present application, which is taken as an example to illustrate that the method is performed by the background server 220 in FIG. 2, and the method includes:
[0105] Step 420: estimating a first brightness of the first visual content based on the color of the first visual content;
[0106] In one embodiment, the first visual content comprises a first image, for any one first pixel in the first image, based on pixel values of the first pixel in a plurality of color channels, a luminance of the first pixel is obtained; based on luminances of a plurality of first pixels in the first image, a first luminance of the first image is obtained. Illustratively, the luminance of one first pixel is calculated by the following formula (1): Y = 0.299 * R + 0.587 * G + 0.114 * B; (1)
[0107] wherein Y represents the luminance of the first pixel, R represents a pixel value of the first pixel in a red color channel, G represents a pixel value of the first pixel in a green color channel, and B represents a pixel value of the first pixel in a blue color channel.
[0108] An average of the luminances of all the first pixels in the first image is determined as the luminance of the first image.
[0109] The luminance of the first pixel is estimated by the formula (1), and the calculation process is relatively simple. Moreover, the luminance of the first image is estimated based on the luminances of the plurality of first pixels in the first image, and the plurality of first pixels in the first image are fully utilized, so that the estimated luminance of the first image is more accurate.
[0110] In another embodiment, the first visual content comprises a first video, for any one first pixel in any one first image in the first video, based on pixel values of the first pixel in a plurality of color channels, a luminance of the first pixel is obtained; based on luminances of a plurality of first pixels in the first image, a luminance of the first image is obtained; based on luminances of a plurality of first images in the first video, a luminance of the first video is obtained.
[0111] Illustratively, the luminance of the first pixel is calculated by the above formula (1); an average of the luminances of all the first pixels in the first image is determined as the luminance of the first image; and an average of the luminances of the plurality of first images is determined as the luminance of the first video.
[0112] The luminance of the first pixel is estimated by the formula (1), and the calculation process is relatively simple. Moreover, the luminance of the first image is estimated based on the luminances of the plurality of first pixels in the first image, and the plurality of first pixels in the first image are fully utilized, so that the estimated luminance of the first image is more accurate. Similarly, the plurality of first images in the first video are fully utilized, so that the estimated luminance of the first video is more accurate.
[0113] Step 440, based on a color of the second visual content, a second luminance of the second visual content is estimated;
[0114] In one embodiment, the second visual content comprises a second image, for any one second pixel in the second image, based on pixel values of the second pixel in multiple color channels, a luminance of the second pixel is obtained; based on luminances of multiple second pixels in the second image, a second luminance of the second image is obtained. Illustratively, the luminance of one second pixel is calculated by formula (2) as follows: Y = 0.299 * R + 0.587 * G + 0.114 * B; (2)
[0115] wherein Y represents the luminance of the second pixel, R represents a pixel value of the second pixel in a red color channel, G represents a pixel value of the second pixel in a green color channel, and B represents a pixel value of the second pixel in a blue color channel.
[0116] An average of the luminances of all the second pixels in the second image is determined as the luminance of the second image.
[0117] The luminance of the second pixel is estimated by formula (2), and the calculation process is relatively simple. Moreover, the luminance of the second image is estimated based on the luminances of multiple second pixels in the second image, and multiple second pixels in the second image are fully utilized, so that the luminance of the second image estimated is more accurate.
[0118] In another embodiment, the second visual content comprises a second video, for any one second pixel in any one second image in the second video, based on pixel values of the second pixel in multiple color channels, a luminance of the second pixel is obtained; based on luminances of multiple second pixels in the second image, a luminance of the second image is obtained; based on luminances of multiple second images in the second video, a luminance of the second video is obtained.
[0119] Illustratively, the luminance of one second pixel can be calculated by formula (2) as described above; an average of the luminances of all the second pixels in the second image is determined as the luminance of the second image; and an average of the luminances of multiple second images is determined as the luminance of the second video.
[0120] The luminance of the second pixel is estimated by formula (2), and the calculation process is relatively simple. Moreover, the luminance of the second image is estimated based on the luminances of multiple second pixels in the second image, and multiple second pixels in the second image are fully utilized, so that the luminance of the second image estimated is more accurate. Similarly, multiple second images in the second video are fully utilized, so that the luminance of the second video estimated is more accurate.
[0121] In the embodiments of the present application, the first visual content and the second visual content can both be images, both be videos, or the first visual content is an image and the second visual content is a video, or the first visual content is a video and the second visual content is an image, and there are four combinations in total, which are not limited by the present application.
[0122] For the requirement of high security, the object verification often also uses other liveness detection technologies, which can use images or videos for liveness detection. The injection attack identification method provided in the present application can be well applied to both images and videos, that is, the injection attack identification method provided in the present application has strong universality and can better cooperate with other liveness detection technologies to jointly defend external attacks.
[0123] In step 460, based on the first brightness and the second brightness, the exposure compensation change degree between the first visual content and the second visual content is calculated.
[0124] In one embodiment, based on the ratio of the first brightness and the second brightness, the exposure compensation change degree between the first visual content and the second visual content is obtained. Illustratively, the exposure compensation change degree between the first visual content and the second visual content is calculated by the following formula (3). E=Y_tgt / Y_ref; (3)
[0125] Wherein, Y_tgt is the brightness of the first visual content, that is, the first brightness; Y_ref is the brightness of the second visual content, that is, the second brightness; E is the exposure compensation change degree between the first visual content and the second visual content.
[0126] The exposure compensation change degree is directly calculated by the ratio, and the calculation complexity is low, which effectively improves the calculation efficiency of the exposure compensation change degree, and further improves the identification efficiency of the injection attack.
[0127] In step 480, the exposure compensation change degree is determined as the first change degree of the exposure compensation.
[0128] The exposure compensation change degree between the first visual content and the second visual content is determined as the first change degree of the exposure compensation. In the case where the first change degree of the exposure compensation and the second change degree of the exposure compensation are consistent, at least one of the first visual content and the second visual content is determined as the visual content used to perform the injection attack. The second change degree of the exposure compensation is the change degree between the first value of the exposure compensation and the second value of the exposure compensation.
[0129] Since the injection attack will replace the image output by the ISP, and the exposure compensation is a camera parameter used by the ISP in the imaging process, whether the exposure compensation value of the estimated visual content is consistent with the specified exposure compensation value can be used to determine whether the visual content is replaced. If the estimated exposure compensation value is consistent with the specified exposure compensation value, it is considered that the captured visual content is not replaced, that is, no injection attack occurs. If the estimated exposure compensation value is inconsistent with the specified exposure compensation value, it is considered that the captured visual content has been replaced, and there is a risk of injection attack.
[0130] In the above embodiment, whether the estimated exposure compensation variation degree of the first visual content and the second visual content is consistent with the specified exposure compensation variation degree is used to determine whether there is a risk of injection attack. Using the exposure compensation variation degree as the verification target can also achieve the effect of identifying injection attack based on exposure compensation.
[0131] In the case where the target camera parameter includes color temperature (the camera parameter used by the ISP):
[0132] In the optional embodiment shown in FIG. 3, step 340 includes the following content: based on the first visual content and the second visual content, predicting a color temperature difference value between the first visual content and the second visual content by a color temperature difference value estimation network to obtain a first color temperature difference value; and determining the first color temperature difference value as the first variation degree of the color temperature. The color temperature difference value estimation network is a neural network for predicting the color temperature difference value between the visual contents.
[0133] In the above embodiment, whether the predicted color temperature variation degree of the first visual content and the second visual content is consistent with the specified color temperature variation degree is used to determine whether there is a risk of injection attack. Using the color temperature variation degree as the verification target can also achieve the effect of identifying injection attack based on color temperature. Moreover, the color temperature difference value estimation network is a neural network model, that is, the present application predicts the color temperature difference value between the first visual content and the second visual content by means of artificial intelligence, so that the predicted color temperature difference value is more accurate.
[0134] Specifically, the above content includes steps 520 to 580 in FIG. 5. FIG. 5 shows a flowchart of a method for identifying injection attack provided by an exemplary embodiment of the present application, which can be executed by the background server 220 in FIG. 2. The method includes the following steps:
[0135] Step 520: input the first visual content and the second visual content into a color temperature difference value estimation network;
[0136] In combination with FIG. 6, the background server inputs the first visual content 601 and the second visual content 602 into the color temperature difference value estimation network 600.
[0137] Step 540: performing feature extraction operation on the first visual content in the color temperature difference value estimation network to obtain a first feature; and performing feature extraction operation on the second visual content to obtain a second feature;
[0138] In the color temperature difference value estimation network, a feature extraction network is included. The feature extraction network is configured to extract features of the visual content. In the color temperature difference value estimation network 600, the background server performs a feature extraction operation on the first visual content 601 to obtain first features 603, and performs a feature extraction operation on the second visual content 602 to obtain second features 604, in combination with reference to FIG. 6.
[0139] At step 560, a feature fusion operation is performed based on the first features and the second features to obtain fused features.
[0140] Optionally, the feature fusion operation refers to an operation of splicing the first features and the second features along a feature dimension. For example, the first features are represented as H*W*C1, the second features are represented as H*W*C2, and the fused features are represented as H*W*(C1+C2), where H and W respectively represent the length and width of the features, and C1 and C2 represent the channels of the features.
[0141] In the color temperature difference value estimation network 600, the background server performs a feature fusion operation based on the first features 603 and the second features 604 to obtain fused features 605, in combination with reference to FIG. 6.
[0142] At step 580, a first color temperature difference value between the first visual content and the second visual content is predicted based on the fused features.
[0143] Optionally, the fused features are input into a multi-layer perception machine to predict the first color temperature difference value between the first visual content and the second visual content.
[0144] In the color temperature difference value estimation network 600, a first color temperature difference value 606 between the first visual content 601 and the second visual content 602 is predicted based on the fused features 605, in combination with reference to FIG. 6.
[0145] A color temperature change degree between the first visual content and the second visual content is determined as a first change degree of the color temperature. In a case where the first change degree of the color temperature and a second change degree of the color temperature are consistent, at least one of the first visual content and the second visual content is determined as the visual content used to perform the injection attack. The second change degree of the color temperature is a change degree between the first value of the color temperature and the second value of the color temperature.
[0146] In summary, in the above embodiments, the feature fusion operation is performed based on the first features and the second features to obtain the fused features, and the fused features are used to predict the color temperature difference value. That is, the above embodiments provide a one-step prediction manner of the color temperature difference value, rather than a two-step manner of first predicting a first color temperature based on the first features, then predicting a second color temperature based on the second features, and finally calculating a color temperature difference value between the first color temperature and the second color temperature. The one-step prediction manner can avoid accumulation of errors, and thus improve the prediction accuracy of the color temperature difference value.
[0147] In an embodiment, the color temperature difference value estimation network is trained by a method as shown in FIG. 7. FIG. 7 shows a flowchart of a method for training a color temperature difference value estimation network according to an example embodiment of the present application. The method can be performed by the background server 220 in FIG. 2, or by another device, which sends the trained color temperature difference value estimation network to the background server 220.
[0148] At step 720, the first sample visual content, the second sample visual content, the first color temperature, and the second color temperature are obtained. The first sample visual content is visual content captured with the first color temperature, and the second sample visual content is visual content captured with the second color temperature.
[0149] In the present embodiment, by specifying a plurality of color temperatures, visual content is collected according to each color temperature in the plurality of color temperatures, and a plurality of sample visual contents corresponding to each color temperature are obtained, and then a training data set is constructed.
[0150] Optionally, two sample visual contents are randomly obtained from the training data set, and the first sample visual content and the second sample visual content are obtained.
[0151] At step 740, the difference between the first color temperature and the second color temperature is calculated as a label color temperature difference value.
[0152] The difference between the first color temperature and the second color temperature is taken as the training target k of this training.
[0153] At step 760, based on the first sample visual content and the second sample visual content, the color temperature difference value estimation network is used to predict the color temperature difference value between the first sample visual content and the second sample visual content, and a sample color temperature difference value is obtained.
[0154] In an embodiment, similar to the inference process of the color temperature difference value estimation network described above, the color temperature difference value estimation network predicts the color temperature difference value between the first sample visual content and the second sample visual content, and a sample color temperature difference value is obtained. Specifically, the first sample visual content and the second sample visual content are input into the color temperature difference value estimation network; in the color temperature difference value estimation network, a feature extraction operation is performed on the first sample visual content to obtain a first sample feature, and a feature extraction operation is performed on the second sample visual content to obtain a second sample feature; a feature fusion operation is performed based on the first sample feature and the second sample feature to obtain a sample fusion feature; and based on the sample fusion feature, the sample color temperature difference value between the first sample visual content and the second sample visual content is predicted.
[0155] At step 780, the color temperature difference value estimation network is trained based on the gap between the label color temperature difference value and the sample color temperature difference value.
[0156] In an embodiment, a LI loss value between the label color temperature difference value and the sample color temperature difference value is calculated, and based on the LI loss value, the parameters of the color temperature difference value estimation network are optimized by a gradient descent method.
[0157] Illustratively, the formula of the L1 loss is: L1 = |k_pred-k|; (4)
[0158] Wherein, L1 represents the LI loss value, k_pred represents the sample color temperature difference value, and k represents the label color temperature difference value.
[0159] In an embodiment, the color temperature difference value estimation network is continuously trained by repeatedly performing the above steps 720 to 780 until the parameters of the color temperature difference value estimation network converge.
[0160] To sum up, the present application provides a training method of a color temperature difference value estimation network, which is simple and effective in training strategy. It is worth mentioning that the training data set of the present application is constructed by visual content acquisition at a specified color temperature. At this time, the specified color temperature can be used as a true value to participate in the training of the color temperature difference value estimation network. That is, the present application provides a construction method of a training data set under supervised learning, which is relatively simple.
[0161] For the case where the target camera parameter includes a zoom ratio (a camera parameter used by the ISP):
[0162] Based on the optional embodiment shown in FIG. 3, step 340 includes steps 820 to 880. As shown in FIG. 8, FIG. 8 shows a flowchart of a method for identifying an injection attack according to an example embodiment of the present application. The object verification of FIG. 8 is human body verification. This method is taken as an example to be executed by the background server 220 in FIG. 2. The method includes:
[0163] Step 820, performing face detection on the first visual content to obtain a first face frame;
[0164] Taking the first visual content as a first image as an example, the background server performs face detection on the first image to obtain a face region. The background server establishes a minimum enclosing box of the face region, i.e., obtains a first face frame. Optionally, the minimum enclosing box is a rectangular frame, an elliptical frame, etc. Optionally, the background server performs image segmentation on the first image by a SAM model (Segment Anything Model) to obtain the face region on the first image.
[0165] Taking the first visual content as a first video as an example, the background server performs face detection on the first video, and establishes a minimum enclosing box for the face region detected by the background server for each frame of picture. Since the first video is a continuous user picture, the picture may contain images of user side face and front face, and thus the maximum box in the multiple minimum enclosing boxes in the first video is determined as the first face box.
[0166] Step 840, performing face detection on the second visual content to obtain a second face box;
[0167] Taking the second visual content as a second image as an example, the background server performs face detection on the second image to obtain a face region. The background server establishes a minimum enclosing box for the face region, i.e., obtains a second face box. Optionally, the minimum enclosing box is a rectangular box, an elliptical box, etc. Optionally, the background server performs image segmentation on the second image through a SAM model to obtain the face region on the second image.
[0168] Taking the second visual content as a second video as an example, the background server performs face detection on the second video, and establishes a minimum enclosing box for the face region detected by the background server for each frame of picture. Since the second video is a continuous user picture, the picture may contain images of user side face and front face, and thus the maximum box in the multiple minimum enclosing boxes in the second video is determined as the second face box.
[0169] Step 860, obtaining a scaling ratio change degree between the first visual content and the second visual content based on a size ratio of the first face box and the second face box;
[0170] In an embodiment, the first face box and the second face box are rectangular boxes, and a ratio of a diagonal line length of the first face box to a diagonal line length of the second face box is determined as the scaling ratio change degree between the first visual content and the second visual content. Since the diagonal line length is a value that is easy to calculate, and the diagonal line length is obtained based on the length and the width of the face box, thus, determining the scaling ratio change degree based on the diagonal line length is a relatively simple and effective calculation operation. Alternatively, a ratio of an area of the first face box to an area of the second face box is determined as the scaling ratio change degree between the first visual content and the second visual content.
[0171] Illustratively, the calculation is performed through the following formula (5). R = l_tgt / l_ref; (5)
[0172] Wherein, R is the scaling ratio change degree between the first visual content and the second visual content, l_tgt is the diagonal line length of the first face box, and l_ref is the diagonal line length of the second face box.
[0173] In another embodiment, the first face frame and the second face frame are circular frames, and a ratio of a radius of the first face frame to a radius of the second face frame is determined as the scaling ratio variation degree between the first visual content and the second visual content. Alternatively, a ratio of an area of the first face frame to an area of the second face frame is determined as the scaling ratio variation degree between the first visual content and the second visual content.
[0174] In step 880, the scaling ratio variation degree is determined as the first variation degree of the scaling ratio.
[0175] The scaling ratio variation degree between the first visual content and the second visual content is determined as the first variation degree of the scaling ratio. In a case where the first variation degree of the scaling ratio and the second variation degree of the scaling ratio are consistent, at least one of the first visual content and the second visual content is determined as the visual content used to perform the injection attack. The second variation degree of the scaling ratio is a variation degree between the first value of the scaling ratio and the second value of the scaling ratio.
[0176] Since the injection attack will replace the image output by the ISP, and the scaling ratio is a camera parameter used by the ISP in the imaging process, by determining whether the scaling ratio value of the determined visual content is consistent with the specified scaling ratio value, it can be judged whether the visual content is replaced. If the determined scaling ratio value and the specified scaling ratio value are consistent, it is considered that the captured visual content is not replaced, that is, there is no injection attack. If the determined scaling ratio value and the specified scaling ratio value are inconsistent, it is considered that the captured visual content has been replaced, and there is a risk of injection attack.
[0177] In the above embodiment, based on whether the determined scaling ratio variation degree of the first visual content and the second visual content is consistent with the specified scaling ratio variation degree, it is judged whether there is a risk of injection attack. Using the scaling ratio variation degree as the verification target can also achieve the effect of identifying the injection attack based on the scaling ratio.
[0178] In the foregoing, the identification methods of the injection attack based on the exposure compensation, the color temperature, and the scaling ratio of the three camera parameters have been introduced. In the embodiments of the present application, the identification method of the injection attack can be performed based on at least one of the exposure compensation, the color temperature, and the scaling ratio of the three camera parameters, and the present application does not limit the number of types of camera parameters used.
[0179] For example, the background server issues a second value of a set of camera parameters to the first electronic device, for example, exposure compensation 1ev, color temperature 3000k, and scaling ratio 120%. The first electronic device will perform shooting based on the second value of the set of camera parameters, and output the second visual content. The first electronic device also performs shooting based on the first value of the set of camera parameters, and outputs the first visual content.
[0180] The background server will predict the degree of change in exposure compensation of the first visual content and the second visual content based on the first visual content and the second visual content, and predict the degree of change in color temperature of the first visual content and the second visual content based on the first visual content and the second visual content, and predict the degree of change in scaling ratio of the first visual content and the second visual content based on the first visual content and the second visual content.
[0181] For exposure compensation, the background server obtains a first identifier based on whether the predicted degree of change in exposure compensation is consistent with the actual degree of change; for color temperature, the background server obtains a second identifier based on whether the predicted degree of change in color temperature is consistent with the actual degree of change; for scaling ratio, the background server obtains a third identifier based on whether the predicted degree of change in scaling ratio is consistent with the actual degree of change; when the first identifier, the second identifier and the third identifier are all the same and all point to inconsistency, the background server determines that at least one of the first visual content and the second visual content is visual content for performing injection attack.
[0182] Further, the background server can issue multiple groups of camera parameters to the first electronic device, each group of camera parameters containing at least one of the three camera parameters of exposure compensation, color temperature and scaling ratio.
[0183] In the case that at least one group of camera parameters in the multiple groups of camera parameters corresponds to an identification result that injection attack exists, the background server determines that there is a risk of injection attack, and the background server sends a message of verification failure to the first electronic device.
[0184] Application scenario embodiment:
[0185] The following embodiments introduce a method for identifying injection attack when performing human verification.
[0186] FIG. 9 shows a flowchart of a method for identifying injection attack according to an example embodiment of the present application, which is taken as an example to illustrate the method performed by the background server 220 shown in FIG. 2, and the method includes:
[0187] In step 920, in the process of performing human verification, the first visual content and the second visual content are obtained, the first visual content is used to represent the visual content output when the first electronic device uses the first value of the target camera parameter to take a photo before receiving the human verification request, and the second visual content is used to represent the visual content output when the first electronic device uses the second value of the target camera parameter to take a photo in response to the human verification request.
[0188] In some embodiments, the first visual content and the second visual content are visual content containing a human body, such as a photo or a video containing a human body.
[0189] In some embodiments, the first visual content and the second visual content are both images or videos; or, the first visual content is an image and the second visual content is a video; or, the first visual content is a video and the second visual content is an image. The present application focuses on whether the degree of change of the front camera parameter and the rear camera parameter is consistent, and both images and videos can carry camera parameters, so the present application does not limit the media types of the two.
[0190] In some embodiments, the first visual content is used to represent all or part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the first value of the target camera parameter; and the second visual content is used to represent all or part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the second value of the target camera parameter.
[0191] Optionally, the first visual content is used to represent part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the first value of the target camera parameter. The first shooting content is obtained, which is used to represent all the visual content output by the first electronic device when the first electronic device is used to take a picture with the first value of the target camera parameter; and a preset face region on the first shooting content is extracted to obtain the first visual content.
[0192] Optionally, the second visual content is used to represent part of the visual content output by the first electronic device when the first electronic device is used to take a picture with the second value of the target camera parameter. The second shooting content is obtained, which is used to represent all the visual content output by the first electronic device when the first electronic device is used to take a picture with the second value of the target camera parameter; and a preset face region on the second shooting content is extracted to obtain the second visual content.
[0193] In step 940, based on the first visual content and the second visual content, the degree of change of the first visual content and the second visual content in the value of the target camera parameter is determined to obtain the first degree of change.
[0194] In some embodiments, the target camera parameter includes exposure compensation. The first brightness of the first visual content is estimated based on the color of the first visual content; and the second brightness of the second visual content is estimated based on the color of the second visual content; the degree of change of the exposure compensation between the first visual content and the second visual content is calculated based on the first brightness and the second brightness; and the degree of change of the exposure compensation is determined as the first degree of change of the exposure compensation.
[0195] Optionally, the first visual content includes a first image. For any first pixel in the first image, the brightness of the first pixel is obtained based on the pixel value of the first pixel in multiple color channels; and the first brightness of the first image is obtained based on the brightness of multiple first pixels in the first image.
[0196] Optionally, the second visual content comprises a second image; for any second pixel in the second image, a luminance of the second pixel is obtained based on pixel values of the second pixel in a plurality of color channels; and a second luminance of the second image is obtained based on luminances of a plurality of second pixels in the second image.
[0197] Optionally, the first visual content comprises a first video; for any first pixel in any first image in the first video, a luminance of the first pixel is obtained based on pixel values of the first pixel in a plurality of color channels; a luminance of the first image is obtained based on luminances of a plurality of first pixels in the first image; and a first luminance of the first video is obtained based on luminances of a plurality of first images in the first video.
[0198] Optionally, the second visual content comprises a second video; for any second pixel in any second image in the second video, a luminance of the second pixel is obtained based on pixel values of the second pixel in a plurality of color channels; a luminance of the second image is obtained based on luminances of a plurality of second pixels in the second image; and a second luminance of the second video is obtained based on luminances of a plurality of second images in the second video.
[0199] Optionally, a degree of exposure compensation change between the first visual content and the second visual content is obtained based on a ratio of the first luminance and the second luminance.
[0200] In some embodiments, the target camera parameter comprises a color temperature; a color temperature difference value between the first visual content and the second visual content is predicted based on the first visual content and the second visual content by a color temperature difference value estimation network, the color temperature difference value estimation network being a neural network for predicting a color temperature difference value between visual contents, and a first color temperature difference value is obtained; and the first color temperature difference value is determined as a first degree of change of the color temperature.
[0201] Optionally, the first visual content and the second visual content are input into the color temperature difference value estimation network; a first feature is obtained by performing a feature extraction operation on the first visual content in the color temperature difference value estimation network; and a second feature is obtained by performing a feature extraction operation on the second visual content; a fusion feature is obtained by performing a feature fusion operation based on the first feature and the second feature; and the first color temperature difference value between the first visual content and the second visual content is predicted based on the fusion feature.
[0202] Optionally, the color temperature difference value estimation network is obtained by training the following steps:
[0203] obtaining a first sample visual content, a second sample visual content, a first color temperature and a second color temperature, the first sample visual content being visual content captured by using the first color temperature, and the second sample visual content being visual content captured by using the second color temperature; calculating a difference value between the first color temperature and the second color temperature as a label color temperature difference value; based on the first sample visual content and the second sample visual content, predicting a color temperature difference value between the first sample visual content and the second sample visual content by using a color temperature difference value estimation network, to obtain a sample color temperature difference value; and training the color temperature difference value estimation network based on a difference between the label color temperature difference value and the sample color temperature difference value.
[0204] In some embodiments, the target camera parameter includes a zoom ratio; performing face detection on the first visual content to obtain a first face frame; performing face detection on the second visual content to obtain a second face frame; obtaining a zoom ratio change degree between the first visual content and the second visual content based on a size ratio of the first face frame and the second face frame; and determining the zoom ratio change degree as a first change degree of the zoom ratio.
[0205] In step 960, a change degree between the first value and the second value is obtained as a second change degree.
[0206] Optionally, a ratio of a diagonal line length of the first face frame to a diagonal line length of the second face frame is determined as the zoom ratio change degree between the first visual content and the second visual content.
[0207] In step 980, if the first change degree and the second change degree are inconsistent, the second visual content is determined as the visual content used for performing the injection attack.
[0208] If the first change degree and the second change degree are inconsistent, the second visual content responding to the human body verification request is determined as the visual content used for performing the injection attack.
[0209] FIG. 10 shows a structural block diagram of an injection attack identification device provided by an example embodiment of the present application, which includes:
[0210] The obtaining module 1001 is configured to, in a process of performing object verification, obtain a first visual content and a second visual content, the first visual content being used to represent visual content output by a first electronic device when the first electronic device is used to capture by using a first value of a target camera parameter, and the second visual content being used to represent visual content output by the first electronic device when the first electronic device is used to capture by using a second value of the target camera parameter.
[0211] The determining module 1002 is configured to determine a value change degree of the target camera parameter between the first visual content and the second visual content based on the first visual content and the second visual content, to obtain a first change degree.
[0212] The acquisition module 1001 is further configured to acquire a second change degree between the first value and the second value.
[0213] The determination module 1002 is further configured to determine that at least one of the first visual content and the second visual content is the visual content used to perform the injection attack if the first change degree is inconsistent with the second change degree.
[0214] In an optional embodiment, the target camera parameter includes exposure compensation; the determination module 1002 is further configured to estimate a first brightness of the first visual content based on colors of the first visual content; and estimate a second brightness of the second visual content based on colors of the second visual content.
[0215] The determination module 1002 is further configured to calculate an exposure compensation change degree between the first visual content and the second visual content based on the first brightness and the second brightness.
[0216] The determination module 1002 is further configured to determine the exposure compensation change degree as the first change degree of the exposure compensation.
[0217] In an optional embodiment, the first visual content includes a first image; the determination module 1002 is further configured to, for any first pixel in the first image, obtain a brightness of the first pixel based on pixel values of the first pixel in a plurality of color channels.
[0218] The determination module 1002 is further configured to obtain the first brightness of the first image based on the brightnesses of the plurality of first pixels in the first image.
[0219] In an optional embodiment, the second visual content includes a second image; the determination module 1002 is further configured to, for any second pixel in the second image, obtain a brightness of the second pixel based on pixel values of the second pixel in a plurality of color channels.
[0220] The determination module 1002 is further configured to obtain the second brightness of the second image based on the brightnesses of the plurality of second pixels in the second image.
[0221] In an optional embodiment, the first visual content includes a first video; the determination module 1002 is further configured to, for any first pixel in any first image in the first video, obtain a brightness of the first pixel based on pixel values of the first pixel in a plurality of color channels.
[0222] The determination module 1002 is further configured to obtain the brightness of the first image based on the brightnesses of the plurality of first pixels in the first image.
[0223] The determination module 1002 is further configured to obtain the brightness of the first video based on the brightnesses of the plurality of first images in the first video.
[0224] In an optional embodiment, the second visual content comprises a second video; the determining module 1002 is further configured to, for any second pixel in any second image in the second video, obtain a brightness of the second pixel based on pixel values of the second pixel in multiple color channels;
[0225] obtain the brightness of the second image based on the brightness of the multiple second pixels in the second image;
[0226] obtain the brightness of the second video based on the brightness of the multiple second images in the second video.
[0227] In an optional embodiment, the determining module 1002 is further configured to obtain a degree of exposure compensation change between the first visual content and the second visual content based on a ratio of the first brightness and the second brightness.
[0228] In an optional embodiment, the target camera parameter comprises a color temperature; the determining module 1002 is further configured to predict, based on the first visual content and the second visual content, a first color temperature difference value between the first visual content and the second visual content by using a color temperature difference value estimation network, the color temperature difference value estimation network being a neural network configured to predict a color temperature difference value between visual contents;
[0229] determine the first color temperature difference value as a first degree of change of the color temperature.
[0230] In an optional embodiment, the determining module 1002 is further configured to input the first visual content and the second visual content into the color temperature difference value estimation network;
[0231] In the color temperature difference value estimation network, perform a feature extraction operation on the first visual content to obtain first features; and perform a feature extraction operation on the second visual content to obtain second features;
[0232] perform a feature fusion operation based on the first features and the second features to obtain fused features;
[0233] predict the first color temperature difference value between the first visual content and the second visual content based on the fused features.
[0234] In an optional embodiment, the color temperature difference value estimation network is trained by the following steps:
[0235] obtain a first sample visual content, a second sample visual content, a first color temperature, and a second color temperature, the first sample visual content being visual content captured by using the first color temperature, and the second sample visual content being visual content captured by using the second color temperature;
[0236] calculate a difference value of the first color temperature and the second color temperature as a label color temperature difference value;
[0237] The color temperature difference value between the first sample visual content and the second sample visual content is predicted based on the first sample visual content and the second sample visual content by a color temperature difference value estimation network, to obtain a sample color temperature difference value.
[0238] The color temperature difference value estimation network is trained based on a gap between the label color temperature difference value and the sample color temperature difference value.
[0239] In an optional embodiment, the target camera parameter includes a zoom ratio, and the object verification is a human body verification; the determining module 1002 is further configured to perform face detection on the first visual content to obtain a first face frame, and perform face detection on the second visual content to obtain a second face frame.
[0240] The zoom ratio change degree between the first visual content and the second visual content is obtained based on a size ratio of the first face frame and the second face frame.
[0241] The zoom ratio change degree is determined as a first change degree of the zoom ratio.
[0242] In an optional embodiment, the determining module 1002 is further configured to determine a ratio of a diagonal line length of the first face frame to a diagonal line length of the second face frame as the zoom ratio change degree between the first visual content and the second visual content.
[0243] In an optional embodiment, the first visual content is used to represent all or part of visual content output by the first electronic device when the first electronic device is used to take a photograph by using the first value of the target camera parameter.
[0244] The second visual content is used to represent all or part of visual content output by the first electronic device when the first electronic device is used to take a photograph by using the second value of the target camera parameter.
[0245] In an optional embodiment, the first visual content is used to represent part of visual content output by the first electronic device when the first electronic device is used to take a photograph by using the first value of the target camera parameter, and the object verification is a human body verification; the obtaining module 1001 is further configured to obtain first photograph content, the first photograph content being used to represent all visual content output by the first electronic device when the first electronic device is used to take a photograph by using the first value of the target camera parameter.
[0246] The apparatus further includes an extracting module 1003, which is configured to extract a preset face region on the first photograph content to obtain the first visual content.
[0247] In an optional embodiment, the second visual content is used to represent a part of visual content output by the first electronic device when the target camera parameter is set to the second value; and the object verification is a verification of a human body.
[0248] The extraction module 1003 is further configured to extract a preset face region on the second shooting content to obtain the second visual content.
[0249] In an optional embodiment, the first visual content is used to represent visual content output by the first electronic device when the target camera parameter is set to the first value before the first electronic device receives the object verification request.
[0250] The second visual content is used to represent visual content output by the first electronic device when the target camera parameter is set to the second value in response to the object verification request.
[0251] The determination module 1002 is further configured to determine that the second visual content is the visual content used to perform the injection attack if the first change degree and the second change degree are inconsistent.
[0252] As described above, since the injection attack will replace the image output by the ISP, and the target camera parameter is the camera parameter used by the ISP or used by a device before the imaging process, by determining whether the camera parameter of the visual content is consistent with the specified camera parameter, it can be determined whether the visual content is replaced. If it is determined that the camera parameter value of the visual content is consistent with the camera parameter value of the specified camera parameter, it is considered that the visual content captured is not replaced, that is, no injection attack occurs. If it is determined that the camera parameter value of the visual content is inconsistent with the camera parameter value of the specified camera parameter, it is considered that the visual content captured is replaced, and there is a risk of injection attack.
[0253] In the present application, based on whether the change degree of the parameter value of the first visual content and the second visual content is consistent with the specified change degree of the parameter value, it is determined whether there is a risk of injection attack. By using the change degree of the parameter value as the verification target, the effect of identifying the injection attack based on the parameter value can also be achieved.
[0254] Also, a more fine-grained parameter value change degree is used as the verification target instead of simply using the parameter value as the verification target, which is beneficial to exclude the influence of possible noise in the first electronic device on the final judgment result, and further improves the accuracy of the judgment result. For example, there may be noise in the first electronic device that causes slight disturbance to the imaging process, and thus affects the camera parameters embodied by the final visual content. Therefore, if only the parameter value of the visual content is determined, it may be mistakenly considered that the disturbed visual content is the visual content used to perform the injection attack. However, if the parameter value change degree of the two visual contents is determined, the influence of the noise on the camera parameters will be eliminated after the parameter value change degree is determined.
[0255] FIG. 11 is a structural schematic diagram of a computer device according to an exemplary embodiment. The computer device includes the background server 220 in FIG. 2. The computer device 1100 includes a central processing unit (CPU) 1101, a system memory 1104 including a random access memory (RAM) 1102 and a read-only memory (ROM) 1103, and a system bus 1105 connecting the system memory 1104 and the central processing unit 1101. The computer device 1100 also includes a basic input / output system (I / O) 1106 that helps transfer information between various devices within the computer device, and a mass storage device 1107 for storing an operating system 1113, application programs 1114, and other program modules 1115.
[0256] The basic input / output system 1106 includes a display 1108 for displaying information and an input device 1109 such as a mouse, a keyboard, or the like for inputting information. The display 1108 and the input device 1109 are both connected to the central processing unit 1101 through an input / output controller 1110 connected to the system bus 1105. The basic input / output system 1106 can also include an input / output controller 1110 for receiving and processing input from a keyboard, a mouse, or an electronic stylus, and the like. Similarly, the input / output controller 1110 also provides output to a display screen, a printer, or other types of output devices.
[0257] The mass storage device 1107 is connected to the central processing unit 1101 through a mass storage controller (not shown) connected to the system bus 1105. The mass storage device 1107 and its associated computer device readable medium provide nonvolatile storage for the computer device 1100. That is, the mass storage device 1107 can comprise a computer device readable medium (not shown) such as a hard disk or a Compact Disc Read-Only Memory (CD-ROM) drive.
[0258] In general, the computer device readable medium can include computer device storage media and communication media. Computer device storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer device readable instructions, data structures, program modules or other data. Computer device storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), CD-ROM, Digital Video Disc (DVD) or other optical disk storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer device storage media described herein can be embodied in any computer device readable medium known in the art. The system memory 1104 and the mass storage device 1107 described above can collectively be referred to as a memory.
[0259] According to various embodiments of the present disclosure, the computer device 1100 can also operate in the networked environment using logical connections to one or more remote computer devices, such as a host computer device 1148. The computer device 1100 can connect to the network 1111 through a network interface unit 1112 connected to the system bus 1105. It should be appreciated that the network interface unit 1112 can also be utilized to connect the computer device 1100 to other types of networks and remote computer systems (not shown).
[0260] The memory also includes one or more programs stored therein, which one or more programs, when executed by the central processing unit 1101, carry out at least some of the steps of the method for identifying an injection attack.
[0261] The application further provides a computer readable storage medium, wherein at least one instruction, at least one program, a code set or an instruction set are stored in the storage medium, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by a processor to implement the injection attack identification method provided by the above method embodiments.
[0262] The application provides a computer program product or a computer program, which comprises computer instructions stored in a computer readable storage medium. A processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the injection attack identification method provided by the above method embodiments.
[0263] The above sequence numbers of the embodiments of the application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0264] Those skilled in the art can understand that all or part of the steps of the above embodiments can be completed by hardware, or can be completed by programs instructing relevant hardware, and the programs can be stored in a computer readable storage medium. The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk.
[0265] The above is only optional embodiments of the application, and does not limit the application. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the application shall be included in the protection scope of the application.
Claims
1. A method of identifying an injection attack, characterized in that, The method comprises: In the process of performing object verification, first visual content and second visual content are obtained, the first visual content is used to represent visual content output by the first electronic device when the first electronic device is used to take a picture with a first value of a target camera parameter, and the second visual content is used to represent visual content output by the first electronic device when the first electronic device is used to take a picture with a second value of the target camera parameter; Based on the first visual content and the second visual content, a variation degree of the first visual content and the second visual content in the value of the target camera parameter is determined to obtain a first variation degree; A variation degree between the first value and the second value is obtained to obtain a second variation degree; If the first variation degree and the second variation degree are inconsistent, it is determined that at least one of the first visual content and the second visual content is visual content used to perform an injection attack.
2. The method of claim 1, wherein, The target camera parameter comprises exposure compensation; The method comprises: Based on the color of the first visual content, a first brightness of the first visual content is estimated, and based on the color of the second visual content, a second brightness of the second visual content is estimated; Based on the first brightness and the second brightness, a variation degree of exposure compensation between the first visual content and the second visual content is calculated; The variation degree of exposure compensation is determined as the first variation degree of the exposure compensation.
3. The method of claim 2, wherein, The first visual content comprises a first image; The method comprises: For any first pixel in the first image, a brightness of the first pixel is obtained based on pixel values of the first pixel in multiple color channels; Based on the brightness of multiple first pixels in the first image, a first brightness of the first image is obtained.
4. The method of claim 2, wherein, The second visual content comprises a second image; The method comprises: For any second pixel in the second image, a brightness of the second pixel is obtained based on pixel values of the second pixel in multiple color channels; Based on the brightness of multiple second pixels in the second image, a second brightness of the second image is obtained.
5. The method of claim 2, wherein, The first visual content comprises a first video; The method comprises: For any first pixel in any first image in the first video, a brightness of the first pixel is obtained based on pixel values of the first pixel in multiple color channels; Based on the brightness of multiple first pixels in the first image, a brightness of the first image is obtained; Based on the brightness of multiple first images in the first video, a brightness of the first video is obtained.
6. The method of claim 2, wherein, The second visual content comprises a second video; The method comprises: For any second pixel in any second image in the second video, based on pixel values of the second pixel in multiple color channels, obtaining a brightness of the second pixel; based on the brightness of multiple second pixels in the second image, obtaining the brightness of the second image; based on the brightness of multiple second images in the second video, obtaining the brightness of the second video.
7. The method according to any one of claims 2 to 6, characterized in that, The first brightness and the second brightness, the exposure compensation change degree between the first visual content and the second visual content is calculated, including: Based on the ratio of the first brightness and the second brightness, the exposure compensation change degree between the first visual content and the second visual content is obtained.
8. The method according to any one of claims 1 to 7, characterized in that, The target camera parameter includes color temperature; Based on the first visual content and the second visual content, the change degree of the first visual content and the second visual content in the value of the target camera parameter is determined, and the first change degree is obtained, including: Based on the first visual content and the second visual content, the color temperature difference value between the first visual content and the second visual content is predicted through a color temperature difference value estimation network, and a first color temperature difference value is obtained, the color temperature difference value estimation network is a neural network for predicting the color temperature difference value between visual contents; The first color temperature difference value is determined as the first change degree of the color temperature.
9. The method of claim 8, wherein, Based on the first visual content and the second visual content, the color temperature difference value between the first visual content and the second visual content is predicted through a color temperature difference value estimation network, and a first color temperature difference value is obtained, including: The first visual content and the second visual content are input into the color temperature difference value estimation network; In the color temperature difference value estimation network, the feature extraction operation is performed on the first visual content to obtain the first feature, and the feature extraction operation is performed on the second visual content to obtain the second feature; Based on the first feature and the second feature, a feature fusion operation is performed to obtain a fusion feature; Based on the fusion feature, the first color temperature difference value between the first visual content and the second visual content is predicted.
10. The method according to claim 8 or 9, characterized in that, The color temperature difference value estimation network is obtained by the following steps: Obtain first sample visual content, second sample visual content, first color temperature and second color temperature, the first sample visual content is the visual content shot by the first color temperature, and the second sample visual content is the visual content shot by the second color temperature; The difference between the first color temperature and the second color temperature is calculated as a label color temperature difference value; Based on the first sample visual content and the second sample visual content, the color temperature difference value between the first sample visual content and the second sample visual content is predicted through the color temperature difference value estimation network, and a sample color temperature difference value is obtained; Based on the difference between the label color temperature difference value and the sample color temperature difference value, the color temperature difference value estimation network is trained.
11. The method according to any one of claims 1 to 10, characterized in that, The target camera parameter includes zoom ratio, and the object verification is the verification of human body; The determining, based on the first visual content and the second visual content, a variation degree of the first visual content and the second visual content in the value of the target camera parameter, to obtain a first variation degree, comprises: performing face detection on the first visual content to obtain a first face frame, and performing face detection on the second visual content to obtain a second face frame; obtaining a scaling ratio variation degree between the first visual content and the second visual content based on the size ratio of the first face frame and the second face frame; determining the scaling ratio variation degree as the first variation degree of the scaling ratio.
12. The method of claim 11, wherein, The obtaining, based on the size ratio of the first face frame and the second face frame, a scaling ratio variation degree between the first visual content and the second visual content, comprises: determining a ratio of a diagonal length of the first face frame to a diagonal length of the second face frame as the scaling ratio variation degree between the first visual content and the second visual content.
13. The method of any of claims 1-12, wherein: the first visual content is used to represent all or part of visual content output by the first electronic device when the first electronic device is used to take a photograph using a first value of the target camera parameter; the second visual content is used to represent all or part of visual content output by the first electronic device when the first electronic device is used to take a photograph using a second value of the target camera parameter.
14. The method of claim 13, wherein, the first visual content is used to represent part of visual content output by the first electronic device when the first electronic device is used to take a photograph using a first value of the target camera parameter, and the object verification is a verification of a human body; the method further comprises: obtaining first photograph content, the first photograph content being used to represent all of the visual content output by the first electronic device when the first electronic device is used to take a photograph using the first value of the target camera parameter; extracting a preset face region on the first photograph content to obtain the first visual content.
15. The method of claim 13, wherein, the second visual content is used to represent part of visual content output by the first electronic device when the first electronic device is used to take a photograph using a second value of the target camera parameter, and the object verification is a verification of a human body; the method further comprises: obtaining second photograph content, the second photograph content being used to represent all of the visual content output by the first electronic device when the first electronic device is used to take a photograph using the second value of the target camera parameter; extracting a preset face region on the second photograph content to obtain the second visual content.
16. The method according to any one of claims 1 to 15, characterized in that, the first visual content is used to represent visual content output by the first electronic device before the first electronic device receives an object verification request, when the first electronic device is used to take a photograph using a first value of the target camera parameter; the second visual content is used to represent visual content output by the first electronic device in response to the object verification request, when the first electronic device is used to take a photograph using a second value of the target camera parameter; the determining, if the first variation degree and the second variation degree are inconsistent, that at least one of the first visual content and the second visual content is visual content used to perform an injection attack, comprises: the determining, if the first variation degree and the second variation degree are inconsistent, that the second visual content is visual content used to perform an injection attack.
17. An apparatus for identifying an injection attack, characterized in that The device comprises: an acquisition module, configured to acquire first visual content and second visual content in a process of performing object verification, the first visual content being used to represent visual content output by a first electronic device when the first electronic device is used to take a picture with a first value of target camera parameters, and the second visual content being used to represent visual content output by the first electronic device when the first electronic device is used to take a picture with a second value of the target camera parameters; a determination module, configured to determine a variation degree of the first visual content and the second visual content with respect to the value of the target camera parameters based on the first visual content and the second visual content, and obtain a first variation degree; the acquisition module is further configured to acquire a variation degree between the first value and the second value, and obtain a second variation degree; the determination module is further configured to determine that at least one of the first visual content and the second visual content is visual content used to perform an injection attack if the first variation degree is inconsistent with the second variation degree.
18. A computer device, comprising: The computer device comprises a processor and a memory, and the memory stores a computer program, which is loaded and executed by the processor to implement the injection attack identification method according to any one of claims 1 to 16.
19. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, which is loaded and executed by the processor to implement the injection attack identification method according to any one of claims 1 to 16.
20. A computer program product, characterised in that, The computer program product stores a computer program, which is loaded and executed by the processor to implement the injection attack identification method according to any one of claims 1 to 16.
Citation Information
Patent Citations
Bio-assay method and apparatus, electronic equipment, and storage medium
CN108764091A
Living body detection method and device and face recognition equipment
CN111460970A
Injection attack identification method and device for in-vivo detection
CN113850214A
Face living body detection method, face recognition method, face living body detection device, face recognition device and electronic equipment
CN117315759A
Physical camera provenance scoring system
US20240290079A1