Nothing Special   »   [go: up one dir, main page]

WO2022227191A1 - Inactive living body detection method and apparatus, electronic device, and storage medium - Google Patents

Inactive living body detection method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2022227191A1
WO2022227191A1 PCT/CN2021/097078 CN2021097078W WO2022227191A1 WO 2022227191 A1 WO2022227191 A1 WO 2022227191A1 CN 2021097078 W CN2021097078 W CN 2021097078W WO 2022227191 A1 WO2022227191 A1 WO 2022227191A1
Authority
WO
WIPO (PCT)
Prior art keywords
reference point
point set
preset
loss value
living body
Prior art date
Application number
PCT/CN2021/097078
Other languages
French (fr)
Chinese (zh)
Inventor
刘杰
庄伯金
曾凡涛
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2022227191A1 publication Critical patent/WO2022227191A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/49Segmenting video sequences, i.e. computational techniques such as parsing or cutting the sequence, low-level clustering or determining units such as shots or scenes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/40Spoof detection, e.g. liveness detection
    • G06V40/45Detection of the body part being alive
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Definitions

  • the present application relates to the field of biometric identification, and in particular, to a non-active living body detection method, device, electronic device, and computer-readable storage medium.
  • the method for detecting inactive living bodies in background images is usually based on single-frame or multi-frame image texture and analysis of multi-frame eye, mouth, head gesture movements, etc.
  • the stability of the multi-frame image texture method relies heavily on the quality of image acquisition and the completeness of training data.
  • image quality of network calls is poor, especially in bad lighting scenarios. Therefore, this type of application scenario greatly reduces the stability of existing image silent live detection methods based on single-frame or multi-frame textures.
  • a non-active live detection method provided by this application includes:
  • the present application also provides a non-active liveness detection device, the device comprising:
  • the target image acquisition module is used for acquiring original video screenshots, performing reference point selection on the original video screenshots to obtain an initial reference point set; performing position disturbance processing on the initial reference point set to obtain a target reference point set; according to the The initial reference point set and the target reference point set generate a geometric transformation matrix, and the original video screenshot is subjected to geometric transformation processing by using the geometric transformation matrix to obtain a target image;
  • a reference point analysis module for inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
  • the loss value calculation module is used to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function, and calculate the Perform arithmetic operation on the square root loss value and the preset classification loss value of the two-class network to obtain the final detection loss value;
  • a model training module configured to perform iterative optimization processing on the non-active living detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value, to obtain a trained non-active living detection model
  • the image detection module is used for acquiring images to be recognized with a preset number of frames, and inputting the images to be recognized into the trained non-active living body detection model to obtain a non-active living body detection result.
  • the present application also provides an electronic device, the electronic device comprising:
  • the present application also provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in an electronic device to implement the non-active living body detection method described below :
  • FIG. 1 is a schematic flowchart of a non-active living body detection method provided by an embodiment of the present application
  • FIG. 2 is a functional block diagram of a non-active living body detection device provided by an embodiment of the present application
  • FIG. 3 is a schematic structural diagram of an electronic device for implementing the non-active living body detection method according to an embodiment of the present application.
  • the embodiments of the present application provide a non-active live detection method.
  • the execution subject of the non-active living body detection method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal.
  • the non-active liveness detection method may be executed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform.
  • the server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
  • the non-active liveness detection method includes:
  • the original video screenshot is an image captured during an online video call, and the image may include a human face and a human face background.
  • the image may include a human face and a human face background.
  • obtaining the original video screenshot, performing reference point selection on the original video screenshot, and obtaining an initial reference point set including:
  • Multiple reference points in the original video screenshot are randomly selected on the two-dimensional rectangular coordinate system to generate an initial reference point set.
  • the number of randomly selected reference points is four.
  • performing position disturbance processing on the initial reference point set to obtain the target reference point set includes:
  • the target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
  • the disturbance function is a Hash function.
  • geometric transformation refers to an anti-projection from a set with a geometric structure to itself or other such sets
  • the geometric transformation includes image affine transformation and homography transformation.
  • the image affine transformation is to perform a linear transformation on a vector space followed by a translation in geometry to transform it into another vector space
  • the homography transformation is to map the image on the world coordinate system to the pixel coordinate system.
  • geometric transformation matrix to perform geometric transformation processing on the original video screenshot, that is, using the geometric transformation matrix and the position of each pixel in the original video screenshot to perform multiplication processing to obtain a geometrically transformed image. pixel points and generate a target image according to the pixel points.
  • the homography transformation is adopted in this solution, that is, the generated geometric transformation matrix is a homography matrix, and the geometric transformation processing is a homography transformation processing.
  • the generating a geometric transformation matrix according to the initial reference point set and the target reference point set includes:
  • the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
  • first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, including:
  • the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, including:
  • H is the geometric transformation matrix
  • b is the second arbitrary coordinate
  • a is the first arbitrary coordinate
  • T is a fixed parameter.
  • the original video screenshot, the target image and the initial reference point set are input into a preset reference point analysis network, and the reference point analysis network is used to predict the original video screenshot.
  • the position of the initial reference point set on the target image, and obtain the prediction reference point set, the coordinates of the prediction reference point included in the prediction reference point set are the initial reference point set on the original video screenshot on the target image coordinate of.
  • the reference point analysis network may be a deep learning model.
  • the calculation of the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function includes:
  • MSE is the root mean square error loss value
  • y i is the prediction reference point
  • n is the total number of prediction reference points in the prediction reference point set
  • i refers to the ith prediction reference point.
  • the arithmetic calculation of the root mean square loss value and the preset classification loss value of the two-class network includes calculating the root mean square loss value and the classification loss value of the two-class network. and to obtain the final detection loss value, wherein the classification loss value of the binary classification network can be calculated by using the cross-entropy loss function.
  • the trained non-active living body detection model is used to detect whether the human face in the picture containing the human face belongs to the non-active living body attack.
  • the non-active living body detection model constructed by the reference point analysis network and the two-classification network is iteratively optimized according to the final detection loss value to obtain a trained non-active living body detection model.
  • models including:
  • the non-active living body detection model is a trained non-active living body detection model
  • the internal parameters of the inactive living body detection model may be the gradient of the model or the internal parameters of the model.
  • the preset number of frames may be at least two consecutive or discontinuous images.
  • the to-be-recognized images of the preset number of frames may be multiple consecutive screenshots containing human faces in the chat video; or the images to be recognized of the preset number of frames may be intercepted during identity verification through a camera
  • the obtained multiple screenshots contain human faces, and the multiple screenshots can be 2D images.
  • the non-active living body detection model by inputting the images to be identified with a preset number of frames into the non-active living body detection model, it can be monitored whether the to-be-identified images contain non-active living bodies.
  • This embodiment of the present application obtains a target image by performing geometric transformation processing on the set of initial reference points selected in the original video screenshot and the target reference point obtained through position disturbance processing, and according to the original video screenshot, the target image and the initial reference point
  • the reference point analysis network is trained, and the trained reference point analysis network pays more attention to learning the information related to the geometric transformation of the face, which can reduce the dependence on a large amount of training data, so it can improve the stability of the non-active living body detection, and this application implements
  • a binary classification network is added, which improves the accuracy and generalization, and improves the accuracy of non-active liveness detection. Therefore, the non-active living detection method proposed in this application can solve the problem of low stability of the non-active living detection.
  • FIG. 2 it is a functional block diagram of an inactive living body detection device provided by an embodiment of the present application.
  • the non-active living body detection apparatus 100 described in this application may be installed in an electronic device.
  • the inactive living body detection apparatus 100 may include a target image acquisition module 101 , a reference point analysis module 102 , a loss value calculation module 103 , a model training module 104 and an image detection module 105 .
  • the modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of the electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
  • each module/unit is as follows:
  • the target image acquisition module 101 is configured to acquire original video screenshots, select reference points for the original video screenshots, and obtain an initial reference point set; perform position disturbance processing on the initial reference point set to obtain a target reference point set; Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
  • the reference point analysis module 102 is configured to input the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
  • the loss value calculation module 103 is configured to use a preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and calculate the root mean square loss value between the prediction reference point and the preset real reference point.
  • the root mean square loss value and the preset classification loss value of the two-class network are subjected to an arithmetic operation to obtain the final detection loss value;
  • the model training module 104 is configured to iteratively optimize the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value, and obtain a trained non-active living body detection model;
  • the image detection module 105 is configured to acquire images to be recognized with a preset number of frames, input the images to be recognized into the trained non-active living detection model, and obtain a non-active living detection result.
  • a non-active body detection method including the following steps can be implemented:
  • Step 1 Obtain a screenshot of the original video, select a reference point for the original video screenshot, and obtain an initial set of reference points.
  • the original video screenshot is a picture image captured during an online video call, and the image may include a human face and a human face background.
  • the image may include a human face and a human face background.
  • obtaining the original video screenshot, performing reference point selection on the original video screenshot, and obtaining an initial reference point set including:
  • Multiple reference points in the original video screenshot are randomly selected on the two-dimensional rectangular coordinate system to generate an initial reference point set.
  • the number of randomly selected reference points is four.
  • Step 2 Perform position disturbance processing on the initial reference point set to obtain a target reference point set.
  • performing position disturbance processing on the initial reference point set to obtain the target reference point set includes:
  • the target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
  • the disturbance function is a Hash function.
  • Step 3 Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image.
  • geometric transformation refers to an anti-projection from a set with a geometric structure to itself or other such sets
  • the geometric transformation includes image affine transformation and homography transformation.
  • the image affine transformation is to perform a linear transformation on a vector space followed by a translation in geometry to transform it into another vector space
  • the homography transformation is to map the image on the world coordinate system to the pixel coordinate system.
  • geometric transformation matrix to perform geometric transformation processing on the original video screenshot, that is, using the geometric transformation matrix and the position of each pixel in the original video screenshot to perform multiplication processing to obtain a geometrically transformed image. pixel points and generate a target image according to the pixel points.
  • the homography transformation is adopted in this solution, that is, the generated geometric transformation matrix is a homography matrix, and the geometric transformation processing is a homography transformation processing.
  • the generating a geometric transformation matrix according to the initial reference point set and the target reference point set includes:
  • the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
  • first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, including:
  • H is the geometric transformation matrix
  • b is the second arbitrary coordinate
  • a is the first arbitrary coordinate
  • T is a fixed parameter.
  • Step 4 Input the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set.
  • the original video screenshot, the target image and the initial reference point set are input into a preset reference point analysis network, and the reference point analysis network is used to predict the original video screenshot.
  • the position of the initial reference point set on the target image, and obtain the prediction reference point set, the coordinates of the prediction reference point included in the prediction reference point set are the initial reference point set on the original video screenshot on the target image coordinate of.
  • the reference point analysis network may be a deep learning model.
  • Step 5 Calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function, and calculate the root mean square loss value. Perform arithmetic operation with the classification loss value of the preset binary classification network to obtain the final detection loss value.
  • the calculation of the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function includes:
  • MSE is the root mean square error loss value
  • y i is the prediction reference point
  • n is the total number of prediction reference points in the prediction reference point set
  • i refers to the ith prediction reference point.
  • the arithmetic calculation of the root mean square loss value and the preset classification loss value of the two-class network includes calculating the root mean square loss value and the classification loss value of the two-class network. and to obtain the final detection loss value, wherein the classification loss value of the binary classification network can be calculated by using the cross-entropy loss function.
  • Step 6 Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model.
  • the trained non-active living body detection model is used to detect whether the human face in the picture containing the human face belongs to the non-active living body attack.
  • the non-active living body detection model constructed by the reference point analysis network and the two-classification network is iteratively optimized according to the final detection loss value to obtain a trained non-active living body detection model.
  • models including:
  • the non-active living body detection model is a trained non-active living body detection model
  • the internal parameters of the inactive living body detection model may be the gradient of the model or the internal parameters of the model.
  • Step 7 Acquire images to be recognized with a preset number of frames, input the images to be recognized into the trained non-active living body detection model, and obtain a non-active living body detection result.
  • the preset number of frames may be at least two consecutive or discontinuous images.
  • the to-be-recognized images of the preset number of frames may be multiple consecutive screenshots containing human faces in the chat video; or the images to be recognized of the preset number of frames may be intercepted during identity verification through a camera
  • the obtained multiple screenshots contain human faces, and the multiple screenshots can be 2D images.
  • the non-active living body detection model by inputting the images to be identified with a preset number of frames into the non-active living body detection model, it can be monitored whether the to-be-identified images contain non-active living bodies.
  • This embodiment of the present application obtains a target image by performing geometric transformation processing on the set of initial reference points selected in the original video screenshot and the target reference point obtained through position disturbance processing, and according to the original video screenshot, the target image and the initial reference point
  • the reference point analysis network is trained, and the trained reference point analysis network pays more attention to learning the information related to the geometric transformation of the face, which can reduce the dependence on a large amount of training data, so it can improve the stability of the non-active living body detection, and this application implements
  • a binary classification network is added, which improves the accuracy and generalization, and improves the accuracy of non-active liveness detection. Therefore, the non-active living body detection device proposed in the present application can solve the problem that the stability of the non-active living body detection is not high.
  • FIG. 3 it is a schematic structural diagram of an electronic device for implementing an inactive living body detection method provided by an embodiment of the present application.
  • the electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an inactive living body detection program 12.
  • the memory 11 includes at least one type of readable storage medium, and the readable storage medium may be volatile or non-volatile.
  • the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (eg, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like.
  • the memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1.
  • the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device.
  • the memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as codes of the non-active living body detection program 12, etc., but also can be used to temporarily store data that has been output or will be output.
  • the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits.
  • Central Processing Unit CPU
  • microprocessor digital processing chip
  • graphics processor and combination of various control chips, etc.
  • the processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing programs or modules (such as non- Active living body detection program, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
  • the bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like.
  • PCI peripheral component interconnect
  • EISA Extended industry standard architecture
  • the bus can be divided into address bus, data bus, control bus and so on.
  • the bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
  • FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
  • the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management
  • the device implements functions such as charge management, discharge management, and power consumption management.
  • the power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components.
  • the electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
  • the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • a network interface optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
  • the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface.
  • the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch panel, and the like.
  • the display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
  • the non-active living body detection program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
  • the modules/units integrated in the electronic device 1 may be stored in a computer-readable storage medium.
  • the computer-readable storage medium may be volatile or non-volatile.
  • the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
  • the present application also provides a computer-readable storage medium, where the readable storage medium stores a computer program, and when executed by a processor of an electronic device, the computer program can realize:
  • modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
  • the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Multimedia (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Human Computer Interaction (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • Image Analysis (AREA)

Abstract

An inactive living body detection method and apparatus, an electronic device, and a computer readable storage medium, relating to the biological identification technology and the blockchain technology. The method comprises: obtaining an initial reference point set in an original video screenshot, and performing position disturbance to obtain a target reference point set; according to the initial reference point set and the target reference point set, performing geometric transformation on the original video screenshot to obtain a target image; inputting the original video screenshot, the target image, and the initial reference point set into a reference point analysis network so as to obtain a predicted reference point set; and according to an obtained final detection loss value, optimizing an inactive living body detection model to obtain a trained inactive living body detection model, and identifying an image to be identified, so as to obtain an inactive living body detection result. The described target image can be stored in a node of a blockchain. The method can solve the problem that the stability of inactive living body detection is not high.

Description

非主动活体检测方法、装置、电子设备及存储介质Inactive living body detection method, device, electronic device and storage medium
本申请要求于2021年04月28日提交中国专利局、申请号为202110467269.0,发明名称为“非主动活体检测方法、装置、电子设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application filed on April 28, 2021 with the application number 202110467269.0 and the title of the invention is "Inactive living detection method, device, electronic device and storage medium", the entire content of which is approved by Reference is incorporated in this application.
技术领域technical field
本申请涉及生物识别领域,尤其涉及一种非主动活体检测方法、装置、电子设备及计算机可读存储介质。The present application relates to the field of biometric identification, and in particular, to a non-active living body detection method, device, electronic device, and computer-readable storage medium.
背景技术Background technique
现在银行中通常通过网络视频通话的方式对申请办理业务的申请人进行审核,但是申请人进行视频通话时的环境多半嘈杂,视频背景中可能出现除申请人以外的背景人脸,例如相框或者海报等包含人脸的非主动活体,则在统计视频背景中的申请人的人脸信息的时候需要对申请人以外的背景人脸进行剔除,以防出现多人误报的情况。At present, banks usually use online video calls to review applicants who apply for business, but the environment when applicants make video calls is usually noisy, and background faces other than the applicants may appear in the video background, such as photo frames or posters If there is a non-active living body including a human face, the background faces other than the applicant need to be eliminated when the applicant's face information in the video background is counted to prevent multiple false positives.
发明人意识到,现有技术中,检测背景图像中的非主动活体的方法通常是基于单帧或多帧图像纹理和分析多帧眼睛、嘴巴、头部姿态运动等来判断,基于单帧或多帧图像纹理的方法,其算法稳定性严重依赖图像获取质量和训练数据的完备性,但实际网络视频通话中由于对用户手机型号、通话场景没有限制,采集完备场景的训练数据非常困难,且网络通话图像质量较差,恶劣光照场景尤其严重,因此该类应用场景导致现有的基于单帧或多帧纹理做图像静默活体检测方法稳定性大大降低。The inventor realized that in the prior art, the method for detecting inactive living bodies in background images is usually based on single-frame or multi-frame image texture and analysis of multi-frame eye, mouth, head gesture movements, etc. The stability of the multi-frame image texture method relies heavily on the quality of image acquisition and the completeness of training data. However, in actual online video calls, because there are no restrictions on user mobile phone models and call scenarios, it is very difficult to collect training data for complete scenarios. The image quality of network calls is poor, especially in bad lighting scenarios. Therefore, this type of application scenario greatly reduces the stability of existing image silent live detection methods based on single-frame or multi-frame textures.
发明内容SUMMARY OF THE INVENTION
本申请提供的一种非主动活体检测方法,包括:A non-active live detection method provided by this application includes:
获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
本申请还提供一种非主动活体检测装置,所述装置包括:The present application also provides a non-active liveness detection device, the device comprising:
目标图像获取模块,用于获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;The target image acquisition module is used for acquiring original video screenshots, performing reference point selection on the original video screenshots to obtain an initial reference point set; performing position disturbance processing on the initial reference point set to obtain a target reference point set; according to the The initial reference point set and the target reference point set generate a geometric transformation matrix, and the original video screenshot is subjected to geometric transformation processing by using the geometric transformation matrix to obtain a target image;
参考点分析模块,用于将所述原始视频截图、所述目标图像和所述初始参考点集合输 入至预设的参考点分析网络中,得到预测参考点集合;A reference point analysis module, for inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
损失值计算模块,用于利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;The loss value calculation module is used to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function, and calculate the Perform arithmetic operation on the square root loss value and the preset classification loss value of the two-class network to obtain the final detection loss value;
模型训练模块,用于根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;A model training module, configured to perform iterative optimization processing on the non-active living detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value, to obtain a trained non-active living detection model;
图像检测模块,用于获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。The image detection module is used for acquiring images to be recognized with a preset number of frames, and inputting the images to be recognized into the trained non-active living body detection model to obtain a non-active living body detection result.
本申请还提供一种电子设备,所述电子设备包括:The present application also provides an electronic device, the electronic device comprising:
存储器,存储至少一个指令;及a memory that stores at least one instruction; and
处理器,执行所述存储器中存储的指令以实现如下所述的非主动活体检测方法:A processor that executes the instructions stored in the memory to implement the following non-active liveness detection method:
获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
本申请还提供一种计算机可读存储介质,所述计算机可读存储介质中存储有至少一个指令,所述至少一个指令被电子设备中的处理器执行以实现如下所述的非主动活体检测方法:The present application also provides a computer-readable storage medium, where at least one instruction is stored in the computer-readable storage medium, and the at least one instruction is executed by a processor in an electronic device to implement the non-active living body detection method described below :
获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
附图说明Description of drawings
图1为本申请一实施例提供的非主动活体检测方法的流程示意图;FIG. 1 is a schematic flowchart of a non-active living body detection method provided by an embodiment of the present application;
图2为本申请一实施例提供的非主动活体检测装置的功能模块图;FIG. 2 is a functional block diagram of a non-active living body detection device provided by an embodiment of the present application;
图3为本申请一实施例提供的实现所述非主动活体检测方法的电子设备的结构示意图。FIG. 3 is a schematic structural diagram of an electronic device for implementing the non-active living body detection method according to an embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics and advantages of the purpose of the present application will be further described with reference to the accompanying drawings in conjunction with the embodiments.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application, but not to limit the present application.
本申请实施例提供一种非主动活体检测方法。所述非主动活体检测方法的执行主体包括但不限于服务端、终端等能够被配置为执行本申请实施例提供的该方法的电子设备中的至少一种。换言之,所述非主动活体检测方法可以由安装在终端设备或服务端设备的软件或硬件来执行,所述软件可以是区块链平台。所述服务端包括但不限于:单台服务器、服务器集群、云端服务器或云端服务器集群等。The embodiments of the present application provide a non-active live detection method. The execution subject of the non-active living body detection method includes, but is not limited to, at least one of electronic devices that can be configured to execute the method provided by the embodiments of the present application, such as a server and a terminal. In other words, the non-active liveness detection method may be executed by software or hardware installed in a terminal device or a server device, and the software may be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like.
参照图1所示,为本申请一实施例提供的非主动活体检测方法的流程示意图。在本实施例中,所述非主动活体检测方法包括:Referring to FIG. 1 , a schematic flowchart of a non-active living body detection method provided by an embodiment of the present application is shown. In this embodiment, the non-active liveness detection method includes:
S1、获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合。S1. Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set.
本申请实施例中,所述原始视频截图是网络视频通话过程中截取到的图图像,图像中可以包含人脸以及人脸背景。例如,在金融领域中通过网络视频通话进行身份信息审核时截取到的图像。In the embodiment of the present application, the original video screenshot is an image captured during an online video call, and the image may include a human face and a human face background. For example, an image captured during identity information verification through an online video call in the financial field.
具体地,所述获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合,包括:Specifically, obtaining the original video screenshot, performing reference point selection on the original video screenshot, and obtaining an initial reference point set, including:
将所述原始视频截图映射至预设的二维直角坐标系;mapping the original video screenshot to a preset two-dimensional rectangular coordinate system;
在所述二维直角坐标系上随机选取所述原始视频截图中的多个参考点,生成初始参考点集合。Multiple reference points in the original video screenshot are randomly selected on the two-dimensional rectangular coordinate system to generate an initial reference point set.
可选地,在本申请实施例中,随机选取的参考点的个数为四个。Optionally, in this embodiment of the present application, the number of randomly selected reference points is four.
S2、对所述初始参考点集合进行位置扰动处理,得到目标参考点集合。S2. Perform position disturbance processing on the initial reference point set to obtain a target reference point set.
本申请实施例中,所述对所述初始参考点集合进行位置扰动处理,得到目标参考点集合,包括:In the embodiment of the present application, performing position disturbance processing on the initial reference point set to obtain the target reference point set includes:
获取所述初始参考点集合中各个初始参考点的坐标值,得到所述初始参考点集合对应的初始坐标点集合;Obtain the coordinate value of each initial reference point in the initial reference point set, and obtain the initial coordinate point set corresponding to the initial reference point set;
利用扰乱函数对所述初始坐标点集合进行扰乱计算,得到目标坐标点集合;Using the scrambling function to perform scrambling calculation on the initial coordinate point set to obtain the target coordinate point set;
将所述目标坐标点集合映射至二维直角坐标系,得到目标参考点集合。The target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
详细地,本申请实施例中,所述扰乱函数为Hash函数。In detail, in the embodiment of the present application, the disturbance function is a Hash function.
S3、根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像。S3. Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image.
本申请实施例中,几何变换是指从具有几何结构之集合至其自身或其他此类集合的一种对射,所述几何变换包括图像仿射变换和单应性变换。其中,所述图像仿射变换是在几何中,将一个向量空间进行一次线性变换并接上一个平移,变换为另一个向量空间,所述单应性变换是将在世界坐标系上的图像映射到像素坐标系上。In this embodiment of the present application, geometric transformation refers to an anti-projection from a set with a geometric structure to itself or other such sets, and the geometric transformation includes image affine transformation and homography transformation. Wherein, the image affine transformation is to perform a linear transformation on a vector space followed by a translation in geometry to transform it into another vector space, and the homography transformation is to map the image on the world coordinate system to the pixel coordinate system.
进一步地,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,即利用所述几何变换矩阵与所述原始视频截图中的各个像素点的位置做相乘处理,得到几何变换后的像素点并根据所述像素点生成目标图像。Further, using the geometric transformation matrix to perform geometric transformation processing on the original video screenshot, that is, using the geometric transformation matrix and the position of each pixel in the original video screenshot to perform multiplication processing to obtain a geometrically transformed image. pixel points and generate a target image according to the pixel points.
优选地,本方案中采用单应性变换,即生成的几何变换矩阵为单应性矩阵,几何变换处理为单应性变换处理。Preferably, the homography transformation is adopted in this solution, that is, the generated geometric transformation matrix is a homography matrix, and the geometric transformation processing is a homography transformation processing.
具体地,所述根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,包括:Specifically, the generating a geometric transformation matrix according to the initial reference point set and the target reference point set includes:
获取所述初始参考点集合中任意一初始参考点的第一任意坐标和所述目标参考点集 合中任意一目标参考点的第二任意坐标;Obtain the first arbitrary coordinates of any initial reference point in the set of initial reference points and the second arbitrary coordinates of any one of the target reference points in the set of target reference points;
根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵。The first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
进一步地,所述根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵,包括:Further, the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, including:
所述根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵,包括:The first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, including:
利用下述几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵:Use the following geometric transformation formula to calculate the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point, and obtain the geometric transformation matrix:
b=Ha T b=Ha T
其中,H为所述几何变换矩阵,b为所述第二任意坐标,a为所述第一任意坐标,T为固定参数。Wherein, H is the geometric transformation matrix, b is the second arbitrary coordinate, a is the first arbitrary coordinate, and T is a fixed parameter.
S4、将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合。S4. Input the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set.
本申请实施例中,将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,通过所述参考点分析网络预测所述原始视频截图上的初始参考点集合在所述目标图像上的位置,并得到预测参考点集合,所述预测参考点集合中包含的预测参考点的坐标为原始视频截图上的初始参考点集合在所述目标图像上的坐标。In this embodiment of the present application, the original video screenshot, the target image and the initial reference point set are input into a preset reference point analysis network, and the reference point analysis network is used to predict the original video screenshot. the position of the initial reference point set on the target image, and obtain the prediction reference point set, the coordinates of the prediction reference point included in the prediction reference point set are the initial reference point set on the original video screenshot on the target image coordinate of.
其中,所述参考点分析网络可以为深度学习模型。Wherein, the reference point analysis network may be a deep learning model.
S5、利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值。S5, using a preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the An arithmetic operation is performed on the classification loss value of the preset two-class network to obtain the final detection loss value.
本申请实施例中,所述利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,包括:In the embodiment of the present application, the calculation of the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function includes:
利用下述预设的均方根误差损失函数公式计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值:Use the following preset root mean square error loss function formula to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point:
Figure PCTCN2021097078-appb-000001
Figure PCTCN2021097078-appb-000001
其中,MSE为均方根误差损失值,y i为所述预测参考点,
Figure PCTCN2021097078-appb-000002
为所述真实参考点,n为所述预测参考点集合中预测参考点的总数,i是指第i个预测参考点。
Among them, MSE is the root mean square error loss value, y i is the prediction reference point,
Figure PCTCN2021097078-appb-000002
is the real reference point, n is the total number of prediction reference points in the prediction reference point set, and i refers to the ith prediction reference point.
进一步地,所述将所述均方根损失值与预设的二分类网络的分类损失值进行算数计算,包括将均方根损失值均方根损失值与二分类网络的分类损失值进行求和,得到最终检测损失值,其中,所述二分类网络的分类损失值可以利用交叉熵损失函数进行计算得到。Further, the arithmetic calculation of the root mean square loss value and the preset classification loss value of the two-class network includes calculating the root mean square loss value and the classification loss value of the two-class network. and to obtain the final detection loss value, wherein the classification loss value of the binary classification network can be calculated by using the cross-entropy loss function.
S6、根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型。S6. Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model.
本申请实施例中,所述训练好的非主动活体检测模型用于检测包含人脸的图片中的人脸是否属于非主动活体攻击。In the embodiment of the present application, the trained non-active living body detection model is used to detect whether the human face in the picture containing the human face belongs to the non-active living body attack.
本申请实施例中,所述根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型,包括:In the embodiment of the present application, the non-active living body detection model constructed by the reference point analysis network and the two-classification network is iteratively optimized according to the final detection loss value to obtain a trained non-active living body detection model. models, including:
判断所述最终检测损失值与预设的损失阈值之间的大小;judging the size between the final detection loss value and a preset loss threshold;
若所述最终检测损失值小于所述预设的损失阈值,确定所述非主动活体检测模型为训练好的非主动活体检测模型;If the final detection loss value is less than the preset loss threshold, determine that the non-active living body detection model is a trained non-active living body detection model;
若所述最终检测损失值大于或者等于所述预设的损失阈值时,调整所述非主动活体检测模型的内部参数,直至所述最终检测损失值小于所述预设的损失阈值时,得到训练好的非主动活体检测模型。If the final detection loss value is greater than or equal to the preset loss threshold, adjust the internal parameters of the inactive living body detection model, until the final detection loss value is less than the preset loss threshold, obtain training Good non-active liveness detection model.
其中,所述非主动活体检测模型的内部参数可以为模型的梯度或者模型的内部参数。Wherein, the internal parameters of the inactive living body detection model may be the gradient of the model or the internal parameters of the model.
S7、获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。S7. Acquire images to be recognized with a preset number of frames, and input the images to be recognized into the trained non-active living body detection model to obtain a non-active living body detection result.
本申请实施例中,预设帧数可以为连续的或者不连续的至少两张图像。In this embodiment of the present application, the preset number of frames may be at least two consecutive or discontinuous images.
本申请实施例中,所述预设帧数的待识别图像可以为聊天视频中包含人脸的连续多张截图;或者所述预设帧数的待识别图像可以为通过摄像头进行身份验证时截取到的包含人脸的多张截图,该多张截图可以为2D图像。In the embodiment of the present application, the to-be-recognized images of the preset number of frames may be multiple consecutive screenshots containing human faces in the chat video; or the images to be recognized of the preset number of frames may be intercepted during identity verification through a camera The obtained multiple screenshots contain human faces, and the multiple screenshots can be 2D images.
本申请实施例中,通过将预设帧数的待识别图像输入至非主动活体检测模型中,可以监测出待识别图像中是否包含非主动活体。In the embodiment of the present application, by inputting the images to be identified with a preset number of frames into the non-active living body detection model, it can be monitored whether the to-be-identified images contain non-active living bodies.
本申请实施例通过对原始视频截图中选中的初始参考点集合和经过位置扰动处理得到的目标参考点进行几何变换处理,得到目标图像,根据原始视频截图、目标图像和初始参考点对预设的参考点分析网络进行训练,训练好的参考点分析网络更加注重学习与人脸几何变换相关的信息,可以减少对大量训练数据的依赖,因此可以提高非主动活体检测的稳定性,且本申请实施例中添加了一个二分类网络,提高了精度和泛化性,提高了非主动活体检测的准确性。因此本申请提出的非主动活体检测方法,可以解决非主动活体检测的稳定性不高的问题。This embodiment of the present application obtains a target image by performing geometric transformation processing on the set of initial reference points selected in the original video screenshot and the target reference point obtained through position disturbance processing, and according to the original video screenshot, the target image and the initial reference point The reference point analysis network is trained, and the trained reference point analysis network pays more attention to learning the information related to the geometric transformation of the face, which can reduce the dependence on a large amount of training data, so it can improve the stability of the non-active living body detection, and this application implements In the example, a binary classification network is added, which improves the accuracy and generalization, and improves the accuracy of non-active liveness detection. Therefore, the non-active living detection method proposed in this application can solve the problem of low stability of the non-active living detection.
如图2所示,是本申请一实施例提供的非主动活体检测装置的功能模块图。As shown in FIG. 2 , it is a functional block diagram of an inactive living body detection device provided by an embodiment of the present application.
本申请所述非主动活体检测装置100可以安装于电子设备中。根据实现的功能,所述非主动活体检测装置100可以包括目标图像获取模块101、参考点分析模块102、损失值计算模块103、模型训练模块104及图像检测模块105。本申请所述模块也可以称之为单元,是指一种能够被电子设备处理器所执行,并且能够完成固定功能的一系列计算机程序段,其存储在电子设备的存储器中。The non-active living body detection apparatus 100 described in this application may be installed in an electronic device. According to the implemented functions, the inactive living body detection apparatus 100 may include a target image acquisition module 101 , a reference point analysis module 102 , a loss value calculation module 103 , a model training module 104 and an image detection module 105 . The modules described in this application may also be referred to as units, which refer to a series of computer program segments that can be executed by the processor of the electronic device and can perform fixed functions, and are stored in the memory of the electronic device.
在本实施例中,关于各模块/单元的功能如下:In this embodiment, the functions of each module/unit are as follows:
所述目标图像获取模块101,用于获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;The target image acquisition module 101 is configured to acquire original video screenshots, select reference points for the original video screenshots, and obtain an initial reference point set; perform position disturbance processing on the initial reference point set to obtain a target reference point set; Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
所述参考点分析模块102,用于将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;The reference point analysis module 102 is configured to input the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
所述损失值计算模块103,用于利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;The loss value calculation module 103 is configured to use a preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and calculate the root mean square loss value between the prediction reference point and the preset real reference point. The root mean square loss value and the preset classification loss value of the two-class network are subjected to an arithmetic operation to obtain the final detection loss value;
所述模型训练模块104,用于根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;The model training module 104 is configured to iteratively optimize the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value, and obtain a trained non-active living body detection model;
所述图像检测模块105,用于获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。The image detection module 105 is configured to acquire images to be recognized with a preset number of frames, input the images to be recognized into the trained non-active living detection model, and obtain a non-active living detection result.
详细地,所述非主动活体检测装置100各模块在由电子设备的处理器所执行时,可以实现一种包括下述步骤的非主动活体检测方法:In detail, when each module of the non-active body detection apparatus 100 is executed by the processor of the electronic device, a non-active body detection method including the following steps can be implemented:
步骤一、获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合。Step 1: Obtain a screenshot of the original video, select a reference point for the original video screenshot, and obtain an initial set of reference points.
本申请实施例中,所述原始视频截图是网络视频通话过程中截取到的图图像,图像中 可以包含人脸以及人脸背景。例如,在金融领域中通过网络视频通话进行身份信息审核时截取到的图像。In the embodiment of the present application, the original video screenshot is a picture image captured during an online video call, and the image may include a human face and a human face background. For example, an image captured during identity information verification through an online video call in the financial field.
具体地,所述获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合,包括:Specifically, obtaining the original video screenshot, performing reference point selection on the original video screenshot, and obtaining an initial reference point set, including:
将所述原始视频截图映射至预设的二维直角坐标系;mapping the original video screenshot to a preset two-dimensional rectangular coordinate system;
在所述二维直角坐标系上随机选取所述原始视频截图中的多个参考点,生成初始参考点集合。Multiple reference points in the original video screenshot are randomly selected on the two-dimensional rectangular coordinate system to generate an initial reference point set.
可选地,在本申请实施例中,随机选取的参考点的个数为四个。Optionally, in this embodiment of the present application, the number of randomly selected reference points is four.
步骤二、对所述初始参考点集合进行位置扰动处理,得到目标参考点集合。Step 2: Perform position disturbance processing on the initial reference point set to obtain a target reference point set.
本申请实施例中,所述对所述初始参考点集合进行位置扰动处理,得到目标参考点集合,包括:In the embodiment of the present application, performing position disturbance processing on the initial reference point set to obtain the target reference point set includes:
获取所述初始参考点集合中各个初始参考点的坐标值,得到所述初始参考点集合对应的初始坐标点集合;Obtain the coordinate value of each initial reference point in the initial reference point set, and obtain the initial coordinate point set corresponding to the initial reference point set;
利用扰乱函数对所述初始坐标点集合进行扰乱计算,得到目标坐标点集合;Using the scrambling function to perform scrambling calculation on the initial coordinate point set to obtain the target coordinate point set;
将所述目标坐标点集合映射至二维直角坐标系,得到目标参考点集合。The target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
详细地,本申请实施例中,所述扰乱函数为Hash函数。In detail, in the embodiment of the present application, the disturbance function is a Hash function.
步骤三、根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像。Step 3: Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image.
本申请实施例中,几何变换是指从具有几何结构之集合至其自身或其他此类集合的一种对射,所述几何变换包括图像仿射变换和单应性变换。其中,所述图像仿射变换是在几何中,将一个向量空间进行一次线性变换并接上一个平移,变换为另一个向量空间,所述单应性变换是将在世界坐标系上的图像映射到像素坐标系上。In this embodiment of the present application, geometric transformation refers to an anti-projection from a set with a geometric structure to itself or other such sets, and the geometric transformation includes image affine transformation and homography transformation. Wherein, the image affine transformation is to perform a linear transformation on a vector space followed by a translation in geometry to transform it into another vector space, and the homography transformation is to map the image on the world coordinate system to the pixel coordinate system.
进一步地,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,即利用所述几何变换矩阵与所述原始视频截图中的各个像素点的位置做相乘处理,得到几何变换后的像素点并根据所述像素点生成目标图像。Further, using the geometric transformation matrix to perform geometric transformation processing on the original video screenshot, that is, using the geometric transformation matrix and the position of each pixel in the original video screenshot to perform multiplication processing to obtain a geometrically transformed image. pixel points and generate a target image according to the pixel points.
优选地,本方案中采用单应性变换,即生成的几何变换矩阵为单应性矩阵,几何变换处理为单应性变换处理。Preferably, the homography transformation is adopted in this solution, that is, the generated geometric transformation matrix is a homography matrix, and the geometric transformation processing is a homography transformation processing.
具体地,所述根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,包括:Specifically, the generating a geometric transformation matrix according to the initial reference point set and the target reference point set includes:
获取所述初始参考点集合中任意一初始参考点的第一任意坐标和所述目标参考点集合中任意一目标参考点的第二任意坐标;Obtain the first arbitrary coordinates of any one of the initial reference points in the set of initial reference points and the second arbitrary coordinates of any one of the target reference points in the set of target reference points;
根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵。The first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
进一步地,所述根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵,包括:Further, the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, including:
利用下述几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵:Use the following geometric transformation formula to calculate the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point, and obtain the geometric transformation matrix:
b=Ha T b=Ha T
其中,H为所述几何变换矩阵,b为所述第二任意坐标,a为所述第一任意坐标,T为固定参数。Wherein, H is the geometric transformation matrix, b is the second arbitrary coordinate, a is the first arbitrary coordinate, and T is a fixed parameter.
步骤四、将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合。Step 4: Input the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set.
本申请实施例中,将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,通过所述参考点分析网络预测所述原始视频截图上的初始参考点集合在所述目标图像上的位置,并得到预测参考点集合,所述预测参考点集合中包含的 预测参考点的坐标为原始视频截图上的初始参考点集合在所述目标图像上的坐标。In this embodiment of the present application, the original video screenshot, the target image and the initial reference point set are input into a preset reference point analysis network, and the reference point analysis network is used to predict the original video screenshot. the position of the initial reference point set on the target image, and obtain the prediction reference point set, the coordinates of the prediction reference point included in the prediction reference point set are the initial reference point set on the original video screenshot on the target image coordinate of.
其中,所述参考点分析网络可以为深度学习模型。Wherein, the reference point analysis network may be a deep learning model.
步骤五、利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值。Step 5. Calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function, and calculate the root mean square loss value. Perform arithmetic operation with the classification loss value of the preset binary classification network to obtain the final detection loss value.
本申请实施例中,所述利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,包括:In the embodiment of the present application, the calculation of the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function includes:
利用下述预设的均方根误差损失函数公式计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值:Use the following preset root mean square error loss function formula to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point:
Figure PCTCN2021097078-appb-000003
Figure PCTCN2021097078-appb-000003
其中,MSE为均方根误差损失值,y i为所述预测参考点,
Figure PCTCN2021097078-appb-000004
为所述真实参考点,n为所述预测参考点集合中预测参考点的总数,i是指第i个预测参考点。
Among them, MSE is the root mean square error loss value, y i is the prediction reference point,
Figure PCTCN2021097078-appb-000004
is the real reference point, n is the total number of prediction reference points in the prediction reference point set, and i refers to the ith prediction reference point.
进一步地,所述将所述均方根损失值与预设的二分类网络的分类损失值进行算数计算,包括将均方根损失值均方根损失值与二分类网络的分类损失值进行求和,得到最终检测损失值,其中,所述二分类网络的分类损失值可以利用交叉熵损失函数进行计算得到。Further, the arithmetic calculation of the root mean square loss value and the preset classification loss value of the two-class network includes calculating the root mean square loss value and the classification loss value of the two-class network. and to obtain the final detection loss value, wherein the classification loss value of the binary classification network can be calculated by using the cross-entropy loss function.
步骤六、根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型。Step 6: Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model.
本申请实施例中,所述训练好的非主动活体检测模型用于检测包含人脸的图片中的人脸是否属于非主动活体攻击。In the embodiment of the present application, the trained non-active living body detection model is used to detect whether the human face in the picture containing the human face belongs to the non-active living body attack.
本申请实施例中,所述根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型,包括:In the embodiment of the present application, the non-active living body detection model constructed by the reference point analysis network and the two-classification network is iteratively optimized according to the final detection loss value to obtain a trained non-active living body detection model. models, including:
判断所述最终检测损失值与预设的损失阈值之间的大小;judging the size between the final detection loss value and a preset loss threshold;
若所述最终检测损失值小于所述预设的损失阈值,确定所述非主动活体检测模型为训练好的非主动活体检测模型;If the final detection loss value is less than the preset loss threshold, determine that the non-active living body detection model is a trained non-active living body detection model;
若所述最终检测损失值大于或者等于所述预设的损失阈值时,调整所述非主动活体检测模型的内部参数,直至所述最终检测损失值小于所述预设的损失阈值时,得到训练好的非主动活体检测模型。If the final detection loss value is greater than or equal to the preset loss threshold, adjust the internal parameters of the inactive living body detection model, until the final detection loss value is less than the preset loss threshold, obtain training Good non-active liveness detection model.
其中,所述非主动活体检测模型的内部参数可以为模型的梯度或者模型的内部参数。Wherein, the internal parameters of the inactive living body detection model may be the gradient of the model or the internal parameters of the model.
步骤七、获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Step 7: Acquire images to be recognized with a preset number of frames, input the images to be recognized into the trained non-active living body detection model, and obtain a non-active living body detection result.
本申请实施例中,预设帧数可以为连续的或者不连续的至少两张图像。In this embodiment of the present application, the preset number of frames may be at least two consecutive or discontinuous images.
本申请实施例中,所述预设帧数的待识别图像可以为聊天视频中包含人脸的连续多张截图;或者所述预设帧数的待识别图像可以为通过摄像头进行身份验证时截取到的包含人脸的多张截图,该多张截图可以为2D图像。In the embodiment of the present application, the to-be-recognized images of the preset number of frames may be multiple consecutive screenshots containing human faces in the chat video; or the images to be recognized of the preset number of frames may be intercepted during identity verification through a camera The obtained multiple screenshots contain human faces, and the multiple screenshots can be 2D images.
本申请实施例中,通过将预设帧数的待识别图像输入至非主动活体检测模型中,可以监测出待识别图像中是否包含非主动活体。In the embodiment of the present application, by inputting the images to be identified with a preset number of frames into the non-active living body detection model, it can be monitored whether the to-be-identified images contain non-active living bodies.
本申请实施例通过对原始视频截图中选中的初始参考点集合和经过位置扰动处理得到的目标参考点进行几何变换处理,得到目标图像,根据原始视频截图、目标图像和初始参考点对预设的参考点分析网络进行训练,训练好的参考点分析网络更加注重学习与人脸几何变换相关的信息,可以减少对大量训练数据的依赖,因此可以提高非主动活体检测的稳定性,且本申请实施例中添加了一个二分类网络,提高了精度和泛化性,提高了非主动活体检测的准确性。因此本申请提出的非主动活体检测装置,可以解决非主动活体检测的 稳定性不高的问题。This embodiment of the present application obtains a target image by performing geometric transformation processing on the set of initial reference points selected in the original video screenshot and the target reference point obtained through position disturbance processing, and according to the original video screenshot, the target image and the initial reference point The reference point analysis network is trained, and the trained reference point analysis network pays more attention to learning the information related to the geometric transformation of the face, which can reduce the dependence on a large amount of training data, so it can improve the stability of the non-active living body detection, and this application implements In the example, a binary classification network is added, which improves the accuracy and generalization, and improves the accuracy of non-active liveness detection. Therefore, the non-active living body detection device proposed in the present application can solve the problem that the stability of the non-active living body detection is not high.
如图3所示,是本申请一实施例提供的实现非主动活体检测方法的电子设备的结构示意图。As shown in FIG. 3 , it is a schematic structural diagram of an electronic device for implementing an inactive living body detection method provided by an embodiment of the present application.
所述电子设备1可以包括处理器10、存储器11和总线,还可以包括存储在所述存储器11中并可在所述处理器10上运行的计算机程序,如非主动活体检测程序12。The electronic device 1 may include a processor 10, a memory 11 and a bus, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as an inactive living body detection program 12.
其中,所述存储器11至少包括一种类型的可读存储介质,所述可读存储介质可以是易失性的,也可以是非易失性的。具体的,所述可读存储介质包括闪存、移动硬盘、多媒体卡、卡型存储器(例如:SD或DX存储器等)、磁性存储器、磁盘、光盘等。所述存储器11在一些实施例中可以是电子设备1的内部存储单元,例如该电子设备1的移动硬盘。所述存储器11在另一些实施例中也可以是电子设备1的外部存储设备,例如电子设备1上配备的插接式移动硬盘、智能存储卡(Smart Media Card,SMC)、安全数字(Secure Digital,SD)卡、闪存卡(Flash Card)等。进一步地,所述存储器11还可以既包括电子设备1的内部存储单元也包括外部存储设备。所述存储器11不仅可以用于存储安装于电子设备1的应用软件及各类数据,例如非主动活体检测程序12的代码等,还可以用于暂时地存储已经输出或者将要输出的数据。Wherein, the memory 11 includes at least one type of readable storage medium, and the readable storage medium may be volatile or non-volatile. Specifically, the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (eg, SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, and the like. The memory 11 may be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1 . In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a pluggable mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital) equipped on the electronic device 1. , SD) card, flash memory card (Flash Card), etc. Further, the memory 11 may also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software installed in the electronic device 1 and various types of data, such as codes of the non-active living body detection program 12, etc., but also can be used to temporarily store data that has been output or will be output.
所述处理器10在一些实施例中可以由集成电路组成,例如可以由单个封装的集成电路所组成,也可以是由多个相同功能或不同功能封装的集成电路所组成,包括一个或者多个中央处理器(Central Processing unit,CPU)、微处理器、数字处理芯片、图形处理器及各种控制芯片的组合等。所述处理器10是所述电子设备的控制核心(Control Unit),利用各种接口和线路连接整个电子设备的各个部件,通过运行或执行存储在所述存储器11内的程序或者模块(例如非主动活体检测程序等),以及调用存储在所述存储器11内的数据,以执行电子设备1的各种功能和处理数据。In some embodiments, the processor 10 may be composed of integrated circuits, for example, may be composed of a single packaged integrated circuit, or may be composed of multiple integrated circuits packaged with the same function or different functions, including one or more integrated circuits. Central Processing Unit (CPU), microprocessor, digital processing chip, graphics processor and combination of various control chips, etc. The processor 10 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and by running or executing programs or modules (such as non- Active living body detection program, etc.), and call data stored in the memory 11 to execute various functions of the electronic device 1 and process data.
所述总线可以是外设部件互连标准(peripheral component interconnect,简称PCI)总线或扩展工业标准结构(extended industry standard architecture,简称EISA)总线等。该总线可以分为地址总线、数据总线、控制总线等。所述总线被设置为实现所述存储器11以及至少一个处理器10等之间的连接通信。The bus may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (Extended industry standard architecture, EISA for short) bus or the like. The bus can be divided into address bus, data bus, control bus and so on. The bus is configured to implement connection communication between the memory 11 and at least one processor 10 and the like.
图3仅示出了具有部件的电子设备,本领域技术人员可以理解的是,图3示出的结构并不构成对所述电子设备1的限定,可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。FIG. 3 only shows an electronic device with components. Those skilled in the art can understand that the structure shown in FIG. 3 does not constitute a limitation on the electronic device 1, and may include fewer or more components than those shown in the figure. components, or a combination of certain components, or a different arrangement of components.
例如,尽管未示出,所述电子设备1还可以包括给各个部件供电的电源(比如电池),优选地,电源可以通过电源管理装置与所述至少一个处理器10逻辑相连,从而通过电源管理装置实现充电管理、放电管理、以及功耗管理等功能。电源还可以包括一个或一个以上的直流或交流电源、再充电装置、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。所述电子设备1还可以包括多种传感器、蓝牙模块、Wi-Fi模块等,在此不再赘述。For example, although not shown, the electronic device 1 may also include a power supply (such as a battery) for powering the various components, preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that the power management The device implements functions such as charge management, discharge management, and power consumption management. The power source may also include one or more DC or AC power sources, recharging devices, power failure detection circuits, power converters or inverters, power status indicators, and any other components. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be repeated here.
进一步地,所述电子设备1还可以包括网络接口,可选地,所述网络接口可以包括有线接口和/或无线接口(如WI-FI接口、蓝牙接口等),通常用于在该电子设备1与其他电子设备之间建立通信连接。Further, the electronic device 1 may also include a network interface, optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is usually used in the electronic device 1 Establish a communication connection with other electronic devices.
可选地,该电子设备1还可以包括用户接口,用户接口可以是显示器(Display)、输入单元(比如键盘(Keyboard)),可选地,用户接口还可以是标准的有线接口、无线接口。可选地,在一些实施例中,显示器可以是LED显示器、液晶显示器、触控式液晶显示器以及OLED(Organic Light-Emitting Diode,有机发光二极管)触摸器等。其中,显示器也可以适当的称为显示屏或显示单元,用于显示在电子设备1中处理的信息以及用于显示可视化的用户界面。Optionally, the electronic device 1 may further include a user interface, and the user interface may be a display (Display), an input unit (eg, a keyboard (Keyboard)), optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode, organic light-emitting diode) touch panel, and the like. The display may also be appropriately called a display screen or a display unit, which is used for displaying information processed in the electronic device 1 and for displaying a visualized user interface.
应该了解,所述实施例仅为说明之用,在专利申请范围上并不受此结构的限制。It should be understood that the embodiments are only used for illustration, and are not limited by this structure in the scope of the patent application.
所述电子设备1中的所述存储器11存储的非主动活体检测程序12是多个指令的组合,在所述处理器10中运行时,可以实现:The non-active living body detection program 12 stored in the memory 11 in the electronic device 1 is a combination of multiple instructions, and when running in the processor 10, can realize:
获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
具体地,所述处理器10对上述指令的具体实现方法可参考图1对应实施例中相关步骤的描述,在此不赘述。Specifically, for the specific implementation method of the above-mentioned instruction by the processor 10, reference may be made to the description of the relevant steps in the corresponding embodiment of FIG. 1, and details are not described herein.
进一步地,所述电子设备1集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。所述计算机可读存储介质可以是易失性的,也可以是非易失性的。例如,所述计算机可读介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(ROM,Read-Only Memory)。Further, if the modules/units integrated in the electronic device 1 are implemented in the form of software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disc, a computer memory, a read-only memory (ROM, Read-Only). Memory).
本申请还提供一种计算机可读存储介质,所述可读存储介质存储有计算机程序,所述计算机程序在被电子设备的处理器所执行时,可以实现:The present application also provides a computer-readable storage medium, where the readable storage medium stores a computer program, and when executed by a processor of an electronic device, the computer program can realize:
获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
在本申请所提供的几个实施例中,应该理解到,所揭露的设备,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。In the several embodiments provided in this application, it should be understood that the disclosed apparatus, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the modules is only a logical function division, and there may be other division manners in actual implementation.
所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既 可以采用硬件的形式实现,也可以采用硬件加软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units can be implemented in the form of hardware, or can be implemented in the form of hardware plus software function modules.
对于本领域技术人员而言,显然本申请不限于上述示范性实施例的细节,而且在不背离本申请的精神或基本特征的情况下,能够以其他的具体形式实现本申请。It will be apparent to those skilled in the art that the present application is not limited to the details of the above-described exemplary embodiments, but that the present application can be implemented in other specific forms without departing from the spirit or essential characteristics of the present application.
因此,无论从哪一点来看,均应将实施例看作是示范性的,而且是非限制性的,本申请的范围由所附权利要求而不是上述说明限定,因此旨在将落在权利要求的等同要件的含义和范围内的所有变化涵括在本申请内。不应将权利要求中的任何附关联图标记视为限制所涉及的权利要求。Accordingly, the embodiments are to be regarded in all respects as illustrative and not restrictive, and the scope of the application is to be defined by the appended claims rather than the foregoing description, which is therefore intended to fall within the scope of the claims. All changes within the meaning and scope of the equivalents of , are included in this application. Any reference signs in the claims shall not be construed as limiting the involved claim.
本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。The blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, and encryption algorithm. Blockchain, essentially a decentralized database, is a series of data blocks associated with cryptographic methods. Each data block contains a batch of network transaction information to verify its Validity of information (anti-counterfeiting) and generation of the next block. The blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
此外,显然“包括”一词不排除其他单元或步骤,单数不排除复数。系统权利要求中陈述的多个单元或装置也可以由一个单元或装置通过软件或者硬件来实现。第二等词语用来表示名称,而并不表示任何特定的顺序。Furthermore, it is clear that the word "comprising" does not exclude other units or steps and the singular does not exclude the plural. Several units or means recited in the system claims can also be realized by one unit or means by means of software or hardware. Second-class terms are used to denote names and do not denote any particular order.
最后应说明的是,以上实施例仅用以说明本申请的技术方案而非限制,尽管参照较佳实施例对本申请进行了详细说明,本领域的普通技术人员应当理解,可以对本申请的技术方案进行修改或等同替换,而不脱离本申请技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than limitations. Although the present application has been described in detail with reference to the preferred embodiments, those of ordinary skill in the art should understand that the technical solutions of the present application can be Modifications or equivalent substitutions can be made without departing from the spirit and scope of the technical solutions of the present application.

Claims (20)

  1. 一种非主动活体检测方法,其中,所述方法包括:A non-active liveness detection method, wherein the method comprises:
    获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
    对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
    根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
    将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
    利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
    根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
    获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
  2. 如权利要求1所述的非主动活体检测方法,其中,所述获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合,包括:The non-active liveness detection method according to claim 1, wherein the acquiring the original video screenshot, performing reference point selection on the original video screenshot, and obtaining an initial reference point set, comprising:
    将所述原始视频截图映射至预设的二维直角坐标系;mapping the original video screenshot to a preset two-dimensional rectangular coordinate system;
    在所述二维直角坐标系上随机选取所述原始视频截图中的多个参考点,生成初始参考点集合。Multiple reference points in the original video screenshot are randomly selected on the two-dimensional rectangular coordinate system to generate an initial reference point set.
  3. 如权利要求1所述的非主动活体检测方法,其中,所述对所述初始参考点集合进行位置扰动处理,得到目标参考点集合,包括:The non-active living body detection method according to claim 1, wherein the performing position disturbance processing on the initial reference point set to obtain the target reference point set, comprising:
    获取所述初始参考点集合中各个初始参考点的坐标值,得到所述初始参考点集合对应的初始坐标点集合;Obtain the coordinate value of each initial reference point in the initial reference point set, and obtain the initial coordinate point set corresponding to the initial reference point set;
    利用扰乱函数对所述初始坐标点集合进行扰乱计算,得到目标坐标点集合;Using the scrambling function to perform scrambling calculation on the initial coordinate point set to obtain the target coordinate point set;
    将所述目标坐标点集合映射至二维直角坐标系,得到目标参考点集合。The target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
  4. 如权利要求1所述的非主动活体检测方法,其中,所述根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,包括:The non-active liveness detection method according to claim 1, wherein the generating a geometric transformation matrix according to the initial reference point set and the target reference point set comprises:
    获取所述初始参考点集合中任意一初始参考点的第一任意坐标和所述目标参考点集合中任意一目标参考点的第二任意坐标;Obtain the first arbitrary coordinates of any one of the initial reference points in the set of initial reference points and the second arbitrary coordinates of any one of the target reference points in the set of target reference points;
    根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵。The first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
  5. 如权利要求4所述的非主动活体检测方法,其中,所述根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵,包括:The non-active living body detection method according to claim 4, wherein the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix, include:
    利用下述几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵:Use the following geometric transformation formula to calculate the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point, and obtain the geometric transformation matrix:
    b=Ha T b=Ha T
    其中,H为所述几何变换矩阵,b为所述第二任意坐标,a为所述第一任意坐标,T为固定参数。Wherein, H is the geometric transformation matrix, b is the second arbitrary coordinate, a is the first arbitrary coordinate, and T is a fixed parameter.
  6. 如权利要求1所述的非主动活体检测方法,其中,所述根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型,包括:The non-active living body detection method according to claim 1, wherein the non-active living body detection model constructed by the reference point analysis network and the binary classification network is iteratively optimized according to the final detection loss value. , get a trained non-active liveness detection model, including:
    判断所述最终检测损失值与预设的损失阈值之间的大小;judging the size between the final detection loss value and a preset loss threshold;
    若所述最终检测损失值小于所述预设的损失阈值,确定所述非主动活体检测模型为训练好的非主动活体检测模型;If the final detection loss value is less than the preset loss threshold, determine that the non-active living body detection model is a trained non-active living body detection model;
    若所述最终检测损失值大于或者等于所述预设的损失阈值时,调整所述非主动活体检测模型的内部参数,直至所述最终检测损失值小于所述预设的损失阈值时,得到训练好的非主动活体检测模型。If the final detection loss value is greater than or equal to the preset loss threshold, adjust the internal parameters of the inactive living body detection model, until the final detection loss value is less than the preset loss threshold, obtain training Good non-active liveness detection model.
  7. 如权利要求1至6中任一项所述的非主动活体检测方法,其中,所述利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,包括:The non-active living body detection method according to any one of claims 1 to 6, wherein the prediction reference point in the prediction reference point set and the preset real value are calculated by using a preset root mean square error loss function RMS loss values between reference points, including:
    利用下述预设的均方根误差损失函数公式计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值:Use the following preset root mean square error loss function formula to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point:
    Figure PCTCN2021097078-appb-100001
    Figure PCTCN2021097078-appb-100001
    其中,MSE为均方根误差损失值,y i为所述预测参考点,
    Figure PCTCN2021097078-appb-100002
    为所述真实参考点,n为所述预测参考点集合中预测参考点的总数,i是指第i个预测参考点。
    Among them, MSE is the root mean square error loss value, yi is the prediction reference point,
    Figure PCTCN2021097078-appb-100002
    is the real reference point, n is the total number of prediction reference points in the prediction reference point set, and i refers to the ith prediction reference point.
  8. 一种非主动活体检测装置,其中,所述装置包括:A non-active liveness detection device, wherein the device comprises:
    目标图像获取模块,用于获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;The target image acquisition module is used for acquiring original video screenshots, performing reference point selection on the original video screenshots to obtain an initial reference point set; performing position disturbance processing on the initial reference point set to obtain a target reference point set; according to the The initial reference point set and the target reference point set generate a geometric transformation matrix, and the original video screenshot is subjected to geometric transformation processing by using the geometric transformation matrix to obtain a target image;
    参考点分析模块,用于将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;a reference point analysis module, configured to input the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
    损失值计算模块,用于利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;The loss value calculation module is used to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point by using the preset root mean square error loss function, and calculate the Perform arithmetic operation on the square root loss value and the preset classification loss value of the two-class network to obtain the final detection loss value;
    模型训练模块,用于根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;A model training module, configured to perform iterative optimization processing on the non-active living detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value, to obtain a trained non-active living detection model;
    图像检测模块,用于获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。The image detection module is used for acquiring images to be recognized with a preset number of frames, and inputting the images to be recognized into the trained non-active living body detection model to obtain a non-active living body detection result.
  9. 一种电子设备,其中,所述电子设备包括:An electronic device, wherein the electronic device comprises:
    至少一个处理器;以及,at least one processor; and,
    与所述至少一个处理器通信连接的存储器;其中,a memory communicatively coupled to the at least one processor; wherein,
    所述存储器存储有可被所述至少一个处理器执行的指令,所述指令被所述至少一个处理器执行,以使所述至少一个处理器能够执行如下所述的非主动活体检测方法:The memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform an inactive liveness detection method as described below:
    获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
    对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
    根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
    将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
    利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
    根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
    获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
  10. 如权利要求9所述的电子设备,其中,所述对所述初始参考点集合进行位置扰动处理,得到目标参考点集合,包括:The electronic device according to claim 9, wherein the performing position perturbation processing on the initial reference point set to obtain the target reference point set comprises:
    获取所述初始参考点集合中各个初始参考点的坐标值,得到所述初始参考点集合对应的初始坐标点集合;Obtain the coordinate value of each initial reference point in the initial reference point set, and obtain the initial coordinate point set corresponding to the initial reference point set;
    利用扰乱函数对所述初始坐标点集合进行扰乱计算,得到目标坐标点集合;Using the scrambling function to perform scrambling calculation on the initial coordinate point set to obtain the target coordinate point set;
    将所述目标坐标点集合映射至二维直角坐标系,得到目标参考点集合。The target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
  11. 如权利要求9所述的电子设备,其中,所述根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,包括:The electronic device according to claim 9, wherein the generating a geometric transformation matrix according to the initial reference point set and the target reference point set comprises:
    获取所述初始参考点集合中任意一初始参考点的第一任意坐标和所述目标参考点集合中任意一目标参考点的第二任意坐标;Obtain the first arbitrary coordinates of any one of the initial reference points in the set of initial reference points and the second arbitrary coordinates of any one of the target reference points in the set of target reference points;
    根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵。The first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
  12. 如权利要求11所述的电子设备,其中,所述根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵,包括:The electronic device according to claim 11, wherein the first arbitrary coordinates and the second arbitrary coordinates of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain a geometric transformation matrix, comprising:
    利用下述几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵:Use the following geometric transformation formula to calculate the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point, and obtain the geometric transformation matrix:
    b=Ha T b=Ha T
    其中,H为所述几何变换矩阵,b为所述第二任意坐标,a为所述第一任意坐标,T为固定参数。Wherein, H is the geometric transformation matrix, b is the second arbitrary coordinate, a is the first arbitrary coordinate, and T is a fixed parameter.
  13. 如权利要求9所述的电子设备,其中,所述根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型,包括:The electronic device according to claim 9, wherein the inactive living body detection model constructed by the reference point analysis network and the binary classification network is iteratively optimized according to the final detection loss value to obtain training Good non-active liveness detection models include:
    判断所述最终检测损失值与预设的损失阈值之间的大小;judging the size between the final detection loss value and a preset loss threshold;
    若所述最终检测损失值小于所述预设的损失阈值,确定所述非主动活体检测模型为训练好的非主动活体检测模型;If the final detection loss value is less than the preset loss threshold, determine that the non-active living body detection model is a trained non-active living body detection model;
    若所述最终检测损失值大于或者等于所述预设的损失阈值时,调整所述非主动活体检测模型的内部参数,直至所述最终检测损失值小于所述预设的损失阈值时,得到训练好的非主动活体检测模型。If the final detection loss value is greater than or equal to the preset loss threshold, adjust the internal parameters of the inactive living body detection model, until the final detection loss value is less than the preset loss threshold, obtain training Good non-active liveness detection model.
  14. 如权利要求9至13中任一项所述的电子设备,其中,所述利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,包括:The electronic device according to any one of claims 9 to 13, wherein calculating the difference between the prediction reference point in the prediction reference point set and the preset real reference point by using a preset root mean square error loss function RMS loss values between , including:
    利用下述预设的均方根误差损失函数公式计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值:Use the following preset root mean square error loss function formula to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point:
    Figure PCTCN2021097078-appb-100003
    Figure PCTCN2021097078-appb-100003
    其中,MSE为均方根误差损失值,y i为所述预测参考点,
    Figure PCTCN2021097078-appb-100004
    为所述真实参考点,n为所述预测参考点集合中预测参考点的总数,i是指第i个预测参考点。
    Among them, MSE is the root mean square error loss value, y i is the prediction reference point,
    Figure PCTCN2021097078-appb-100004
    is the real reference point, n is the total number of prediction reference points in the prediction reference point set, and i refers to the ith prediction reference point.
  15. 一种计算机可读存储介质,存储有计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至7中任意一项所述的非主动活体检测方法:A computer-readable storage medium storing a computer program, wherein, when the computer program is executed by a processor, the non-active living body detection method according to any one of claims 1 to 7 is implemented:
    获取原始视频截图,对所述原始视频截图进行参考点选择,得到初始参考点集合;Obtain original video screenshots, and select reference points for the original video screenshots to obtain an initial reference point set;
    对所述初始参考点集合进行位置扰动处理,得到目标参考点集合;Performing position disturbance processing on the initial reference point set to obtain a target reference point set;
    根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,利用所述几何变换矩阵对所述原始视频截图进行几何变换处理,得到目标图像;Generate a geometric transformation matrix according to the initial reference point set and the target reference point set, and use the geometric transformation matrix to perform geometric transformation processing on the original video screenshot to obtain a target image;
    将所述原始视频截图、所述目标图像和所述初始参考点集合输入至预设的参考点分析网络中,得到预测参考点集合;Inputting the original video screenshot, the target image and the initial reference point set into a preset reference point analysis network to obtain a prediction reference point set;
    利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,并将所述均方根损失值与预设的二分类网络的分类损失值进行算术运算,得到最终检测损失值;Use the preset root mean square error loss function to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point, and compare the root mean square loss value with the preset root mean square loss value Perform arithmetic operations on the classification loss value of the binary classification network to obtain the final detection loss value;
    根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型;Perform iterative optimization processing on the non-active living body detection model constructed by the reference point analysis network and the two-classification network according to the final detection loss value to obtain a trained non-active living body detection model;
    获取预设帧数的待识别图像,将所述待识别图像输入至所述训练好的非主动活体检测模型中,得到非主动活体检测结果。Obtaining images to be recognized with a preset number of frames, inputting the images to be recognized into the trained non-active living body detection model, and obtaining a non-active living body detection result.
  16. 如权利要求15所述的计算机可读存储介质,其中,所述对所述初始参考点集合进行位置扰动处理,得到目标参考点集合,包括:The computer-readable storage medium according to claim 15, wherein the performing position perturbation processing on the initial reference point set to obtain the target reference point set comprises:
    获取所述初始参考点集合中各个初始参考点的坐标值,得到所述初始参考点集合对应的初始坐标点集合;Obtain the coordinate value of each initial reference point in the initial reference point set, and obtain the initial coordinate point set corresponding to the initial reference point set;
    利用扰乱函数对所述初始坐标点集合进行扰乱计算,得到目标坐标点集合;Using the scrambling function to perform scrambling calculation on the initial coordinate point set to obtain the target coordinate point set;
    将所述目标坐标点集合映射至二维直角坐标系,得到目标参考点集合。The target coordinate point set is mapped to a two-dimensional rectangular coordinate system to obtain a target reference point set.
  17. 如权利要求15所述的计算机可读存储介质,其中,所述根据所述初始参考点集合和所述目标参考点集合生成几何变换矩阵,包括:The computer-readable storage medium of claim 15, wherein the generating a geometric transformation matrix according to the initial reference point set and the target reference point set comprises:
    获取所述初始参考点集合中任意一初始参考点的第一任意坐标和所述目标参考点集合中任意一目标参考点的第二任意坐标;Obtain the first arbitrary coordinates of any one of the initial reference points in the set of initial reference points and the second arbitrary coordinates of any one of the target reference points in the set of target reference points;
    根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵。The first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix.
  18. 如权利要求17所述的计算机可读存储介质,其中,所述根据几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵,包括:The computer-readable storage medium according to claim 17, wherein the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point are calculated according to the geometric transformation formula to obtain the geometric transformation matrix, include:
    利用下述几何变换公式对初始参考点的坐标和目标参考点的坐标第一任意坐标和第二任意坐标进行计算,得到几何变换矩阵:Use the following geometric transformation formula to calculate the first arbitrary coordinate and the second arbitrary coordinate of the coordinates of the initial reference point and the coordinates of the target reference point, and obtain the geometric transformation matrix:
    b=Ha T b=Ha T
    其中,H为所述几何变换矩阵,b为所述第二任意坐标,a为所述第一任意坐标,T为固定参数。Wherein, H is the geometric transformation matrix, b is the second arbitrary coordinate, a is the first arbitrary coordinate, and T is a fixed parameter.
  19. 如权利要求15所述的计算机可读存储介质,其中,所述根据所述最终检测损失值对由所述参考点分析网络和所述二分类网络构建得到的非主动活体检测模型进行迭代优化处理,得到训练好的非主动活体检测模型,包括:The computer-readable storage medium according to claim 15, wherein the inactive living body detection model constructed by the reference point analysis network and the binary classification network is iteratively optimized according to the final detection loss value. , get a trained non-active liveness detection model, including:
    判断所述最终检测损失值与预设的损失阈值之间的大小;judging the size between the final detection loss value and a preset loss threshold;
    若所述最终检测损失值小于所述预设的损失阈值,确定所述非主动活体检测模型为训练好的非主动活体检测模型;If the final detection loss value is less than the preset loss threshold, determine that the non-active living body detection model is a trained non-active living body detection model;
    若所述最终检测损失值大于或者等于所述预设的损失阈值时,调整所述非主动活体检测模型的内部参数,直至所述最终检测损失值小于所述预设的损失阈值时,得到训练好的非主动活体检测模型。If the final detection loss value is greater than or equal to the preset loss threshold, adjust the internal parameters of the inactive living body detection model, until the final detection loss value is less than the preset loss threshold, obtain training Good non-active liveness detection model.
  20. 如权利要求15至19中任一项所述的计算机可读存储介质,其中,所述利用预设的均方根误差损失函数计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值,包括:The computer-readable storage medium according to any one of claims 15 to 19, wherein the prediction reference point in the prediction reference point set and the preset ground truth are calculated by using a preset root mean square error loss function RMS loss values between reference points, including:
    利用下述预设的均方根误差损失函数公式计算所述预测参考点集合中的预测参考点和预设的真实参考点之间的均方根损失值:Use the following preset root mean square error loss function formula to calculate the root mean square loss value between the prediction reference point in the prediction reference point set and the preset real reference point:
    Figure PCTCN2021097078-appb-100005
    Figure PCTCN2021097078-appb-100005
    其中,MSE为均方根误差损失值,y i为所述预测参考点,
    Figure PCTCN2021097078-appb-100006
    为所述真实参考点,n为所述预测参考点集合中预测参考点的总数,i是指第i个预测参考点。
    Among them, MSE is the root mean square error loss value, y i is the prediction reference point,
    Figure PCTCN2021097078-appb-100006
    is the real reference point, n is the total number of prediction reference points in the prediction reference point set, and i refers to the ith prediction reference point.
PCT/CN2021/097078 2021-04-28 2021-05-30 Inactive living body detection method and apparatus, electronic device, and storage medium WO2022227191A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110467269.0 2021-04-28
CN202110467269.0A CN113255456B (en) 2021-04-28 2021-04-28 Inactive living body detection method, inactive living body detection device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2022227191A1 true WO2022227191A1 (en) 2022-11-03

Family

ID=77222076

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/097078 WO2022227191A1 (en) 2021-04-28 2021-05-30 Inactive living body detection method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN113255456B (en)
WO (1) WO2022227191A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117579804A (en) * 2023-11-17 2024-02-20 广东筠诚建筑科技有限公司 AR-based prefabricated building component pre-layout experience method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110674759A (en) * 2019-09-26 2020-01-10 深圳市捷顺科技实业股份有限公司 Monocular face in-vivo detection method, device and equipment based on depth map
US20200019760A1 (en) * 2018-07-16 2020-01-16 Alibaba Group Holding Limited Three-dimensional living-body face detection method, face authentication recognition method, and apparatuses
CN111368731A (en) * 2020-03-04 2020-07-03 上海东普信息科技有限公司 Silent in-vivo detection method, silent in-vivo detection device, silent in-vivo detection equipment and storage medium
CN111860055A (en) * 2019-04-29 2020-10-30 北京眼神智能科技有限公司 Face silence living body detection method and device, readable storage medium and equipment
CN112215298A (en) * 2020-10-21 2021-01-12 平安国际智慧城市科技股份有限公司 Model training method, device, equipment and readable storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9129190B1 (en) * 2013-12-04 2015-09-08 Google Inc. Identifying objects in images
CN110163033B (en) * 2018-02-13 2022-04-22 京东方科技集团股份有限公司 Positive sample acquisition method, pedestrian detection model generation method and pedestrian detection method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200019760A1 (en) * 2018-07-16 2020-01-16 Alibaba Group Holding Limited Three-dimensional living-body face detection method, face authentication recognition method, and apparatuses
CN111860055A (en) * 2019-04-29 2020-10-30 北京眼神智能科技有限公司 Face silence living body detection method and device, readable storage medium and equipment
CN110674759A (en) * 2019-09-26 2020-01-10 深圳市捷顺科技实业股份有限公司 Monocular face in-vivo detection method, device and equipment based on depth map
CN111368731A (en) * 2020-03-04 2020-07-03 上海东普信息科技有限公司 Silent in-vivo detection method, silent in-vivo detection device, silent in-vivo detection equipment and storage medium
CN112215298A (en) * 2020-10-21 2021-01-12 平安国际智慧城市科技股份有限公司 Model training method, device, equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117579804A (en) * 2023-11-17 2024-02-20 广东筠诚建筑科技有限公司 AR-based prefabricated building component pre-layout experience method and device
CN117579804B (en) * 2023-11-17 2024-05-14 广东筠诚建筑科技有限公司 AR-based prefabricated building component pre-layout experience method and device

Also Published As

Publication number Publication date
CN113255456A (en) 2021-08-13
CN113255456B (en) 2023-08-25

Similar Documents

Publication Publication Date Title
WO2022213465A1 (en) Neural network-based image recognition method and apparatus, electronic device, and medium
WO2022105179A1 (en) Biological feature image recognition method and apparatus, and electronic device and readable storage medium
CN112699775B (en) Certificate identification method, device, equipment and storage medium based on deep learning
WO2021189855A1 (en) Image recognition method and apparatus based on ct sequence, and electronic device and medium
WO2022048209A1 (en) License plate recognition method and apparatus, electronic device, and storage medium
CN112507934A (en) Living body detection method, living body detection device, electronic apparatus, and storage medium
CN112231586A (en) Course recommendation method, device, equipment and medium based on transfer learning
CN111932534B (en) Medical image picture analysis method and device, electronic equipment and readable storage medium
WO2022141858A1 (en) Pedestrian detection method and apparatus, electronic device, and storage medium
CN111985504B (en) Copying detection method, device, equipment and medium based on artificial intelligence
WO2022227192A1 (en) Image classification method and apparatus, and electronic device and medium
WO2022126914A1 (en) Living body detection method and apparatus, electronic device, and storage medium
CN113887408B (en) Method, device, equipment and storage medium for detecting activated face video
WO2021189856A1 (en) Certificate check method and apparatus, and electronic device and medium
CN112507923A (en) Certificate copying detection method and device, electronic equipment and medium
CN112528909A (en) Living body detection method, living body detection device, electronic apparatus, and computer-readable storage medium
WO2021068613A1 (en) Face recognition method and apparatus, device and computer-readable storage medium
CN113705469A (en) Face recognition method and device, electronic equipment and computer readable storage medium
CN114913371B (en) Multi-task learning model training method and device, electronic equipment and storage medium
WO2022227191A1 (en) Inactive living body detection method and apparatus, electronic device, and storage medium
CN113723280B (en) Method, device, equipment and medium for detecting countermeasure sample based on static face
CN112101191A (en) Expression recognition method, device, equipment and medium based on frame attention network
CN112541436B (en) Concentration analysis method and device, electronic equipment and computer storage medium
WO2023134080A1 (en) Method and apparatus for identifying camera spoofing, device, and storage medium
CN113869455B (en) Unsupervised clustering method and device, electronic equipment and medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21938661

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21938661

Country of ref document: EP

Kind code of ref document: A1