Disclosure of Invention
In view of this, the present disclosure provides a heart rate detection method and apparatus to improve accuracy and robustness of heart rate detection.
According to an aspect of the present disclosure, there is provided a heart rate detection method, including:
intercepting a face area in each video frame of a video frame sequence to obtain a face area image corresponding to each video frame;
extracting the characteristics of skin areas in the face area images through a convolutional neural network;
and determining the heart rate corresponding to the video frame sequence according to the characteristics of the skin area in each face area image.
In a possible implementation manner, determining a heart rate corresponding to the video frame sequence according to a feature of a skin region in each of the face region images includes:
determining the characteristics corresponding to a plurality of groups of continuous frames according to the characteristics of skin areas in each face area image corresponding to the video frame sequence;
and inputting the characteristics corresponding to the multiple groups of continuous frames into a fully-connected neural network to obtain the heart rate corresponding to the video frame sequence.
In one possible implementation manner, extracting features of skin regions in each face region image through a convolutional neural network includes:
adjusting the frame rate of a face region image sequence corresponding to the video frame sequence according to the input frame rate of the convolutional neural network, wherein the face region image sequence is an image sequence obtained according to each face region image corresponding to the video frame sequence;
and inputting the human face region image sequence with the adjusted frame rate into the convolutional neural network to obtain the characteristics of the skin region in each human face region image in the human face region image sequence.
In one possible implementation, before extracting the features of the skin region in each face region image through the convolutional neural network, the method further includes:
and training the convolutional neural network and the fully-connected neural network by adopting a training data set, wherein the training data set comprises a human face video frame sequence and a heart rate corresponding to the human face video frame sequence.
According to another aspect of the present disclosure, there is provided a heart rate detection apparatus comprising:
the intercepting module is used for intercepting a face area in each video frame of the video frame sequence to obtain a face area image corresponding to each video frame;
the feature extraction module is used for extracting the features of the skin areas in the face area images through a convolutional neural network;
and the heart rate determining module is used for determining the heart rate corresponding to the video frame sequence according to the characteristics of the skin area in each face area image.
In one possible implementation, the heart rate determination module includes:
the first determining submodule is used for determining the characteristics corresponding to a plurality of groups of continuous frames according to the characteristics of skin areas in each face area image corresponding to the video frame sequence;
and the second determining submodule is used for inputting the characteristics corresponding to the multiple groups of continuous frames into the fully-connected neural network to obtain the heart rate corresponding to the video frame sequence.
In one possible implementation, the feature extraction module includes:
a frame rate adjusting submodule, configured to adjust a frame rate of a face area image sequence corresponding to the video frame sequence according to an input frame rate of the convolutional neural network, where the face area image sequence is an image sequence obtained according to each face area image corresponding to the video frame sequence;
and the feature extraction submodule is used for inputting the face region image sequence with the frame rate adjusted into the convolutional neural network to obtain the features of the skin regions in the face region images in the face region image sequence.
In one possible implementation, the apparatus further includes:
the training module is used for training the convolutional neural network and the fully-connected neural network by adopting a training data set, wherein the training data set comprises a human face video frame sequence and a heart rate corresponding to the human face video frame sequence.
According to another aspect of the present disclosure, there is provided a heart rate detection apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the above method.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the above-described method.
The heart rate detection method and the heart rate detection device in each aspect of the disclosure obtain the face area images corresponding to each video frame by intercepting the face areas in each video frame of the video frame sequence, extract the features of the skin areas in each face area image through the convolutional neural network, and determine the heart rate corresponding to the video frame sequence according to the features of the skin areas in each face area image, thereby improving the accuracy and robustness of heart rate detection.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
Fig. 1 shows a flow chart of a heart rate detection method according to an embodiment of the present disclosure. As shown in fig. 1, the method includes steps S11 through S13.
In step S11, a face region in each video frame of the sequence of video frames is captured to obtain a face region image corresponding to each video frame.
In a possible implementation manner, a video acquisition device may be used to acquire a video including a face region, obtain a video frame sequence according to the video including the face region, and locate a face feature point in each video frame of the video frame sequence by using a face feature point location method, so as to determine the face region in each video frame of the video frame sequence.
Fig. 2 is a schematic diagram illustrating human face feature points in a certain video frame in a heart rate detection method according to an embodiment of the disclosure.
Fig. 3 is a schematic diagram illustrating a face region image corresponding to a certain video frame in a heart rate detection method according to an embodiment of the disclosure.
In step S12, the features of the skin region in each face region image are extracted by the convolutional neural network.
In a possible implementation manner, each face region image may be subjected to feature extraction through a convolutional neural network. And the convolutional neural network shares a weight value for each face region image.
In this embodiment, by avoiding non-skin areas such as eyes and eyebrows in the face area image and extracting only the features of the skin area, it is possible to avoid the non-skin areas from reducing the signal intensity of the blood flow change reflected by the extracted features, and thus the accuracy and reliability of the determined heart rate can be improved.
In a possible implementation manner, the extracting, by the convolutional neural network, the features of the skin region in each face region image may be: and extracting the characteristic vectors of the skin areas in the face area images through a convolutional neural network.
In step S13, a heart rate corresponding to the video frame sequence is determined according to the features of the skin area in each face area image.
In one possible implementation, the heart rate corresponding to the sequence of video frames may be determined by a fully connected neural network.
In another possible implementation manner, the heart rate signal corresponding to each video frame may be determined according to the feature of the skin region in each face region image, and the heart rate corresponding to the sequence of video frames may be determined according to the heart rate signal corresponding to each video frame.
In the embodiment, the face area in each video frame of the video frame sequence is intercepted to obtain the face area image corresponding to each video frame, the skin area characteristics in each face area image are extracted through the convolutional neural network, and the heart rate corresponding to the video frame sequence is determined according to the skin area characteristics in each face area image, so that the heart rate detection accuracy and robustness can be improved.
Fig. 4 shows an exemplary flowchart of step S13 of the heart rate detection method according to an embodiment of the present disclosure. As shown in fig. 4, step S13 may include step S131 and step S132.
In step S131, the features corresponding to multiple groups of continuous frames are determined according to the features of the skin regions in the face region images corresponding to the video frame sequence.
In a possible implementation manner, determining, according to features of skin regions in each face region image corresponding to a sequence of video frames, features corresponding to multiple groups of consecutive frames may be: and determining the characteristic vectors corresponding to a plurality of groups of continuous frames according to the characteristic vectors of the skin areas in the face area images corresponding to the video frame sequence. For example, the numbers of the respective video frames in the video frame sequence are 1 to 100 in this order, and the video frames numbered 1 to 20 may be taken as a first group of consecutive frames, the video frames numbered 21 to 40 may be taken as a second group of consecutive frames, the video frames numbered 41 to 60 may be taken as a third group of consecutive frames, the video frames numbered 61 to 80 may be taken as a fourth group of consecutive frames, and the video frames numbered 81 to 100 may be taken as a fifth group of consecutive frames. Taking the first group of continuous frames as an example, the feature vector corresponding to the first group of continuous frames can be determined according to the feature vector corresponding to each video frame in the first group of continuous frames, that is, according to the feature vector of the skin region in the face region image corresponding to each video frame in the first group of continuous frames.
In step S132, the features corresponding to the multiple groups of consecutive frames are input into the fully-connected neural network, so as to obtain the heart rate corresponding to the sequence of video frames.
Wherein, a fully-connected neural network may refer to a neural network of a fully-connected structure. In this embodiment, the fully-connected neural network may be used to derive the heart rate from the corresponding features of the consecutive frames. That is, the input of the fully-connected neural network may be the features corresponding to consecutive frames, and the output of the fully-connected neural network may be the heart rate.
In a possible implementation manner, the fully-connected neural network can perform regression processing on the heart rate data according to the characteristics corresponding to the multiple groups of continuous frames, so as to output a relatively accurate heart rate.
Fig. 5 shows an exemplary flowchart of step S12 of the heart rate detection method according to an embodiment of the present disclosure. As shown in fig. 5, step S12 may include step S121 and step S122.
In step S121, the frame rate of a face region image sequence corresponding to the video frame sequence is adjusted according to the input frame rate of the convolutional neural network, where the face region image sequence is an image sequence obtained according to each face region image corresponding to the video frame sequence.
In a possible implementation manner, when the frame rate of the face region image sequence is less than the input frame rate of the convolutional neural network, the frame rate of the face region image sequence may be adjusted in an interpolation manner, so that the frame rate of the adjusted face region image sequence is equal to the input frame rate of the convolutional neural network.
In step S122, the sequence of the face region images with the frame rate adjusted is input into a convolutional neural network, so as to obtain the features of the skin regions in the face region images in the sequence of the face region images.
In one possible implementation, before extracting the features of the skin regions in the respective face region images through the convolutional neural network, the method may further include: and training the convolutional neural network and the fully-connected neural network by adopting a training data set, wherein the training data set comprises a human face video frame sequence and a heart rate corresponding to the human face video frame sequence.
The training data set may be a standard data set or a self-made data set, and is not limited herein.
In the implementation mode, the convolutional neural network and the fully-connected neural network are trained on a training data set, so that the trained convolutional neural network can extract the characteristics of the skin area from the face area image, and the trained fully-connected neural network can determine the heart rate according to the characteristics of the skin area in the face area image.
Fig. 6 shows a block diagram of a heart rate detection device according to an embodiment of the present disclosure. As shown in fig. 6, the apparatus includes: an intercepting module 61, configured to intercept a face region in each video frame of a video frame sequence, to obtain a face region image corresponding to each video frame; a feature extraction module 62, configured to extract features of skin regions in each of the face region images through a convolutional neural network; and a heart rate determining module 63, configured to determine a heart rate corresponding to the sequence of video frames according to features of skin regions in the face region images.
Fig. 7 illustrates an exemplary block diagram of a heart rate detection device according to an embodiment of the present disclosure. As shown in fig. 7:
in one possible implementation, the heart rate determining module 63 includes: the first determining sub-module 631 is configured to determine, according to the features of the skin regions in the face region images corresponding to the video frame sequence, features corresponding to multiple groups of consecutive frames; the second determining submodule 632 is configured to input features corresponding to multiple groups of consecutive frames into the fully-connected neural network, so as to obtain a heart rate corresponding to the sequence of video frames.
In one possible implementation, the feature extraction module 62 includes: the frame rate adjusting submodule 621 is configured to adjust, according to an input frame rate of the convolutional neural network, a frame rate of a face area image sequence corresponding to the video frame sequence, where the face area image sequence is an image sequence obtained according to each face area image corresponding to the video frame sequence; and the feature extraction sub-module 622 is configured to input the sequence of the face region images with the adjusted frame rate into the convolutional neural network, so as to obtain features of skin regions in each face region image in the sequence of the face region images.
In one possible implementation, the apparatus further includes: a training module 64, configured to train the convolutional neural network and the fully-connected neural network by using a training data set, where the training data set includes a human face video frame sequence and a heart rate corresponding to the human face video frame sequence.
In the embodiment, the face area in each video frame of the video frame sequence is intercepted to obtain the face area image corresponding to each video frame, the skin area characteristics in each face area image are extracted through the convolutional neural network, and the heart rate corresponding to the video frame sequence is determined according to the skin area characteristics in each face area image, so that the heart rate detection accuracy and robustness can be improved.
Fig. 8 is a block diagram illustrating an apparatus 800 for heart rate detection according to an example embodiment. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the device 800 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.