Biometric attack detection method and apparatus
By extracting and processing the video frame difference characteristics of the lighted frame and unfilled frames in biological videos, and inputting a pre-trained biological attack detection model, the problem of difficult interception of injection-like attacks bypassing the camera is solved, and the accuracy and security of biological attack detection are improved.
Patent Information
- Application Number
- PCT/CN2024/126717
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-11-30
- Filing Date
- 2024-10-23
- Publication Date
- 2025-06-05
AI Technical Summary
The prior art is difficult to effectively intercept injection-like attacks that bypass cameras, resulting in a high security risk for biometric systems.
By obtaining biological videos collected under preset lighting mode, extracting light-filled frames and unlit frames, calculating the video frame difference characteristics, and performing feature fusion processing, inputting a pre-trained biological attack detection model to obtain detection results.
It improves the accuracy of biological attack detection, can more effectively identify biological images and attack images that bypass the camera, thereby intercepting attack images and reducing the security risks of biometric systems.
Smart Images

Figure CN2024126717_05062025_PF_FP_ABST
Abstract
Description
A biological attack detection method and device Technical Field
[0001] This article relates to the field of attack detection technology, and in particular to a biological attack detection method and device. Background Art
[0002] With the development of biometric technology and people's increasing attention to their private data, liveness attack detection has become an indispensable process in biometric systems. Liveness attack detection can effectively intercept non-live attack samples (such as screens, paper, masks, etc.). At the same time, as the types of liveness attacks continue to increase, injection attacks that bypass cameras have gradually emerged. These injection attacks have extremely high attack success rates and pose a high risk to biometric systems. Therefore, it is necessary to provide a biometric attack detection method and device to effectively intercept injection attacks that bypass cameras.
[0003] Summary of the Invention
[0004] One or more embodiments of the present specification provide a biological attack detection method, including: obtaining a biological video for biological attack detection captured under a preset lighting method, extracting multiple illuminated frames and unilluminated frames corresponding to each of the illuminated frames from the obtained biological video; respectively calculating video frame difference features between each of the illuminated frames and the corresponding unilluminated frame; performing feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features; and inputting the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result, wherein the biological attack detection model is a model trained based on biological images, non-biological images, and a preset loss function.
[0005] One or more embodiments of the present specification provide a biological attack detection device, comprising: a lighting frame extraction module, which obtains a biological video captured under a preset lighting method for biological attack detection, and extracts multiple lighting frames and unlit frames corresponding to each of the lighting frames from the obtained biological video; a video frame difference feature calculation module, which respectively calculates the video frame difference features of each of the lighting frames and the corresponding unlit frame; a multi-feature fusion module, which performs feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features; and a classification module, which inputs the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result, wherein the biological attack detection model is a model trained based on biological images, non-biological images, and a preset loss function.
[0006] One or more embodiments of the present specification provide an electronic device, comprising: a processor; and a memory arranged to store computer-executable instructions, wherein when the executable instructions are executed, the processor is enabled to: obtain a biological video for biological attack detection captured under a preset lighting method, extract multiple illuminated frames and unilluminated frames corresponding to each of the illuminated frames from the obtained biological video; respectively calculate video frame difference features between each of the illuminated frames and the corresponding unilluminated frames; perform feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features; input the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result, wherein the biological attack detection model is a model trained based on biological images, non-biological images, and a preset loss function.
[0007] One or more embodiments of the present specification provide a storage medium for storing a computer program, which can be executed by a processor to implement the following process: obtaining a biological video for biological attack detection captured under a preset lighting method, extracting multiple illuminated frames and unilluminated frames corresponding to each of the illuminated frames from the obtained biological video; respectively calculating the video frame difference features of each of the illuminated frames and the corresponding unilluminated frame; performing feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features; inputting the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result, wherein the biological attack detection model is a model trained based on biological images, non-biological images, and a preset loss function. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] In order to more clearly illustrate the technical solutions in one or more embodiments of this specification, the following briefly introduces the drawings required for use in the embodiments or descriptions of the prior art. Obviously, the drawings described below are only some embodiments recorded in one or more embodiments of this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0009] FIG1 is a schematic flow chart of a biological attack detection method according to an embodiment of the present specification.
[0010] FIG2 is a schematic flow chart of a biological attack detection method according to another embodiment of this specification.
[0011] FIG3 is a schematic diagram showing the implementation principle of the color histogram analysis process in the embodiment of this specification.
[0012] FIG4 is a schematic diagram showing the implementation principle of biological attack detection using a single-frame difference image in an embodiment of this specification.
[0013] FIG5 is a schematic diagram illustrating the implementation principle of a biological attack detection method according to an embodiment of the present specification.
[0014] FIG6 is a schematic block diagram of a biological attack detection device according to another embodiment of this specification.
[0015] FIG7 is a schematic block diagram of an electronic device according to an embodiment of this specification. DETAILED DESCRIPTION
[0016] One or more embodiments of this specification provide a biological attack detection method and apparatus.
[0017] In order to enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of this document.
[0018] As shown in FIG1 , an embodiment of this specification provides a method for detecting biological attacks. The method can be performed by a terminal device or a server. The terminal device can be a certain terminal device such as a mobile phone or tablet computer, or a computer device such as a laptop or desktop computer, or an IoT device (specifically, a smartwatch, an in-vehicle device, etc.). The server can be a standalone server or a server cluster composed of multiple servers. The server can be a backend server for a financial service or online shopping service, or a backend server for an application. This embodiment uses a server as an example for detailed description. The execution process of the terminal device can be referred to the relevant content below and will not be repeated here. The method can specifically include steps S102 to S108.
[0019] In step S102, a biological video for biological attack detection captured under a preset lighting mode is obtained, and a plurality of illuminated frames and a non-illuminated frame corresponding to each illuminated frame are extracted from the obtained biological video.
[0020] Biometric attack detection is commonly used in various biometric security systems, such as biometric systems, wired payment systems, and network security systems. It determines whether a current action is an attack by detecting the corresponding biological video. Among them, colorful liveness attack detection is a relatively effective type of biometric attack detection. Taking biometrics as an example, this attack detection method includes a colorful interaction process in the biometric system. This method first captures a video of the user's illuminated area through methods such as screen lighting. The captured video then distinguishes between real biological images and attack-like images during the biometric recognition process.
[0021] The multiple lighting frames in the embodiments of this specification may be multiple lighting images extracted from images contained in a biological video. The multiple images may include multiple lighting key frames in the biological video, or multiple lighting non-key frames in the biological video. A key frame refers to an image frame in which a key action in the motion change of a character or object is located. The key frame is equivalent to the original painting in a two-dimensional animation. If the above-mentioned multiple images are multiple lighting key frames in a biological video, the multiple lighting frames extracted in step S102 refer to lighting key frames extracted from the key frames of the biological video. Similarly, the unlit frames in the embodiments of this specification may be multiple unlit images extracted from images contained in a biological video. The multiple images may include multiple unlit key frames in the biological video, or multiple unlit non-key frames in the biological video.
[0022] In order to achieve biological attack detection, the embodiments of this specification require extracting illuminated frames and unilluminated frames from biological videos. A illuminated frame is an image in which the illumination information of the illuminated image of the acquired biological video is greater than a preset threshold (e.g., the illuminance is greater than a preset illuminance threshold, or the luminous flux is greater than a preset luminous flux threshold, etc.). An unilluminated frame is an image in which there is no illumination information or the illumination information is less than a preset threshold in the acquired biological video. Each illuminated frame is matched with an unilluminated frame to facilitate subsequent image comparison. The matching method of the illuminated and unilluminated frames can be based on the color characteristics of each frame in the biological video, or can be based on a preset matching method in combination with user needs.
[0023] Methods for extracting lighting frames from biological videos can be based on sampling, i.e., extracting lighting frames by setting a reasonable sampling distance. Alternatively, methods can be based on clustering, where all video frames are clustered using an initial cluster center, and the video frame closest to each cluster center is used as the lighting frame. Alternatively, methods can be based on image features, such as color features, texture features, local features, and lighting information, to calculate the similarity between video frames. Similarly, methods can be used to deduplicate similar frames extracted by setting a threshold, thereby generating a set of lighting frames.
[0024] The preset lighting mode may be a screen lighting mode, or a lighting mode using other light sources other than screen lighting, such as a fill light.
[0025] In step S104 , video frame difference features between each illuminated frame and the corresponding unilluminated frame are calculated.
[0026] Video frame difference features are discriminant features used for biometric attack detection, extracted from captured biometric videos by extracting keyframes and calculating difference features. The specific video frame difference features required for practical applications depend on the specific biometric attack detection scenario. For example, in a biometric recognition system, the video frame difference features required are primarily used to mask out color features outside the illuminated area of the target area.
[0027] In practice, the method for calculating the video frame difference feature can be to calculate based on the similarity of pixels between the lit frame and the corresponding unlit frame. Alternatively, the video frame difference feature can be determined by directly comparing the lit frame with the corresponding unlit frame.
[0028] In step S106 , a plurality of video frame difference features are subjected to feature fusion processing to obtain fused video frame difference features.
[0029] The method of fusing multiple video frame difference features can be to directly add each video frame difference feature to obtain a more robust fused video frame difference feature; or, according to the specific biological attack detection requirements, different video frame difference features can be given corresponding weights and then added to obtain a fused video frame difference feature; or, multiple video frame difference features can be fused according to a preset algorithm, which is not limited in the embodiments of this specification.
[0030] In step S108, the fused video frame difference features are input into a pre-trained biological attack detection model to obtain a biological attack detection result.
[0031] The biological attack detection model described above is trained using biological and non-biological images using a pre-set loss function. Biological images can be real images of a specific part of an organism. Non-biological images can be images captured by a mobile phone, images presented on paper, or photographs of organisms.
[0032] This biological attack detection model is a classification model and can be a binary classification module built on a neural network. The corresponding biological attack detection results can include two types: biological images and attack images. If the biological attack detection result shows a biological image, it indicates that the behavior corresponding to the current biological video is not an attack. If the biological attack detection result shows an attack image, it indicates that the behavior corresponding to the current biological video is an attack. The preset loss function can be a loss function of the classification model, such as the cross-entropy loss function.
[0033] In implementation, the attacking image may be one or more of an image presenting a creature through an electronic screen, an image presenting a creature through paper, an image presenting a creature through a mask, and an image containing a photo of a creature.
[0034] This specification provides an example of a biological attack detection method. First, a biological video captured under a preset lighting mode for biological attack detection is obtained. Multiple illuminated frames and unilluminated frames corresponding to each illuminated frame are extracted from the acquired biological video. Next, video frame difference features are calculated for each illuminated frame and the corresponding unilluminated frame. The multiple video frame difference features are then subjected to feature fusion processing to obtain fused video frame difference features. Finally, the fused video frame difference features are input into a pre-trained biological attack detection model to obtain a biological attack detection result. The biological attack detection model is trained based on biological images, non-biological images, and a preset loss function. By extracting illuminated and unilluminated frames from the biological video instead of directly capturing images, more lighting information is extracted, thereby improving the contrast effect of the video frame difference features. Furthermore, the inter-frame information in the biological video can be more fully utilized to assist in the biological video detection task. By calculating the difference features between illuminated and unilluminated frames, the difference features can be used to amplify the lighting color features and the feature differences between biological and attack images. This allows the biological attack detection model to better identify biological images and attack images that bypass the camera, effectively intercepting attack images and improving the accuracy of biological attack detection results. By fusing multiple video frame difference features, a multi-layer feature fusion mechanism can provide the biological attack detection model with more separable and robust features, improve the expressiveness of features, and thus enhance the accuracy of biological attack detection results.
[0035] Furthermore, the extraction of multiple illuminated frames from the acquired biological video in the above step S102 and the processing of the unilluminated frames corresponding to each illuminated frame can be varied. An optional processing method is provided below. For details, please refer to the processing of the following steps S1022-S1026.
[0036] In step S1022 , a color histogram analysis is performed on the biological video to obtain color features of each frame of the biological video.
[0037] Color histogram analysis involves statistically analyzing the proportions of different colors within an entire image, thereby extracting the color characteristics of the entire image. In practice, a color histogram algorithm module can be used to perform color histogram analysis on biological videos. The input information of this color histogram algorithm module is biological videos with time series information, and the output is the lighting frame.
[0038] A schematic diagram of the implementation principle of color histogram analysis processing can be seen in Figure 3. The left side of Figure 3 shows the color histogram analysis results of biological images, and the right side shows the histogram analysis results of attack images. As can be seen from the color histogram analysis results of different images in Figure 3, since the biological videos in the embodiments of this specification are videos captured under a preset lighting method, the use of color histograms can effectively display the color differences between illuminated frames and unilluminated frames, thereby more effectively extracting images with sufficient lighting information (i.e., illuminated frames) in the biological videos, which is conducive to improving the accuracy and efficiency of image extraction.
[0039] In step S1024 , a plurality of lighting frames are extracted according to the color features of each frame image in the biological video.
[0040] Based on the color histogram analysis and processing results, images with lighting information greater than a preset threshold are extracted as lighting frames. For example, from 20 frames of images, 6 lighting frames can be extracted.
[0041] In step S1026 , an unlit frame corresponding to each lit frame is determined based on each lit frame and the color features of each frame in the biological video.
[0042] The unlit frame may be an image without any lighting information or with lighting information less than a preset threshold.
[0043] The schematic diagram of the implementation principle of the single-frame difference image biological attack detection in the embodiment of this specification can be seen in Figure 4, and the schematic diagram of the implementation principle of the biological attack detection method can be seen in Figure 5.
[0044] Furthermore, the lighting mode preset in step S102 can be a lighting mode with random colors, a lighting mode with random positions, or a lighting mode with random colors and positions. Specifically, the lighting mode with random colors means that the types of lighting colors and the order of lighting colors can be randomly selected. The lighting mode with random positions means that randomness is added to the order of lighting images. Taking Figure 5 as an example, 1-5 frames of images can be illuminated, 6-10 frames of images can be not illuminated, and 11-15 frames of images can be illuminated. It is also possible to illuminate 1-3 frames of images, not illuminate 4-6 frames of images, and so on, and other random lighting orders can be set. By introducing lighting modes with random colors and / or random positions, the effectiveness and reliability of interactive biological attack detection can be further increased.
[0045] Furthermore, the processing of calculating the video frame difference feature between each illuminated frame and the corresponding unilluminated frame in the above step S104 can be varied. An optional processing method is provided below. For details, please refer to the processing of the following steps S1042-S1044.
[0046] In step S1042 , a plurality of pixels of each illuminated frame and the corresponding unilluminated frame are determined, and a similarity value of each pixel is calculated.
[0047] In step S1044 , a video frame difference feature between each illuminated frame and the corresponding unilluminated frame is determined based on the similarity values of the plurality of pixels.
[0048] In implementation, the corresponding pixel points of each illuminated frame and the unilluminated frame can be subtracted to calculate the similarity value of each pixel point, and then the average value of the similarity values of multiple pixel points can be calculated to calculate the video frame difference feature of each illuminated frame and the corresponding unilluminated frame.
[0049] Based on the similarity value of the pixel points, the image difference comparison is performed between the illuminated frame and the corresponding unilluminated frame, making the comparison result more reliable and accurate.
[0050] Furthermore, as shown in FIG. 2 , after step S104 in the embodiment of this specification, step S110 may be further included: performing color amplification processing on each calculated video frame difference feature to obtain a color-amplified video frame difference feature.
[0051] In practice, a pre-trained color amplification model can be used. Specifically, the image corresponding to each video frame difference feature is input into the color amplification model to obtain a color-amplified image of the video frame difference feature. During model training, the input data for the color amplification model is image samples of various colors. Through processing by the neural network structure of the color amplification model, the output result is an image of the corresponding color with a preset contrast difference value.
[0052] By performing color amplification processing on each video frame difference feature, the difference in features between video frame differences can be further improved, thereby improving the accuracy of the classification results of the biological attack detection model.
[0053] Corresponding to step S110 , the processing of step S106 can be varied. An optional processing method is provided below. For details, please refer to the processing of the following step S1062 .
[0054] In step S1062 , a feature fusion process is performed on the multiple color-amplified video frame difference features to obtain a fused video frame difference feature.
[0055] Furthermore, the biological video in step S102 is a biological video with timing information and inter-frame information.
[0056] Since the biological video in the embodiments of this specification carries timing information and inter-frame information, when performing biological attack detection, when there is a color change, frame difference processing can be performed on the images before and after the color change based on the inter-frame information, thereby obtaining video frame difference features containing certain timing information, which is conducive to further improving the accuracy and reliability of biological attack detection.
[0057] Accordingly, step S108 can be executed as follows: inputting the timing information and inter-frame information in the biological video, as well as the fused video frame difference features, into a pre-trained biological attack detection model to obtain a biological attack detection result.
[0058] In implementation, the timing information and inter-frame information in biological videos can be used as labels. By adding timing information and inter-frame information to the biological attack detection model, the accuracy of model training can be further improved, thereby improving the accuracy of biological attack detection results.
[0059] This specification provides an example of a biological attack detection method. First, a biological video captured under a preset lighting mode for biological attack detection is obtained. Multiple illuminated frames and unilluminated frames corresponding to each illuminated frame are extracted from the acquired biological video. Next, video frame difference features are calculated for each illuminated frame and the corresponding unilluminated frame. The multiple video frame difference features are then subjected to feature fusion processing to obtain fused video frame difference features. Finally, the fused video frame difference features are input into a pre-trained biological attack detection model to obtain a biological attack detection result. The biological attack detection model is trained based on biological images, non-biological images, and a preset loss function. By extracting illuminated and unilluminated frames from the biological video instead of directly capturing images, more lighting information is extracted, thereby improving the contrast effect of the video frame difference features. Furthermore, the inter-frame information in the biological video can be more fully utilized to assist in the biological video detection task. By calculating the difference features between illuminated and unilluminated frames, the difference features can be used to amplify the lighting color features and the feature differences between biological and attack images. This allows the biological attack detection model to better identify biological images and attack images that bypass the camera, effectively intercepting attack images and improving the accuracy of biological attack detection results. By fusing multiple video frame difference features, a multi-layer feature fusion mechanism can provide the biological attack detection model with more separable and robust features, improve the expressiveness of features, and thus enhance the accuracy of biological attack detection results.
[0060] In summary, specific embodiments of the present subject matter have been described. Other embodiments are within the scope of the appended claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing may be advantageous.
[0061] The above is a biological attack detection method provided in one or more embodiments of this specification. Based on the same idea, one or more embodiments of this specification also provide a biological attack detection device, as shown in Figure 6.
[0062] The biological attack detection device includes: a lighting frame extraction module 210, a video frame difference feature calculation module 220, a multi-feature fusion module 230 and a classification module 240, wherein: the lighting frame extraction module 210 obtains a biological video for biological attack detection collected under a preset lighting method, and extracts multiple lighting frames and unlit frames corresponding to each lighting frame from the acquired biological video; the video frame difference feature calculation module 220 respectively calculates the video frame difference features of each lighting frame and the corresponding unlit frame; the multi-feature fusion module 230 performs feature fusion processing on multiple video frame difference features to obtain fused video frame difference features; the classification module 240 inputs the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result. The biological attack detection model is a model trained based on biological images, non-biological images and a preset loss function.
[0063] Furthermore, the lighting modes preset in the lighting frame extraction module 210 include: a lighting mode with random colors and / or a lighting mode with random positions.
[0064] Furthermore, the video frame difference feature calculation module 220 includes: a pixel point similarity value calculation unit, which determines multiple pixel points of each illuminated frame and the corresponding unilluminated frame, and calculates the similarity value of each pixel point; a video frame difference feature determination unit, which determines the video frame difference feature of each illuminated frame and the corresponding unilluminated frame based on the similarity values of multiple pixel points.
[0065] Furthermore, the lighting frame extraction module 210 includes: a video acquisition unit, which acquires a biological video collected under a preset lighting mode for biological attack detection; a color histogram analysis unit, which performs color histogram analysis on the biological video to obtain the color features of each frame image in the biological video; a lighting frame extraction unit, which extracts multiple lighting frames based on the color features of each frame image in the biological video; and an unlighted frame determination unit, which determines the unlighted frame corresponding to each lighting frame based on the color features of each lighting frame and each frame image in the biological video.
[0066] Furthermore, the biological attack detection result obtained by the classification module 240 includes attack-type images, which include: one or more images of biological beings presented through electronic screens, images of biological beings presented through paper, images of biological beings presented through masks, and images containing photos of biological beings.
[0067] Furthermore, the biological attack detection model is a binary classification model built based on a neural network.
[0068] Furthermore, the biological attack detection device also includes a color amplification processing module that performs color amplification processing on each calculated video frame difference feature to obtain a color-amplified video frame difference feature. Accordingly, the multi-feature fusion module 230 performs feature fusion processing on the multiple color-amplified video frame difference features to obtain a fused video frame difference feature.
[0069] The biological video obtained by the lighting frame extraction module 210 is a biological video with timing information and inter-frame information. Accordingly, the classification module 240 inputs the timing information and inter-frame information in the biological video, as well as the fused video frame difference features, into the pre-trained biological attack detection model to obtain the biological attack detection results.
[0070] This specification provides a biological attack detection device. First, a lighting frame extraction module acquires a biological video captured under a preset lighting mode for biological attack detection. Multiple lighting frames and corresponding unlit frames are extracted from the acquired biological video. A video frame difference feature calculation module calculates video frame difference features between each lighting frame and its corresponding unlit frame. A multi-feature fusion module then fuses the multiple video frame difference features to obtain fused video frame difference features. Finally, a classification module inputs the fused video frame difference features into a pre-trained biological attack detection model to obtain biological attack detection results. The biological attack detection model is trained based on biological images, non-biological images, and a preset loss function. Extracting lighting and unlit frames from the biological video, rather than directly acquiring images, facilitates extracting more lighting information, thereby improving the contrast of the video frame difference features and enabling more effective use of inter-frame information in the biological video to assist in biological video detection tasks. By calculating the difference features between illuminated and unilluminated frames, the difference features can be used to amplify the lighting color features and the feature differences between biological and attack images. This allows the biological attack detection model to better identify biological images and attack images that bypass the camera, effectively intercepting attack images and improving the accuracy of biological attack detection results. By fusing multiple video frame difference features, a multi-layer feature fusion mechanism can provide the biological attack detection model with more separable and robust features, improve the expressiveness of features, and thus enhance the accuracy of biological attack detection results.
[0071] Those skilled in the art will appreciate that the biological attack detection device can be used to implement the biological attack detection method described above, and the detailed description thereof is similar to that described in the method section above. To avoid redundancy, such description is omitted here.
[0072] Based on the same idea, one or more embodiments of this specification also provide an electronic device, as shown in Figure 7. Electronic devices may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, and the memory 302 may store one or more storage applications or data. Among them, the memory 302 can be a temporary storage or a persistent storage. The application stored in the memory 302 may include one or more modules (not shown in the figure), and each module may include a series of computer executable instructions in the electronic device. Furthermore, the processor 301 can be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the electronic device. The electronic device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more input and output interfaces 305, and one or more keyboards 306.
[0073] Specifically in this embodiment, the electronic device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the electronic device, and is configured to be executed by one or more processors. The one or more programs include the following computer-executable instructions: obtaining a biological video for biological attack detection collected under a preset lighting mode, extracting multiple illuminated frames and unilluminated frames corresponding to each illuminated frame from the acquired biological video; respectively calculating the video frame difference features of each illuminated frame and the corresponding unilluminated frame; performing feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features; inputting the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result, wherein the biological attack detection model is a model trained based on biological images, non-biological images and a preset loss function.
[0074] One or more embodiments of the present specification provide a storage medium for storing computer-executable instructions, which implement the following process when executed by a processor: obtaining a biological video for biological attack detection captured under a preset lighting method, extracting multiple illuminated frames and unilluminated frames corresponding to each illuminated frame from the obtained biological video; respectively calculating video frame difference features between each illuminated frame and the corresponding unilluminated frame; performing feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features; inputting the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result, where the biological attack detection model is a model trained based on biological images, non-biological images, and a preset loss function.
[0075] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0076] In the 1990s, technological improvements could be clearly distinguished as either hardware improvements (for example, improvements to circuit structures such as diodes, transistors, and switches) or software improvements (improvements to process flows). However, with the advancement of technology, many process flow improvements today can now be considered direct improvements to hardware circuit structures. Designers almost always create the corresponding hardware circuit structure by programming the improved process flow into the hardware circuit. Therefore, it cannot be said that a process flow improvement cannot be implemented using hardware modules. For example, a programmable logic device (PLD), such as a field programmable gate array (FPGA), is an integrated circuit whose logical function is determined by user programming. Designers can "integrate" a digital system on a PLD by programming it themselves, without having to hire a chip manufacturer to design and manufacture a dedicated integrated circuit chip. Moreover, nowadays, instead of manually fabricating integrated circuit chips, this programming is mostly done using "logic compiler" software. This is similar to the software compiler used when developing programs. Before compilation, the original code must also be written in a specific programming language, called a hardware description language (HDL). There is not just one HDL, but many, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, RHDL (Ruby Hardware Description Language), etc. The most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art will also understand that by simply programming the method flow in one of these hardware description languages and then programming it into an integrated circuit, a hardware circuit that implements the logic method flow can be easily obtained.
[0077] The controller can be implemented in any suitable manner. For example, the controller can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320. The memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also know that in addition to implementing the controller in a purely computer-readable program code format, the controller can be implemented in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers by logically programming the method steps. Therefore, such a controller can be considered a hardware component, and the devices included therein for implementing various functions can also be considered as structures within the hardware component. Or even, the devices for implementing various functions can be considered as both software modules that implement the method and structures within the hardware component.
[0078] The systems, devices, modules, or units described in the above embodiments may be implemented by computer chips or entities, or by products having certain functions. A typical implementation device is a computer. Specifically, the computer may be, for example, a personal computer, a laptop computer, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
[0079] For the convenience of description, the above devices are described as being divided into various units according to their functions. Of course, when implementing one or more embodiments of this specification, the functions of each unit can be implemented in the same or multiple software and / or hardware.
[0080] It will be understood by those skilled in the art that one or more embodiments of this specification may be provided as a method, system, or computer program product. Thus, one or more embodiments of this specification may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0081] One or more embodiments of this specification are described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of this specification. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0082] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0083] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0084] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0085] Memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
[0086] Computer-readable media includes permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0087] It should also be noted that the terms "comprises," "includes," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, commodity, or apparatus that includes a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, commodity, or apparatus. In the absence of further limitations, an element defined by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, commodity, or apparatus that includes the element.
[0088] One or more embodiments of this specification may be described in the general context of computer-executable instructions, such as program modules, executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. This specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communications network. In distributed computing environments, program modules may be located in local and remote computer storage media, including storage devices.
[0089] The various embodiments in this specification are described in a progressive manner. Similar parts between the various embodiments can be referred to in conjunction with each other. Each embodiment focuses on the differences between the other embodiments. In particular, the system embodiments are generally similar to the method embodiments, so the description is relatively simple. For relevant parts, refer to the description of the method embodiments.
[0090] The foregoing is merely one or more embodiments of this specification and is not intended to limit this application. It will be apparent to those skilled in the art that various modifications and variations may be made to one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included within the scope of the claims of one or more embodiments of this specification.
Claims
1. A biological attack detection method, comprising: Acquire a biological video for biological attack detection collected under a preset lighting mode, and extract a plurality of illuminated frames and an unilluminated frame corresponding to each of the illuminated frames from the acquired biological video; Calculating the video frame difference features of each of the illuminated frames and the corresponding unilluminated frames respectively; Perform feature fusion processing on multiple video frame difference features to obtain fused video frame difference features; The fused video frame difference features are input into a pre-trained biological attack detection model to obtain a biological attack detection result. The biological attack detection model is a model trained based on biological images, non-biological images and a preset loss function.
2. The method according to claim 1, wherein: The step of extracting a plurality of lighted frames and a non-lighted frame corresponding to each of the lighted frames from the acquired biological video comprises: Performing color histogram analysis on the biological video to obtain color features of each frame of the biological video; Extracting multiple lighting frames according to the color features of each frame of the biological video; According to each of the illuminated frames and the color features of each frame of the image in the biological video, an unilluminated frame corresponding to each of the illuminated frames is determined.
3. The method according to claim 1, wherein: The biological attack detection result includes attack images, and the attack images include: one or more of an image presenting a biological being through an electronic screen, an image presenting a biological being through paper, an image presenting a biological being through a mask, and an image containing a photo of a biological being.
4. The method according to claim 3, wherein: The biological attack detection model is a binary classification model constructed based on a neural network.
5. The method according to claim 1, wherein: After respectively calculating the video frame difference feature of each of the lit frames and the corresponding unlit frames, the method further includes: Performing color amplification processing on each calculated video frame difference feature to obtain a color-amplified video frame difference feature; The step of performing feature fusion processing on the multiple video frame difference features to obtain fused video frame difference features includes: The video frame difference features after multiple color amplification are subjected to feature fusion processing to obtain fused video frame difference features.
6. The method according to claim 1, wherein: The preset lighting modes include: Lighting with random colors and / or lighting with random positions.
7. The method according to claim 1, wherein: The method for calculating the video frame difference feature between each of the lit frames and the corresponding unlit frames comprises: Determine a plurality of pixel points between each of the illuminated frames and the corresponding unilluminated frames, and calculate a similarity value of each of the pixel points; The video frame difference feature between each of the lit frames and the corresponding non-lit frame is determined according to the similarity values of the multiple pixel points.
8. The method according to claim 1, wherein: The biological video is a biological video with time sequence information and inter-frame information. The fused video frame difference feature is input into a pre-trained biological attack detection model to obtain a biological attack detection result, including: The timing information and inter-frame information in the biological video, as well as the fused video frame difference features, are input into a pre-trained biological attack detection model to obtain a biological attack detection result.
9. A biological attack detection device, comprising: A lighting frame extraction module, which obtains a biological video for biological attack detection collected under a preset lighting mode, and extracts a plurality of lighting frames and an unlit frame corresponding to each of the lighting frames from the acquired biological video; A video frame difference feature calculation module, which calculates the video frame difference features of each of the illuminated frames and the corresponding unilluminated frames; The multi-feature fusion module performs feature fusion processing on multiple video frame difference features to obtain fused video frame difference features; The classification module inputs the fused video frame difference features into a pre-trained biological attack detection model to obtain a biological attack detection result. The biological attack detection model is a model trained based on biological images, non-biological images and a preset loss function.
10. An electronic device comprising: processor; as well as a memory arranged to store computer executable instructions which, when executed, cause the processor to: Acquire a biological video for biological attack detection collected under a preset lighting mode, and extract a plurality of illuminated frames and an unilluminated frame corresponding to each of the illuminated frames from the acquired biological video; Calculating the video frame difference features of each of the illuminated frames and the corresponding unilluminated frames respectively; Perform feature fusion processing on multiple video frame difference features to obtain fused video frame difference features; The fused video frame difference features are input into a pre-trained biological attack detection model to obtain a biological attack detection result. The biological attack detection model is a model trained based on biological images, non-biological images and a preset loss function.
Citation Information
Patent Citations
Injection attack identification method, device and equipment
CN110807368A
Target area detection method and device, storage medium and electronic equipment
CN114332702A
Living body attack detection method and living body attack detection model training method
CN115937992A
Face living body detection method and device, and electronic equipment
CN116935457A
Biological attack detection method and device
CN117593801A