WO2021238373A1 - 一种人脸注视解锁方法及电子设备 - Google Patents

一种人脸注视解锁方法及电子设备 Download PDF

Info

Publication number
WO2021238373A1
WO2021238373A1 PCT/CN2021/082993 CN2021082993W WO2021238373A1 WO 2021238373 A1 WO2021238373 A1 WO 2021238373A1 CN 2021082993 W CN2021082993 W CN 2021082993W WO 2021238373 A1 WO2021238373 A1 WO 2021238373A1
Authority
WO
WIPO (PCT)
Prior art keywords
gaze
image
electronic device
face
scene
Prior art date
Application number
PCT/CN2021/082993
Other languages
English (en)
French (fr)
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 WO2021238373A1 publication Critical patent/WO2021238373A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/31User authentication
    • G06F21/32User authentication using biometric data, e.g. fingerprints, iris scans or voiceprints
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • This application relates to the field of terminal technology, and in particular to a method for unlocking a face by gaze and an electronic device.
  • face unlocking and payment functions on electronic devices have become popular.
  • electronic devices for example, mobile phones, tablet computers, etc.
  • face unlocking and payment functions on electronic devices have become popular.
  • most face unlocking adds the function of face gaze to prevent others from using their own mobile phone in an involuntary situation, such as when I am asleep or forced to use the mobile phone by others Scanning the face and other scenes) unlock the mobile phone, thereby peeping and stealing user information.
  • the prior art uses a face gaze unlocking scheme to unlock.
  • various factors such as the posture of the electronic device, ambient lighting, and shooting distance will affect the face gaze recognition. Misrecognition of the face-gazing picture as a non-gazing picture will make the unlocking fail and affect the unlocking experience of the user. It is also possible that the non-gazing picture will be mistakenly recognized as a gazing picture, thereby making the unlocking successful and reducing the security of the unlocking.
  • the embodiments of the present application provide a method and electronic device for unlocking the face gaze, which are used to improve the accuracy of unlocking the face gaze in a complex scene.
  • an embodiment of the present application provides a face gaze unlocking method, which can be executed by an electronic device.
  • the method includes: the electronic device collects a first image, acquires sensor data in the electronic device when the first image is collected, and determines scene information based on the first image and the sensor data, where the scene information includes at least one of the following : Current light intensity, shooting distance, posture of electronic equipment, camera temperature.
  • the electronic device extracts the face, eye feature information, and face posture information from the first image, and locates the first behavior scene corresponding to the first image according to the scene information and the face posture information, and the first behavior scene is abnormal behavior
  • the image optimizer corresponding to the first behavior scene is used to optimize the face and eye feature information to obtain the optimized face and eye feature information, and then the optimized face and eye feature information Input into the gaze model to obtain the gaze score, and unlock when it is determined that the gaze score is greater than the gaze score threshold.
  • the current behavior scene is located, and then the corresponding image optimizer is matched to optimize the facial and eye feature information according to the behavior scene.
  • the noise of the input data of the gaze model is reduced in a targeted manner, and the effectiveness of the data is enhanced, so that the accuracy of unlocking the face gaze in complex scenes can be improved, and the rate of non-gaze unlocking can be reduced.
  • the electronic device may also determine the device posture of the electronic device according to the sensor data, and determine that the electronic device is in the The deflection angle between the direction of the long axis of the screen when the device is in the posture and the direction of the long axis of the screen when the electronic device is in the vertical screen state, the first image is rotated by the deflection angle.
  • the electronic device when it is determined that the gaze score is greater than the gaze score threshold, the electronic device can also set different gaze score thresholds for different abnormal behavior scenarios before unlocking.
  • Two possible implementation methods are provided as follows: 1. The electronic device determines the preset score threshold corresponding to the first behavior scene according to the first behavior scene and the first correspondence, and uses the preset score threshold corresponding to the first behavior scene information as the gaze score threshold, where the first behavior The corresponding relationship includes the corresponding relationship between the preset behavior scene and the preset score threshold.
  • Implementation mode two the electronic device determines the dynamic threshold range corresponding to the first behavior scene, determines a dynamic threshold value from the dynamic threshold range corresponding to the first behavior scene according to the scene information, and determines a dynamic threshold value according to the static threshold value corresponding to the normal behavior scene and the determined Dynamic threshold, which determines the gaze score threshold.
  • setting the gaze threshold according to the behavior scene can not only obtain a detection result of face gaze closer to the real situation, improve the user's unlocking experience, but also enhance the gaze model in certain specific scenes. Robustness and generalization.
  • the method further includes: acquiring a fixation image set and a non-fixation image set, the fixation image set includes fixation images collected in each preset behavior scene, and the non-fixation image set includes each preset behavior Non-gaze images collected under the scene; for each gaze image in the gaze image set, the image optimizer corresponding to the behavior scene when the gaze image is collected is used to optimize the facial and eye feature information in the gaze image, Obtain the optimized first face and eye feature information; for each non-gaze image in the non-gaze image set, the image optimizer corresponding to the behavior scene when collecting the gaze image is used to treat the person in the non-gaze image Face and eye feature information is optimized to obtain optimized second face and eye feature information; for each optimized first face, eye feature information, and each optimized second face, eye Set the behavior scene label for the facial feature information; input the optimized first face and eye feature information with the behavior scene label and the optimized second face and eye feature information with the behavior scene tag to the neural network Model training is performed in the model to obtain a gaze model
  • training samples with behavioral scene labels are used to train the neural network model, and a gaze model that accurately recognizes the category of the image to be detected can be obtained, thereby improving the accuracy of face gaze unlocking.
  • the sensor data includes at least one of the following: data collected by a posture sensor in an electronic device, data collected by a distance sensor, data collected by an ambient light sensor, and data collected by a temperature sensor.
  • an embodiment of the present application also provides an electronic device.
  • the electronic device includes a processor and a memory; the memory is used to store images and one or more computer programs; when the one or more computer programs stored in the memory are executed by the processor, the electronic device.
  • an embodiment of the present application also provides an electronic device.
  • the electronic device includes modules/units that execute the above-mentioned first aspect or any one of the possible design methods of the first aspect; these modules/units can be Hardware implementation can also be implemented by hardware executing corresponding software.
  • the fourth aspect is a chip of an embodiment of the present application, which is coupled with a memory in an electronic device, and executes the first aspect of the embodiment of the present application and any possible design technical solution of the first aspect; in the embodiment of the present application "Coupled” means that two components are directly or indirectly joined to each other.
  • a computer-readable storage medium in a fifth aspect, includes computer instructions.
  • the computer instructions run on an electronic device, the electronic device executes the first embodiment of the present application. Aspect and any possible design technical solutions of the first aspect.
  • a program product in the embodiments of the present application includes instructions that when the program product runs on an electronic device, the electronic device is caused to execute the first aspect of the embodiments of the present application and any one of the first aspects thereof. Possible technical solutions designed.
  • FIG. 1 is a schematic diagram of the structure of an electronic device provided by an embodiment of the application.
  • FIG. 2 is a block diagram of the software structure of an electronic device provided by an embodiment of the application.
  • FIG. 3 is a schematic diagram of a training process for face gaze detection according to an embodiment of the application.
  • FIG. 4 is a schematic flowchart of a face gaze unlocking method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of a user's face provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of the horizontal screen state and the vertical screen state of an electronic device according to an embodiment of the application;
  • FIG. 7 is a schematic diagram of a user's face provided by an embodiment of the application.
  • FIG. 8 is a schematic flowchart of another method for unlocking face gaze according to an embodiment of the application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of this application.
  • the various embodiments disclosed in the present application can be applied to an electronic device, which can realize the unlocking function of the face gaze.
  • the electronic device may be a portable terminal, such as a mobile phone, a tablet computer, a wearable device with wireless communication function (such as a smart watch), a camera, a notebook, and the like.
  • the portable terminal includes a device (such as a processor) that can collect images and perform feature extraction on the collected images.
  • Exemplary embodiments of portable terminals include, but are not limited to, carrying Or portable terminals with other operating systems.
  • the above-mentioned portable terminal may also be other portable terminals, as long as it can collect images and perform image processing on the collected images (for example, feature information or posture information extraction, optimization, gaze scores, etc.). It should also be understood that in some other embodiments of the present application, the above-mentioned electronic device may not be a portable terminal, but may be able to collect images and perform image processing on the collected graphics (such as feature information or posture information extraction and optimization to obtain Look at the score, etc.) of the desktop computer.
  • the electronic device may also not need to have the function of image processing (for example, feature information or posture information extraction, optimization, obtaining gaze score, etc.), but may have a communication function.
  • image processing for example, feature information or posture information extraction, optimization, obtaining gaze score, etc.
  • the electronic device can send the image to other devices such as a server, and the other devices use the face gaze unlocking method provided in the embodiments of this application to perform image processing on the image (such as feature information or posture information extraction and optimization, Obtain the gaze score, etc.), and then send the image processing result to the electronic device, and the electronic device determines whether to unlock according to the image processing result.
  • FIG. 1 shows a schematic diagram of the structure of an electronic device 100.
  • the illustrated electronic device 100 is only an example, and the electronic device 100 may have more or fewer components than shown in the figure, may combine two or more components, or may have different Component configuration.
  • the various components shown in the figure may be implemented in hardware, software, or a combination of hardware and software including one or more signal processing and/or application specific integrated circuits.
  • the electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, and a battery 142 , Antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, earphone jack 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193 , The display screen 194, and the subscriber identification module (SIM) card interface 195, etc.
  • SIM subscriber identification module
  • the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and ambient light Sensor 180L, bone conduction sensor 180M, etc.
  • the processor 110 may include one or more processing units.
  • the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), and an image signal processor. (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU) Wait.
  • AP application processor
  • GPU graphics processing unit
  • ISP image signal processor
  • controller memory
  • video codec digital signal processor
  • DSP digital signal processor
  • NPU neural-network processing unit
  • the different processing units may be independent devices or integrated in one or more processors.
  • the controller may be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.
  • a memory may also be provided in the processor 110 to store instructions and data.
  • the memory in the processor 110 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 110. If the processor 110 needs to use the instruction or data again, it can be directly called from the memory, so that repeated accesses can be avoided, the waiting time of the processor 110 can be reduced, and the efficiency of the system can be improved.
  • the processor 110 may run the software code of the face gaze unlocking method provided in the embodiment of the present application.
  • the processor 110 integrates different devices, such as integrated CPU and GPU, the CPU and GPU can cooperate to execute the face gaze unlocking method provided in the embodiment of the present application.
  • some of the algorithms in the face gaze unlocking method are executed by the CPU, and the other part of the algorithm Executed by GPU to get faster processing efficiency.
  • the processor 110 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (PCM) interface, and a universal asynchronous transceiver ( universal asynchronous receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface , And/or Universal Serial Bus (USB) interface, etc.
  • I2C integrated circuit
  • I2S integrated circuit built-in audio
  • PCM pulse code modulation
  • UART universal asynchronous transceiver
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100.
  • the external memory card communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, save files such as music, video, and collected images in an external memory card.
  • the internal memory 121 may be used to store computer executable program code, where the executable program code includes instructions.
  • the internal memory 121 may include a storage program area and a storage data area.
  • the storage program area can store an operating system, at least one application program (such as a sound playback function, an image playback function, etc.) required by at least one function.
  • the data storage area can store data (such as sensor data, collected images, etc.) created during the use of the electronic device 100.
  • the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, a universal flash storage (UFS), and the like.
  • the processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and/or instructions stored in a memory provided in the processor.
  • the internal memory 121 may also store the software code of the face gaze unlocking method provided in the embodiment of the present application.
  • the processor 110 runs the code, it executes the following face gaze unlocking process to realize the face gaze unlocking function.
  • the internal memory 121 may also store other content.
  • the internal memory 121 stores a first corresponding relationship between a preset behavior scene and a preset score threshold, and the processor 110 locates the first behavior corresponding to the first image.
  • the preset score threshold corresponding to the first behavior scene may be determined according to the first correspondence between the first behavior scene and the internal memory 121 as the gaze score threshold.
  • the processor 110 may determine whether to unlock according to the determined gaze score and the gaze score threshold.
  • the internal memory 121 may also store the dynamic threshold range corresponding to the preset behavior scene. For example, after the electronic device 100 locates the first behavior scene corresponding to the first image, it may perform the preset behavior according to the preset behavior stored in the internal memory 121.
  • the dynamic threshold range corresponding to the scene is determined to determine the dynamic threshold range corresponding to the first behavior scene. Then, according to the scene information, a dynamic threshold is determined from the dynamic threshold range corresponding to the first behavior scene, and then according to the static threshold and the static threshold corresponding to the default scene. Determine the dynamic threshold, determine the gaze score threshold. Furthermore, the processor 110 may determine whether to unlock according to the determined gaze score and the gaze score threshold.
  • the internal memory 121 may also store other content mentioned below, such as a gaze model.
  • the wireless communication function of the electronic device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor.
  • the antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals.
  • Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization.
  • antenna 1 can be multiplexed as a diversity antenna of a wireless local area network.
  • the antenna can be used in combination with a tuning switch.
  • the mobile communication module 150 may provide a wireless communication solution including 2G/3G/4G/5G and the like applied to the electronic device 100.
  • the mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), and the like.
  • the mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform processing such as filtering, amplifying and transmitting the received electromagnetic waves to the modem processor for demodulation.
  • the mobile communication module 150 can also amplify the signal modulated by the modem processor, and convert it into electromagnetic wave radiation via the antenna 1.
  • at least part of the functional modules of the mobile communication module 150 may be provided in the processor 110.
  • at least part of the functional modules of the mobile communication module 150 and at least part of the modules of the processor 110 may be provided in the same device.
  • the modem processor may include a modulator and a demodulator.
  • the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal.
  • the demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal.
  • the demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing.
  • the low-frequency baseband signal is processed by the baseband processor and then passed to the application processor.
  • the application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays an image or video through the display screen 194.
  • the modem processor may be an independent device.
  • the modem processor may be independent of the processor 110 and be provided in the same device as the mobile communication module 150 or other functional modules.
  • the wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), and global navigation satellites.
  • WLAN wireless local area networks
  • BT wireless fidelity
  • GNSS global navigation satellite system
  • FM frequency modulation
  • NFC near field communication technology
  • infrared technology infrared, IR
  • the wireless communication module 160 may be one or more devices integrating at least one communication processing module.
  • the wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110.
  • the wireless communication module 160 may also receive a signal to be sent from the processor 110, perform frequency modulation, amplify it, and convert it into electromagnetic waves to radiate through the antenna 2.
  • the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology, for example,
  • the captured images are sent to other devices, processed by other devices to determine whether it can be unlocked, and then receive the results sent by other devices.
  • the pressure sensor 180A is used to sense the pressure signal and can convert the pressure signal into an electrical signal.
  • the pressure sensor 180A may be provided on the display screen 194.
  • the capacitance between the electrodes changes.
  • the electronic device 100 determines the intensity of the pressure according to the change in capacitance.
  • the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A.
  • the electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A.
  • touch operations that act on the same touch position but have different touch operation intensities can correspond to different operation instructions.
  • the gyro sensor 180B may be used to determine the movement posture of the electronic device 100. In some embodiments, the angular velocity of the electronic device 100 around three axes (ie, x, y, and z axes) can be determined by the gyroscope sensor 180B. The gyro sensor 180B can be used for image stabilization. The gyro sensor 180B can also be used for navigation and somatosensory game scenes.
  • the acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). When the electronic device 100 is stationary, the magnitude and direction of gravity can be detected. It can also be used to identify the posture of electronic devices, and be used in applications such as horizontal and vertical screen switching, pedometers and so on.
  • the electronic device 100 can measure the distance by infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 may use the distance sensor 180F to measure the distance to achieve fast focusing.
  • Touch sensor 180K also called “touch panel”.
  • the touch sensor 180K may be provided on the display screen 194, and the touch screen is composed of the touch sensor 180K and the display screen 194, which is also called a “touch screen”.
  • the touch sensor 180K is used to detect touch operations acting on or near it.
  • the touch sensor can pass the detected touch operation to the application processor to determine the type of touch event.
  • the visual output related to the touch operation can be provided through the display screen 194.
  • the touch sensor 180K may also be disposed on the surface of the electronic device 100, which is different from the position of the display screen 194.
  • the ambient light sensor 180L is used to sense the brightness of the ambient light.
  • the electronic device 100 can adaptively adjust the brightness of the display screen 194 according to the perceived brightness of the ambient light.
  • the ambient light sensor 180L can also be used to automatically adjust the white balance when taking pictures.
  • the ambient light sensor 180L can also cooperate with the proximity light sensor 180G to detect whether the electronic device 100 is in the pocket to prevent accidental touch.
  • the temperature sensor 180J is used to detect temperature.
  • the electronic device 100 uses the temperature detected by the temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by the temperature sensor 180J exceeds a threshold value, the electronic device 100 reduces the performance of the processor located near the temperature sensor 180J, so as to reduce power consumption and implement thermal protection.
  • the electronic device 100 when the temperature is lower than another threshold, the electronic device 100 heats the battery 142 to avoid abnormal shutdown of the electronic device 100 due to low temperature.
  • the electronic device 100 boosts the output voltage of the battery 142 to avoid abnormal shutdown caused by low temperature.
  • the button 190 includes a power-on button, a volume button, and so on.
  • the button 190 may be a mechanical button or a touch button.
  • the electronic device 100 may receive key input, and generate key signal input related to user settings and function control of the electronic device 100.
  • the electronic device 100 can realize a shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, and an application processor.
  • the ISP is used to process the data fed back from the camera 193. For example, when taking a picture, the shutter is opened, the light is transmitted to the photosensitive element of the camera through the lens, the light signal is converted into an electrical signal, and the photosensitive element of the camera transfers the electrical signal to the ISP for processing and is converted into an image visible to the naked eye.
  • ISP can also optimize the image noise, brightness, and skin color. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene.
  • the ISP may be provided in the camera 193.
  • the camera 193 is used to capture still images or videos.
  • the object generates an optical image through the lens and is projected to the photosensitive element.
  • the photosensitive element may be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor.
  • CMOS complementary metal-oxide-semiconductor
  • the photosensitive element converts the optical signal into an electrical signal, and then transfers the electrical signal to the ISP to convert it into a digital image signal.
  • ISP outputs digital image signals to DSP for processing.
  • DSP converts digital image signals into standard RGB, YUV and other formats of image signals.
  • the electronic device 100 may include one or N cameras 193, and N is a positive integer greater than one.
  • the electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like.
  • the GPU is a microprocessor for image processing, connected to the display 194 and the application processor.
  • the GPU is used to perform mathematical and geometric calculations and is used for graphics rendering.
  • the processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
  • the display screen 194 is used to display images, videos, and the like.
  • the display screen 194 includes a display panel.
  • the display panel can adopt liquid crystal display (LCD), organic light-emitting diode (OLED), active matrix organic light-emitting diode or active-matrix organic light-emitting diode (active-matrix organic light-emitting diode).
  • LCD liquid crystal display
  • OLED organic light-emitting diode
  • active-matrix organic light-emitting diode active-matrix organic light-emitting diode
  • AMOLED flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, quantum dot light-emitting diode (QLED), etc.
  • the electronic device 100 may include one or N display screens 194, and N is a positive integer greater than one.
  • the display screen 194 may be an integrated flexible display screen, or a spliced display screen composed of two rigid screens and a flexible screen located between the two rigid screens.
  • the electronic device 100 may also include a Bluetooth device, a positioning device, a flashlight, a micro-projection device, a near field communication (NFC) device, etc., which will not be repeated here.
  • a Bluetooth device a positioning device
  • a flashlight a micro-projection device
  • NFC near field communication
  • the following embodiments can all be implemented in an electronic device 100 (for example, a mobile phone, a tablet computer, etc.) having the above-mentioned hardware structure.
  • Fig. 2 shows a software structure block diagram of an electronic device provided by an embodiment of the present application.
  • the software structure of an electronic device can be a layered architecture.
  • the software can be divided into several layers, each with a clear role and division of labor. Communication between layers through software interface.
  • the Android system is divided into four layers, from top to bottom, the application layer, the application framework layer (framework, FWK), the Android runtime (Android runtime) and system libraries, and the kernel layer.
  • the application layer can include a series of application packages. As shown in Figure 2, the application layer may include cameras, settings, skin modules, user interfaces (UI), third-party applications, and so on. Among them, three-party applications can include WeChat, QQ, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.
  • UI user interfaces
  • three-party applications can include WeChat, QQ, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, etc.
  • the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
  • the application framework layer can include some predefined functions. As shown in Figure 2, the application framework layer can include a window manager, a content provider, a view system, a phone manager, a resource manager, and a notification manager.
  • the window manager is used to manage window programs.
  • the window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, take a screenshot, etc.
  • the content provider is used to store and retrieve data and make these data accessible to applications.
  • the data may include video, image, audio, phone calls made and received, browsing history and bookmarks, phone book, etc.
  • the view system includes visual controls, such as controls that display text, controls that display pictures, and so on.
  • the view system can be used to build applications.
  • the display interface can be composed of one or more views.
  • a display interface that includes a short message notification icon may include a view that displays text and a view that displays pictures.
  • the phone manager is used to provide the communication function of the electronic device. For example, the management of the call status (including connecting, hanging up, etc.).
  • the resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, and so on.
  • the notification manager enables the application to display notification information in the status bar, which can be used to convey notification-type messages, and it can automatically disappear after a short stay without user interaction.
  • the notification manager is used to notify download completion, message reminders, and so on.
  • the notification manager can also be a notification that appears in the status bar at the top of the system in the form of a chart or a scroll bar text, such as a notification of an application running in the background, or a notification that appears on the screen in the form of a dialog window.
  • prompt text information in the status bar sound a prompt sound, electronic device vibration, flashing indicator light, etc.
  • Android runtime includes core libraries and virtual machines. Android runtime is responsible for the scheduling and management of the Android system.
  • the core library consists of two parts: one part is the function function that the java language needs to call, and the other part is the core library of Android.
  • the application layer and the application framework layer run in a virtual machine.
  • the virtual machine executes the java files of the application layer and the application framework layer as binary files.
  • the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.
  • the system library can include multiple functional modules. For example: surface manager (surface manager), media library (media libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
  • surface manager surface manager
  • media library media libraries
  • 3D graphics processing library for example: OpenGL ES
  • 2D graphics engine for example: SGL
  • the surface manager is used to manage the display subsystem and provides a combination of 2D and 3D layers for multiple applications.
  • the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
  • the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
  • the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, synthesis, and layer processing.
  • the 2D graphics engine is a graphics engine for 2D drawing.
  • the system library may also include a face detection module, a posture detection module, a data fusion module, a threshold adjustment module, and a gaze processing module.
  • the face detection module is used to perform face detection on the collected first image. If a face is detected, the face and eye feature information are extracted, and the first image is sent to the posture detection module for face detection. Posture detection; if no face is detected, it will go to exception handling and will not continue the subsequent process.
  • the posture detection module is used to extract face posture information from the first image.
  • the data fusion module is used to fuse sensor data and face posture information to locate the current behavior scene.
  • the threshold adjustment module is used to output a dynamic threshold in a specific scene according to the input behavior scene information.
  • the gaze processing module is used to optimize the face and eye feature information using the image optimizer corresponding to the first behavior scene, and input the optimized face and eye feature information into the gaze model to obtain The output gaze score, and judge whether to unlock according to the output gaze score.
  • the kernel layer is the layer between hardware and software.
  • the kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.
  • the hardware layer may include a display screen, various sensors, such as the posture sensor (such as an acceleration sensor, a gyroscope sensor), an ambient light sensor, a distance sensor, a temperature sensor, etc. involved in the embodiments of the present application.
  • the posture sensor such as an acceleration sensor, a gyroscope sensor
  • an ambient light sensor such as an ultrasonic sensor
  • a distance sensor such as a distance sensor
  • a temperature sensor such as a thermometer
  • the system library inputs the first image into the face detection module, and the face detection module detects that the first image includes a face, extracts the face and eye feature information in the first image, and adds the first image to the face detection module.
  • An image is sent to the face posture detection module and the face and eye feature information is sent to the data fusion module.
  • the posture detection module extracts the face posture information in the first image, and sends the face posture information to the data fusion module,
  • the data fusion module can locate the current behavior scene according to the received information, and the gaze processing module uses the image optimizer corresponding to the first behavior scene to optimize the face and eye feature information, and then optimize the person
  • the face and eye feature information is input to the gaze model, the output gaze score is obtained, and the result of whether to unlock is output.
  • the result output by the gaze processing module is displayed on the display screen. For example, the result is unlocking success, and the display screen displays the display interface after unlocking. If the result is unlocking failure, the display screen displays a prompt message of unlocking failure.
  • the process of the electronic device performing face gaze detection on the face image through the deep learning algorithm may include two parts: a training process and an actual measurement process.
  • the training process is shown in Figure 3.
  • the general idea is: Obtain face images collected in each preset behavior scene, and classify the gaze images into the positive class to obtain the gaze image set , And classify the non-fixed images (ie, non-fixed, closed eyes, and false eyes in the image) into a negative class to obtain a set of non-fixed images.
  • the training is completed. If the similarity is low, retrain until the recognized test result is similar to the known classification result.
  • the optimal model is selected after the test set verification, and the optimal model will be used to classify the fixation image and the non-fixation image.
  • the gaze model obtained through training recognizes the image to be detected to determine whether the image to be detected is a gaze image.
  • the electronic device can train the gaze model before leaving the factory, that is, the machine learning model in the electronic device after leaving the factory has been trained, and the actual measurement process can be directly performed.
  • the electronic device can also train the gaze model after leaving the factory, and then use the trained gaze model to perform the actual measurement process.
  • the actual measurement process is described in detail below.
  • FIG. 4 is a schematic flowchart of a face gaze unlocking method provided in an embodiment of this application. As shown in Figure 4, the process of the method may include:
  • Step 401 The electronic device acquires a first image, and acquires sensor data in the electronic device when the first image is acquired.
  • the electronic device may collect the first image through the camera 193.
  • the first image can be an infrared image.
  • the first image can include the user’s face, such as all faces, or part of the face. Part of the face can be part of the user’s face covered by masks, sunglasses, etc., or Only part of the user's face enters the shooting area of the camera, so that only part of the face can be collected.
  • the first image may also not include the user's face. In this case, the human face and eye feature information cannot be extracted from the first image, and the electronic device performs abnormality processing and does not perform subsequent unlocking steps.
  • the sensor data includes at least one of the following: data collected by a posture sensor in an electronic device, data collected by a distance sensor, data collected by an ambient light sensor, and data collected by a temperature sensor.
  • Step 402 The electronic device determines scene information according to the first image and sensor data.
  • the scene information may include at least one of the following: current light intensity, shooting distance, posture of the electronic device, and camera temperature.
  • Step 403 The electronic device extracts the face, eye feature information, and face posture information from the first image.
  • step 403 you can perform face detection on the first image. If a face is detected, continue to perform face pose detection and eye feature detection; if no face is detected, perform abnormality processing and not output the face Watch the unlock result.
  • face posture information extraction is performed.
  • the face posture information may include frontal face, side face, head up, head down, and other types, as well as information about the angle of each type to the frontal face. If the face posture is not detected, abnormal processing is performed, and the face gaze unlock result is not output.
  • eye feature detection if eye features are detected, the face, eye feature information, and eye feature information are extracted. If no eye features are detected, abnormal processing is performed, and the face gaze unlock result is not output.
  • the face and eye feature information may include the contour of the face and the feature information of various parts of the face, such as the image Characteristic information of eyes, eyebrows, nose, mouth, ears and other parts shown in (B) in 5.
  • Step 404 The electronic device locates the first behavior scene corresponding to the first image according to the scene information and the face posture information.
  • the electronic device can classify the scene information and the face pose information through a classifier to locate the behavior scene, and obtain the first behavior scene corresponding to the first image.
  • the classifier may be a support vector machine (SVM), or other types of classifiers, such as a perceptron method, a neural network method, a radial basis function (RBF) method, etc., may also be used.
  • SVM support vector machine
  • RBF radial basis function
  • the electronic device skips step 405 and step 406 after performing step 404. , That is, the face and eye feature information corresponding to the normal behavior scene is not optimized.
  • the electronic device directly inputs the face and eye feature information into the gaze model to obtain the gaze score under the normal scene, and then determine that the gaze score is greater than the gaze score When the score threshold is reached, unlock it.
  • the first behavior scene is an abnormal behavior scene, such as strong light, normal distance, normal camera temperature, and frontal face
  • the background light is very strong and the collected face is relatively dark, resulting in
  • the eye features in the first image are blurry
  • the image optimizer corresponding to the first behavior scene in step 405 can be used to optimize the face and eye feature information in the first image, such as enhancing the face and eyes. Feature information, and then input the enhanced face and eye feature information into the gaze model to obtain the gaze score under the first behavior scene.
  • Step 405 When the first behavior scene is an abnormal behavior scene, the electronic device uses an image optimizer corresponding to the first behavior scene to optimize the face and eye feature information to obtain optimized face and eye feature information.
  • the electronic device is provided with an image optimizer corresponding to each preset behavior scene. After locating the first behavior scene corresponding to the first image, the electronic device selects the image optimizer corresponding to each preset behavior scene. Determine the image optimizer corresponding to the first behavior scene, and then use the image optimizer corresponding to the first behavior scene to optimize the facial and eye feature information.
  • the electronic device may be provided with optimization parameters corresponding to each preset behavior scene. After locating the first behavior scene corresponding to the first image, the electronic device obtains the optimization parameters corresponding to each preset behavior scene. The optimization parameters corresponding to the first behavior scene are determined in the, and then the optimization parameters corresponding to the first behavior scene are used to optimize the facial and eye feature information.
  • Step 406 The electronic device inputs the optimized face and eye feature information into the gaze model to obtain a gaze score.
  • Step 407 The electronic device unlocks when it is determined that the gaze score is greater than the gaze score threshold.
  • the electronic device does not unlock when it is determined that the gaze score is less than or equal to the gaze score threshold.
  • the gaze score thresholds in each behavior scene may adopt the same gaze score threshold, that is, the gaze score thresholds in the normal behavior scene and the abnormal behavior scene are the same. Different gaze score thresholds may also be adopted for the gaze score thresholds in each behavior scenario.
  • the gaze score threshold corresponding to a normal behavior scene is 50, when the electronic device determines that the gaze score is greater than 50, the unlocking is performed, and when it is determined that the gaze score is less than or equal to 50, the unlocking is not performed.
  • the current behavior scene is located by combining the first image collected with the sensor data when the first image is collected, and then the corresponding image optimizer is matched to optimize the facial and eye feature information according to the behavior scene.
  • the noise of the input data of the gaze model can be reduced in a targeted manner, and the effectiveness of the data can be enhanced, so that the accuracy of unlocking the face gaze in complex scenes can be improved, and the rate of non-gaze unlocking can be reduced.
  • the face and eye feature information corresponding to the abnormal behavior scene is enhanced, the face and eye feature information of the image cannot be enhanced to the optimal effect. For this reason, it can be targeted for different Different gaze score thresholds are set for the abnormal behavior scenes, so that a detection result of face gaze closer to the real situation can be obtained, and the user's unlocking experience can be improved.
  • the electronic device includes a preset dynamic threshold range corresponding to the behavior scene.
  • the dynamic threshold range can be obtained by training the threshold model on the test sets corresponding to different scenarios.
  • Step 408 Determine the dynamic threshold range corresponding to the first behavior scene.
  • the first behavior scene is a strong light scene, and its corresponding dynamic threshold range is (-5, 5).
  • Step 409 According to the scene information, a dynamic threshold is determined from the dynamic threshold range corresponding to the first behavior scene.
  • the main factor that affects the dynamic threshold is the light intensity.
  • the change relationship between the preset light intensity and the dynamic threshold range the corresponding to the first behavior scene can be determined
  • the dynamic threshold where the change relationship may be a linear change relationship or a non-linear change relationship, which is not specifically limited here.
  • Step 410 Determine the gaze score threshold according to the static threshold corresponding to the normal behavior scene and the determined dynamic threshold.
  • the static threshold corresponding to the normal behavior scene is 50
  • the dynamic threshold corresponding to the first behavior scene is -5
  • the gaze score threshold corresponding to the first behavior scene is 45.
  • the gaze score is greater than 45, it is determined to be a gaze image and unlocked, and when the gaze score is less than or equal to 45, it is determined to be a non-gazing image, and the unlocking is not performed.
  • the electronic device includes a first correspondence between a preset behavior scene and a preset score threshold. After step 404 and before step 407, the electronic device may also determine a preset score threshold corresponding to the first behavior scene according to the first behavior scene and the first correspondence, and then compare the preset score threshold corresponding to the first behavior scene information to the first behavior scene information.
  • the score threshold serves as the gaze score threshold.
  • the robustness and generalization of the gaze model in certain specific scenes can be enhanced in a targeted manner.
  • the device posture of the electronic device can be in the horizontal screen state, the vertical screen state, or other than the horizontal screen state and the vertical screen state. In addition to other states, such as inverted screen state. Collecting facial images when the electronic device is in a non-portrait state will make it difficult to extract facial and eye feature information, which will affect the unlocking result.
  • the electronic device may also determine the device posture of the electronic device according to the sensor data, determine whether the first image needs to be rotated according to the device posture, and then perform face feature detection.
  • the electronic device can determine the deflection angle between the direction of the long axis of the screen when the electronic device is in the device posture and the direction of the long axis of the screen when the electronic device is in the vertical screen state, and then rotate the first image by the deflection angle.
  • the following describes the device posture of the electronic device.
  • the display screen of the electronic device is basically in the shape of a horizontal bar.
  • the display screen of the electronic device is basically a vertical bar.
  • the aspect ratio of the display screen can also be called the aspect ratio of the display screen, which is the ratio of the height to the width of the display screen.
  • the height of the display is the length of the short side of the display
  • the width of the display is the length of the long side of the display.
  • the height of the display is the length of the long side of the display
  • the width of the display is the length of the short side of the display.
  • the long sides of the display screen are two parallel and equal longer sides of the four sides of the display screen, and the short sides of the display screen are two shorter sides that are parallel and equal to each other among the four sides of the display screen.
  • the height of the display screen is Y and the width of the display screen is X, then the aspect ratio of the display screen is Y/X, where Y/X ⁇ 1.
  • the electronic device is tilted or rotated by a small angle (for example, the angle is not greater than the first angle threshold, such as 20°, 15°, 5 ° etc.), the electronic device is still considered to be in landscape mode.
  • the angle of clockwise rotation is ⁇ , so that the electronic device is in the state shown in Figure 6 (B).
  • the electronic device When ⁇ is not greater than the first angle threshold, the electronic device The device regards the state shown in Figure 6 (B) as a horizontal screen state. For another example, in the vertical screen state of the electronic device shown in Figure 6 (C), the height of the display screen is X and the width of the display screen is Y, then the aspect ratio of the display screen is X/Y, where X/ Y>1. It should also be noted that when the electronic device is tilted or rotated by a small angle (for example, the angle is not greater than the second angle threshold, such as 20°, 15°, 5°, etc.), the electronic device is still considered to be in portrait mode.
  • the second angle threshold such as 20°, 15°, 5°, etc.
  • the angle of counterclockwise rotation is ⁇ , so that the electronic device is in the state shown in Figure 6 (D), when ⁇ is not greater than the second angle threshold ,
  • the electronic device regards the state shown in (D) in FIG. 6 as the vertical screen state.
  • the first angle threshold and the second angle threshold may be the same or different, and may be set according to actual needs, which is not limited.
  • the captured user's face image is shown in Figure 5 (A)
  • Figure 7 (A) when the electronic device is in the horizontal screen state
  • the captured user's face image is shown in Figure 7 (A)
  • the captured user's face image is shown in FIG. 7(B)
  • Fig. 7 (A) and Fig. 7 (B) it is difficult to extract facial features and takes a long time.
  • the electronic device tilts or rotates a larger angle (for example, the angle is greater than or equal to the second angle threshold) in the vertical screen state as shown in Figure 6 (C), such as the angle equal to 90 degrees or 270 degrees, It is the horizontal screen state, if the angle is 108 degrees, it is the inverted screen state.
  • a larger angle for example, the angle is greater than or equal to the second angle threshold
  • the electronic device if the electronic device is in a non-portrait state to capture the first image, taking the electronic device in a landscape state as an example, the face image shown in Figure 7 (A) is captured, and the electronic device determines the device posture
  • the deflection angle from the vertical screen state is 90 degrees, and the face image is rotated 90 degrees according to the deflection direction of the electronic device, so that the face image shown in FIG. 5(A) can be obtained. In this way, it is convenient to accurately extract facial and eye feature information.
  • the face gaze unlocking method includes the following steps:
  • Step 801 Collect a first image.
  • Step 802 Acquire sensor data in the electronic device when the first image is collected.
  • Step 803 Determine whether the electronic device is inverted screen according to the sensor data (such as a posture sensor), if yes, execute step 804; if not, keep the original image and execute step 805.
  • the sensor data such as a posture sensor
  • Step 804 Rotate the first image according to the inverted screen direction of the electronic device.
  • Step 805 Perform face detection on the first image, and determine whether a face is detected, if yes, proceed to step 806; if not, proceed to step 810.
  • Step 806 Perform face posture detection on the first image, and determine whether the face posture is detected, if yes, perform step 807 and step 808; if not, perform step 810.
  • Step 807 Perform face posture feature extraction on the first image to obtain face posture information.
  • Step 808 Perform eye detection on the first image, and determine whether eyes are detected, if yes, perform step 809; if not, perform step 810.
  • Step 809 Perform face and eye feature extraction on the first image to obtain face and eye feature information. After that, step 811 is performed.
  • Step 810 Enter exception handling, and the process ends.
  • Step 811 Determine scene information according to the first image and the sensor data.
  • the scene information includes light intensity, shooting distance, posture of the electronic device, and camera temperature.
  • Step 812 According to the scene information and the face pose information, locate the behavior scene corresponding to the first image, and match the image optimizer or optimization parameter corresponding to the behavior scene.
  • Step 813 Optimize face and eye feature information according to the image optimizer or optimization parameters corresponding to the behavior scene to obtain optimized face and eye feature information.
  • Step 814 Input the optimized face and eye feature information into the gaze model.
  • Step 815 output the gaze score.
  • Step 816 Determine whether the gaze score is greater than the gaze score threshold, if yes, go to step 817; if not, go to step 818.
  • Step 817 unlocking is performed.
  • Step 818 No unlocking is performed.
  • the face gaze unlocking method provided in the embodiments of the present application may be applicable to a variety of scenarios. For example, a scene where the electronic device needs to be unlocked when the screen is locked, or an application (such as Alipay, WeChat, etc.) with a face-gazing unlock function, or a scene where the page of a certain application needs to be unlocked.
  • the face gaze unlocking method provided in the embodiments of the present application can be applied to any scene where face gaze unlocking is required, and this article will not list them all.
  • the method of locating behavioral scenes based on sensor data, matching optimizers or optimizing parameters to optimize input images is not limited to optimizing face gaze scene detection input images, and can also be used for other target detection (such as vehicles, animals, etc.) Optimized input data.
  • the way of setting the gaze threshold through behavioral scenes in this solution is not limited to gaze models or face gaze classifiers, and can also be used for threshold setting of most target classifiers (face detection, target recognition).
  • the method provided in the embodiments of the present application is introduced from the perspective of an electronic device as an execution subject.
  • the electronic device may include a hardware structure and/or a software module, and realize the above functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a certain function among the above-mentioned functions is executed by a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraint conditions of the technical solution.
  • the hardware implementation of the electronic device can refer to FIG. 9 and related descriptions.
  • the electronic device 100 includes: a touch screen 901, wherein the touch screen 901 includes a touch panel 907 and a display screen 908; one or more processors 902; a memory 903; one or more application programs (not Shown); and one or more computer programs 904, the sensor 905, and the above-mentioned devices can be connected through one or more communication buses 906.
  • the one or more computer programs 904 are stored in the aforementioned memory 903 and configured to be executed by the one or more processors 902, and the one or more computer programs 904 include instructions, and the aforementioned instructions can be used to execute any of the aforementioned instructions.
  • the method in one embodiment.
  • the embodiment of the present application also provides a computer-readable storage medium, the storage medium may include a memory, and the memory may store a program.
  • the program When the program is executed, the electronic device executes the following steps: Figure 3, Figure 4, and Figure 8 All or part of the steps described in the method embodiment shown.
  • the embodiment of the present application also provides a product containing a computer program, when the computer program product runs on an electronic device, the electronic device is caused to execute the method embodiments shown in FIGS. 3, 4, and 8 as described above. All or part of the steps described in.
  • the embodiments of the present application also provide a device.
  • the device may specifically be a chip, component, or module.
  • the device may include a processor and a memory connected to each other.
  • the memory is used to store computer execution instructions.
  • the processor can execute the computer-executable instructions stored in the memory, so that the chip executes the methods in the foregoing method embodiments.
  • the electronic devices, computer storage media, computer program products, or chips provided in the embodiments of the present application are all used to execute the corresponding methods provided above. Therefore, the beneficial effects that can be achieved can refer to the corresponding methods provided above. The beneficial effects of the method are not repeated here.
  • the disclosed device and method can be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of modules or units is only a logical function division.
  • there may be other division methods for example, multiple units or components can be combined or It can be integrated into another device, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate parts may or may not be physically separate, and the parts displayed as a unit may be one physical unit or multiple physical units, that is, they may be located in one place or distributed to multiple different places. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a readable storage medium.
  • the technical solutions of the embodiments of the present application are essentially or the part that contributes to the prior art, or all or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium. It includes several instructions to make a device (which may be a single-chip microcomputer, a chip, etc.) or a processor (processor) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read only memory (read only memory, ROM), random access memory (random access memory, RAM), magnetic disk or optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Biophysics (AREA)
  • Computing Systems (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

一种人脸注视解锁方法及电子设备。该方法包括:电子设备采集第一图像,并获取在采集第一图像时的传感器数据,根据第一图像和传感器数据,确定场景信息,从第一图像中提取人脸、眼部特征信息和人脸姿态信息,根据场景信息和人脸姿态信息,定位第一图像对应的第一行为场景,在第一行为场景为非正常行为场景时,采用与第一行为场景对应的图像优化器对人脸、眼部特征信息进行优化,将优化后的人脸、眼部特征信息输入至注视模型中,得到注视分数,在确定注视分数大于注视分数阈值时,进行解锁。该方案根据行为场景优化人脸、眼部特征信息,可有针对性地减少注视模型输入数据的噪声,增强数据有效性,提高复杂场景下的人脸注视解锁的准确率。

Description

一种人脸注视解锁方法及电子设备
相关申请的交叉引用
本申请要求在2020年05月26日提交中国专利局、申请号为202010452422.8、申请名称为“一种人脸注视解锁方法及电子设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及终端技术领域,尤其涉及一种人脸注视解锁方法及电子设备。
背景技术
随着终端技术的发展,电子设备(例如,手机、平板电脑等)上的人脸解锁与支付功能已经普及。为了提高人脸解锁与支付的安全性,大多数的人脸解锁增加了人脸注视的功能,以避免他人使用自己的手机在自己非自愿的情况下,例如在本人熟睡、或他人强行使用手机扫描脸部等场景)解锁手机,从而偷窥、窃取用户信息。
为增加解锁安全性,现有技术中采用人脸注视解锁方案进行解锁,但是在实际使用过程中,电子设备的姿态、环境光照、拍摄距离等各种因素会对人脸注视识别造成影响,可能将人脸注视图片误识别为非注视图片,从而使得解锁失败,影响用户的解锁体验,也有可能将非注视图片误识别为注视图片,从而使得解锁成功,降低了解锁的安全性。现有技术中的方案并没有一个可以在复杂场景(例如强光、远距离等)下准确实现人脸注视解锁的方法。
发明内容
本申请实施例提供一种人脸注视解锁方法及电子设备,用以提供在复杂场景下,提高人脸注视解锁的准确率。
第一方面,本申请实施例提供一种人脸注视解锁方法,该方法可由电子设备执行。该方法包括:电子设备采集第一图像,并获取在采集第一图像时电子设备中的传感器数据,根据第一图像和传感器数据,确定场景信息,其中,场景信息包括以下内容中的至少一项:当前的光照强度、拍摄距离、电子设备的姿态、摄像头温度。电子设备从第一图像中提取人脸、眼部特征信息和人脸姿态信息,根据场景信息和人脸姿态信息,定位第一图像对应的第一行为场景,在第一行为场景为非正常行为场景时,采用与第一行为场景对应的图像优化器对人脸、眼部特征信息进行优化,得到优化后的人脸、眼部特征信息,然后,将优化后的人脸、眼部特征信息输入至注视模型中,得到注视分数,在确定注视分数大于注视分数阈值时,进行解锁。
基于该方案,通过结合采集到的第一图像和采集第一图像时的传感器数据,定位出当前的行为场景,然后根据行为场景匹配相对应的图像优化器优化人脸、眼部特征信息,可以有针对性地减少注视模型的输入数据的噪声,增强数据的有效性,从而可以提高复杂场景下的人脸注视解锁的准确率,降低非注视解锁率。
一种可能的设计中,在从第一图像中提取人脸、眼部特征信息和人脸姿态信息之前,电子设备还可以根据传感器数据确定电子设备的设备姿态,确定所述电子设备处于所述设备姿态时屏幕长轴所在的方向与所述电子设备处于竖屏状态时屏幕长轴所在的方向之间的偏转角度,将第一图像旋转偏转角度。通过该设计,结合传感器数据可以对处于非竖屏状态下采集的第一图像进行旋转操作,便于准确的提取人脸和眼部特征信息,可以很好地解决电子设备倒屏无法解锁问题。
一种可能的设计中,在确定注视分数大于注视分数阈值时,进行解锁之前,电子设备还可以针对不同的非正常行为场景设置不同的注视分数阈值,以下提供两种可能的实现方式:实现方式一,电子设备根据第一行为场景和第一对应关系,确定第一行为场景对应的预设的分数阈值,将第一行为场景信息对应的预设的分数阈值作为注视分数阈值,其中,第一对应关系包括预设的行为场景与预设的分数阈值之间的对应关系。
实现方式二,电子设备确定第一行为场景对应的动态阈值范围,根据场景信息,从第一行为场景对应的动态阈值范围中确定出一个动态阈值,根据正常行为场景对应的静态阈值和确定出的动态阈值,确定注视分数阈值。
通过上述两种实现方式,根据行为场景设定注视阈值,不仅可以得到一个更接近真实情况的人脸注视的检测结果,提高用户的解锁体验,还可以针对性地增强注视模型在某些特定场景的鲁棒性与泛化性。
一种可能的设计中,该方法还包括:获取注视图像集和非注视图像集,注视图像集包括在各个预设的行为场景下采集的注视图像,非注视图像集包括在各个预设的行为场景下采集的非注视图像;针对注视图像集中的每个注视图像,采用采集所述注视图像时的行为场景所对应的图像优化器,对注视图像中的人脸、眼部特征信息进行优化,得到优化后的第一人脸、眼部特征信息;针对非注视图像集中的每个非注视图像,采用采集所述注视图像时的行为场景所对应的图像优化器,对非注视图像中的人脸、眼部特征信息进行优化,得到优化后的第二人脸、眼部特征信息;为每个优化后的第一人脸、眼部特征信息和每个优化后的第二人脸、眼部特征信息设置行为场景标签;将设置有行为场景标签的优化后的第一人脸、眼部特征信息和设置有行为场景标签的优化后的第二人脸、眼部特征信息输入至神经网络模型中进行模型训练,得到注视模型。
通过该设计,采用设置有行为场景标签的训练样本来训练神经网络模型,可以得到准确识别待检测图像的类别的注视模型,从而提高人脸注视解锁的准确率。
一种可能的设计中,传感器数据包括以下内容中的至少一项:电子设备中的姿态传感器采集的数据、距离传感器采集的数据、环境光传感器采集的数据、温度传感器采集的数据。
第二方面,本申请实施例还提供一种电子设备。该电子设备包括处理器和存储器;所述存储器用于存储图像、以及一个或多个计算机程序;当所述存储器存储的一个或多个计算机程序被所述处理器执行时,使得所述电子设备能够实现上述第一方面及其第一方面任一可能设计的技术方案。
第三方面,本申请实施例还提供了一种电子设备,所述电子设备包括执行上述第一方面或者第一方面的任意一种可能的设计的方法的模块/单元;这些模块/单元可以通过硬件实现,也可以通过硬件执行相应的软件实现。
第四方面,本申请实施例的一种芯片,所述芯片与电子设备中的存储器耦合,执行本 申请实施例第一方面及其第一方面任一可能设计的技术方案;本申请实施例中“耦合”是指两个部件彼此直接或间接地结合。
第五方面,本申请实施例的一种计算机可读存储介质,所述计算机可读存储介质包括计算机指令,当计算机指令在电子设备上运行时,使得所述电子设备执行本申请实施例第一方面及其第一方面任一可能设计的技术方案。
第六方面,本申请实施例的中一种程序产品,包括指令,当所述程序产品在电子设备上运行时,使得所述电子设备执行本申请实施例第一方面及其第一方面任一可能设计的技术方案。
本申请的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
图1为本申请实施例提供的电子设备的结构示意图;
图2为本申请实施例提供的电子设备的软件结构框图;
图3为本申请实施例提供的一种人脸注视检测的训练过程示意图;
图4为本申请实施例提供的一种人脸注视解锁方法的流程示意图;
图5为本申请实施例提供的用户人脸的示意图;
图6为本申请实施例的电子设备的横屏状态和竖屏状态的示意图;
图7为本申请实施例提供的用户人脸的示意图;
图8为本申请实施例提供的另一种人脸注视解锁方法的流程示意图;
图9为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
以下,对本申请实施例中的部分用语进行解释说明,以便于本领域技术人员理解。
本申请实施例涉及的多个,是指大于或等于两个。
需要说明的是,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,如无特殊说明,一般表示前后关联对象是一种“或”的关系。且在本申请实施例的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序,也不能理解为隐含指明所指示的技术特征的数量。
本申请公开的各个实施例可以应用于电子设备中,该电子设备能够实现人脸注视解锁功能。在本申请一些实施例中,电子设备可以是便携式终端,诸如手机、平板电脑、具备无线通讯功能的可穿戴设备(如智能手表)、相机、笔记本等。该便携式终端包含能够采集图像,并对采集的图像进行特征提取的器件(比如处理器)。便携式终端的示例性实施例包括但不限于搭载
Figure PCTCN2021082993-appb-000001
或者其它操作系统的便携式终端。上述便携式终端也可以是其它便携式终端,只要能够采集图像,并对采集的图像进行图像处理(例如特征信息或姿态信息提取、优化,获得注视分数等)即可。还应当理解的是,在本申请其他一些实施例中,上述电子设备也可以不是便携式终端,而是能够采集图像,并对采集的图形进行图像处理(例如特征信息或姿态信息提取、优化,获得注视分数等)的台 式计算机。
在本申请另一些实施例中,电子设备也可以无需具有图像处理(例如特征信息或姿态信息提取、优化,获得注视分数等)的功能,而是具有通信功能。比如,电子设备采集图像之后,可以将该图像发送到其它设备比如服务器,由其他设备使用本申请实施例提供的人脸注视解锁方法对图像进行图像处理(例如特征信息或姿态信息提取、优化,获得注视分数等),然后将图像处理结果发送给电子设备,电子设备根据图像处理结果确定是否进行解锁。
图1示出了电子设备100的结构示意图。
应理解,图示电子设备100仅是一个范例,并且电子设备100可以具有比图中所示出的更多的或者更少的部件,可以组合两个或更多的部件,或者可以具有不同的部件配置。图中所示出的各种部件可以在包括一个或多个信号处理和/或专用集成电路在内的硬件、软件、或硬件和软件的组合中实现。
如图1所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。
下面结合图1对电子设备100的各个部件进行具体的介绍:
处理器110可以包括一个或多个处理单元,例如,处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用,从而可避免重复存取,可减少处理器110的等待时间,因而可提高系统的效率。
处理器110可以运行本申请实施例提供的人脸注视解锁方法的软件代码。当处理器110集成不同的器件,比如集成CPU和GPU时,CPU和GPU可以配合执行本申请实施例提供的人脸注视解锁方法,比如人脸注视解锁方法中部分算法由CPU执行,另一部分算法由GPU执行,以得到较快的处理效率。
在一些实施例中,处理器110可以包括一个或多个接口。比如,接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuit sound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal  asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。电子设备100可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频、采集的图像等文件保存在外部存储卡中。
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如传感器数据,采集的图像等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。处理器110通过运行存储在内部存储器121的指令,和/或存储在设置于处理器中的存储器的指令,执行电子设备100的各种功能应用以及数据处理。
内部存储器121还可以存储本申请实施例提供的人脸注视解锁方法的软件代码。当处理器110运行该代码时,执行下文中的人脸注视解锁流程,实现人脸注视解锁功能。
内部存储器121还可以存储其它内容,比如,内部存储器121中存储有预设的行为场景与预设的分数阈值之间的第一对应关系,处理器110在定位出第一图像对应的第一行为场景之后,可以根据第一行为场景与在内部存储器121中的第一对应关系,确定第一行为场景对应的预设的分数阈值,作为注视分数阈值。这样的话,处理器110可以根据确定出注视分数和注视分数阈值判断是否进行解锁。
内部存储器121还可以存储预设的行为场景对应的动态阈值范围,示例性的,电子设备100在定位出第一图像对应的第一行为场景之后,可以根据内部存储器121中存储的预设的行为场景对应的动态阈值范围,确定第一行为场景对应的动态阈值范围,然后,根据场景信息,从第一行为场景对应的动态阈值范围中确定出一个动态阈值,再根据默认场景对应的静态阈值和确定出的动态阈值,确定注视分数阈值。进而,处理器110可以根据确定出注视分数和注视分数阈值判断是否进行解锁。
应理解,内部存储器121中还可以存储下文中提到的其它内容,比如注视模型等。
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。在一些实施 例中,移动通信模块150的至少部分功能模块可以被设置于处理器110中。在一些实施例中,移动通信模块150的至少部分功能模块可以与处理器110的至少部分模块被设置在同一个器件中。
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。在一些实施例中,调制解调处理器可以是独立的器件。在另一些实施例中,调制解调处理器可以独立于处理器110,与移动通信模块150或其他功能模块设置在同一个器件中。
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wireless local area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。
在本申请的一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信,例如,将采集的图像发送给其他设备,由其它设备进行处理,以确定是否可以解锁,然后接收其它设备发送的结果。
下面介绍传感器模块180包括的几种传感器的功能。
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。当有力作用于压力传感器180A,电极之间的电容改变。电子设备100根据电容的变化确定压力的强度。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。陀螺仪传感器180B还可以用于导航,体感游戏场景。
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备姿态,应用于横竖屏切换,计步器等应用。
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确 定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。
环境光传感器180L用于感知环境光亮度。电子设备100可以根据感知的环境光亮度自适应调节显示屏194亮度。环境光传感器180L也可用于拍照时自动调节白平衡。环境光传感器180L还可以与接近光传感器180G配合,检测电子设备100是否在口袋里,以防误触。
温度传感器180J用于检测温度。在一些实施例中,电子设备100利用温度传感器180J检测的温度,执行温度处理策略。例如,当温度传感器180J上报的温度超过阈值,电子设备100执行降低位于温度传感器180J附近的处理器的性能,以便降低功耗实施热保护。在另一些实施例中,当温度低于另一阈值时,电子设备100对电池142加热,以避免低温导致电子设备100异常关机。在其他一些实施例中,当温度低于又一阈值时,电子设备100对电池142的输出电压执行升压,以避免低温导致的异常关机。
按键190包括开机键,音量键等。按键190可以是机械按键,也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(charge coupled device,CCD)或互补金属氧化物半导体(complementary metal-oxide-semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像信号。ISP将数字图像信号输出到DSP加工处理。DSP将数字图像信号转换成标准的RGB,YUV等格式的图像信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode的,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。
在本申请实施例中,显示屏194可以是一个一体的柔性显示屏,也可以采用两个刚性屏以及位于两个刚性屏之间的一个柔性屏组成的拼接的显示屏。
尽管图1中未示出,电子设备100还可以包括蓝牙装置、定位装置、闪光灯、微型投 影装置、近场通信(near field communication,NFC)装置等,在此不予赘述。
以下实施例均可以在具有上述硬件结构的电子设备100(例如手机、平板电脑等)中实现。
图2示出了本申请实施例提供的电子设备的软件结构框图。如图2所示,电子设备的软件结构可以是分层架构,例如可以将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层(framework,FWK),安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。如图2所示,应用程序层可以包括相机、设置、皮肤模块、用户界面(user interface,UI)、三方应用程序等。其中,三方应用程序可以包括微信、QQ、图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层可以包括一些预先定义的函数。如图2所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供电子设备的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。
Android runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(media libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
此外,系统库还可以包括人脸检测模块、姿态检测模块、数据融合模块、阈值调节模块和注视处理模块。其中,人脸检测模块用于对采集的第一图像进行人脸检测,若检测到人脸,则提取人脸、眼部特征信息,并将该第一图像送到姿态检测模块以进行人脸姿态检测;若未检测到人脸,则转到异常处理,不再继续后续过程。该姿态检测模块用于从第一图像中提取人脸姿态信息。数据融合模块用于将传感器数据和人脸姿态信息进行融合,定位当前的行为场景。阈值调节模块用于根据输入的行为场景信息,输出特定场景下的动态阈值。注视处理模块用于将采用与所述第一行为场景对应的图像优化器对所述人脸、眼部特征信息进行优化,并将优化后的人脸、眼部特征信息输入至注视模型,得到输出的注视分数,并根据输出的注视分数判断是否进行解锁。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
硬件层可以包括显示屏,各类传感器,例如本申请实施例中涉及的姿态传感器(例如加速度传感器、陀螺仪传感器)、环境光传感器、距离传感器、温度传感器等。
下面结合本申请实施例的人脸注视解锁方法,示例性说明电子设备的软件以及硬件的工作流程。作为一种示例,系统库将第一图像输入到人脸检测模块中,人脸检测模块检测到第一图像中包括人脸,提取第一图像中的人脸、眼部特征信息,并将第一图像发送至人脸姿态检测模块以及将人脸、眼部特征信息发送至数据融合模块,姿态检测模块提取第一图像中的人脸姿态信息,并将人脸姿态信息发送至数据融合模块,数据融合模块可以根据接收到的信息定位当前的行为场景,注视处理模块采用与所述第一行为场景对应的图像优化器对所述人脸、眼部特征信息进行优化,并将优化后的人脸、眼部特征信息输入至注视模型,得到输出的注视分数,并输出是否进行解锁的结果。注视处理模块输出的结果通过显示屏显示,例如结果为解锁成功,显示屏显示解锁后的显示界面,若结果为解锁失败,显示屏显示解锁失败的提示信息。
下面结合附图,介绍本申请实施例中人脸注视解锁方法的具体实现过程。
本申请实施例中,电子设备通过深度学习算法对人脸图像进行人脸注视检测的过程,可以包括训练过程和实测过程两个部分。
其中,训练过程如图3所示,其总体思路为:获取在各个预设的行为场景下采集到的人脸图像,将其中的注视图像归为正例类别(positive class),得到注视图像集,将其中的非注视图像(即图像中的非注视、闭眼、假眼)归为反例类别(negative class),得到非注视图像集。对注视图像集中的每个注视图像进行人脸检测和特征点检测,并优化,得到第一人脸、眼部特征信息,以及对非注视图像集中的每个非注视图像进行人脸检测和特征点检测,并优化,得到第二人脸、眼部特征信息,然后为每个优化后的第一人脸、眼部特征信息和每个优化后的第二人脸、眼部特征信息设置行为场景标签,将设置有行为场景标签的优化后的第一人脸、眼部特征信息和设置有行为场景标签的优化后的第二人脸、眼部特征信息作为训练集,输入至神经网络模型中进行模型训练,得到注视模型。然后选择已知分类结果的测试集对注视模型进行验证,即将测试集作为注视模型的输入,得到测试结果,将测 试结果与已知的分类结果进行比较,若相似性较高,则训练完成,若相似性较低,则重新训练,直到识别出的测试结果与已知的分类结果相似为止。经过测试集验证筛选出最优模型,该最优模型将用于实现注视图像与非注视图像的分类。
实测过程的总体思路为:通过训练得到的注视模型对待检测图像进行识别,以确定待检测图像是否为注视图像。
本申请实施例中,电子设备可以在出厂之前对注视模型进行训练,即出厂后的电子设备中的机器学习模型是已经经过训练的,可以直接进行实测过程。或者,电子设备也可以在出厂之后对注视模型进行训练,然后使用训练之后的注视模型进行实测过程。下面对实测过程进行详细介绍。
请参见图4,为本申请实施例提供的一种人脸注视解锁方法的流程示意图。如图4所示,该方法的流程可以包括:
步骤401,电子设备采集第一图像,并获取在采集所述第一图像时所述电子设备中的传感器数据。
示例的,电子设备可以通过摄像头193采集第一图像。第一图像可以是红外图像,第一图像可以包括用户人脸,例如全部人脸,又例如部分人脸,部分人脸可以是用户的全部人脸被口罩、墨镜等遮挡物遮挡一部分,也可以用户人脸只有部分进入摄像头的拍摄区域导致只能采集到部分人脸。第一图像也可以不包括用户人脸,这种情况下,从第一图像中提取不到人脸、眼部特征信息,电子设备进行异常处理,不再进行后续解锁步骤。
其中,传感器数据包括以下内容中的至少一项:电子设备中的姿态传感器采集的数据、距离传感器采集的数据、环境光传感器采集的数据、温度传感器采集的数据。
步骤402,电子设备根据第一图像和传感器数据,确定场景信息。
其中,场景信息可以包括以下内容中的至少一项:当前的光照强度、拍摄距离、电子设备的姿态、摄像头温度。
步骤403,电子设备从第一图像中提取人脸、眼部特征信息和人脸姿态信息。
在步骤403之前,可以先对第一图像进行人脸检测,若检测到人脸,继续进行人脸姿态检测和眼部特征检测;若未检测到人脸,则进行异常处理,不输出人脸注视解锁结果。
针对人脸姿态检测,若检测到人脸姿态特征,例如仰头、侧脸,则进行人脸姿态信息提取。其中,人脸姿态信息可以包括正面人脸、侧脸、仰头、低头等类型,以及每种类型性对于正面人脸的角度等信息。若未检测到人脸姿态,则进行异常处理,不输出人脸注视解锁结果。
针对眼部特征检测,若检测到眼部特征,则进行人脸、眼部特征信息和眼部特征信息提取。若未检测到眼部特征,则进行异常处理,不输出人脸注视解锁结果。
示例的,从如图5中(A)所示的第一图像中提取人脸、眼部特征信息,人脸、眼部特征信息可以包括人脸轮廓和人脸各个部位的特征信息,例如图5中(B)所示的眼睛、眉毛、鼻子、嘴巴、耳朵等部位的特征信息。
步骤404,电子设备根据场景信息和人脸姿态信息,定位第一图像对应的第一行为场景。
在一个示例中,电子设备可以将场景信息与人脸姿态信息通过分类器分类实现对行为场景的定位,得到第一图像对应的第一行为场景。例如,分类器可以为支持向量机(support vector machine,SVM),也可以使用其他类型的分类器,例如感知器方法、神经网络方法、 径向基(radial basis function,RBF)方法等分类器。
一种可能的实现方式中,若第一行为场景为正常行为场景,例如,正常光、正常距离、摄像头温度正常、正面人脸,电子设备在执行完步骤404之后,跳过步骤405和步骤406,即不对正常行为场景对应的人脸、眼部特征信息进行优化,电子设备将人脸、眼部特征信息直接输入至注视模型中,得到正常场景下的注视分数,然后在确定注视分数大于注视分数阈值时,进行解锁。
若第一行为场景为非正常行为场景,例如,强光、正常距离、摄像头温度正常、正面人脸,在这种场景采集第一图片时,背景光很强,采集的人脸比较暗,导致第一图像中的眼部特征模糊不清,可以采用步骤405中的第一行为场景对应的图像优化器对第一图像中的人脸、眼部特征信息进行优化,例如增强人脸、眼部特征信息,再将经过增强的人脸、眼部特征信息输入至注视模型,得到第一行为场景下的注视分数。
步骤405,在第一行为场景为非正常行为场景时,电子设备采用第一行为场景对应的图像优化器对人脸、眼部特征信息进行优化,得到优化后的人脸、眼部特征信息。
在一些实施例中,电子设备中设置有各个预设的行为场景对应的图像优化器,在定位第一图像对应的第一行为场景后,电子设备从各个预设的行为场景对应的图像优化器确定出第一行为场景对应的图像优化器,然后采用第一行为场景对应的图像优化器对人脸、眼部特征信息进行优化。
在其它一些实施例中,电子设备中可以设置有各个预设的行为场景对应的优化参数,在定位第一图像对应的第一行为场景后,电子设备从各个预设的行为场景对应的优化参数中确定出第一行为场景对应的优化参数,然后采用第一行为场景对应的优化参数对人脸、眼部特征信息进行优化。
由于不同行为场景下图像的主要噪声来源是不同的,通过定位行为场景可以预测当前行为场景主要噪声来源是什么类型的噪声,从而可以设定特定的图像优化器或优化参数有针对性的去优化图像,可以达到更好的优化效果。
步骤406,电子设备将优化后的人脸、眼部特征信息输入至注视模型中,得到注视分数。
步骤407,电子设备在确定注视分数大于注视分数阈值时,进行解锁。
相应的,电子设备在确定注视分数小于或等于注视分数阈值时,不进行解锁。
此处,各个行为场景下的注视分数阈值可以采用同一个注视分数阈值,即正常行为场景下和非正常行为场景下的注视分数阈值都相同。各个行为场景下的注视分数阈值也可以采用不同的注视分数阈值。
例如,正常行为场景对应的注视分数阈值为50,电子设备在确定注视分数大于50时,进行解锁,在确定注视分数小于或等于50时,不进行解锁。
本申请实施例中,通过结合采集到的第一图像和采集第一图像时的传感器数据,定位出当前的行为场景,然后根据行为场景匹配相对应的图像优化器优化人脸、眼部特征信息,可以有针对性地减少注视模型的输入数据的噪声,增强数据的有效性,从而可以提高复杂场景下的人脸注视解锁的准确率,降低非注视解锁率。
在上述实施例中,虽然对非正常行为场景对应的人脸、眼部特征信息进行了增强,但是并不能将图像的人脸、眼部特征信息增强到最优效果,为此,可以针对不同的非正常行为场景设置不同的注视分数阈值,这样可以得到一个更接近真实情况的人脸注视的检测结 果,提高用户的解锁体验。
一种可选的实现方式中,电子设备中包括预设的行为场景对应的动态阈值范围。该动态阈值范围可以通过不同场景对应的测试集对阈值模型训练得到。在步骤404之后,在步骤407之前,人脸注视解锁方法还可以包括如下步骤:
步骤408,确定第一行为场景对应的动态阈值范围。
例如,第一行为场景为强光场景,其对应的动态阈值范围为(-5,5)。
步骤409,根据场景信息,从第一行为场景对应的动态阈值范围中确定出一个动态阈值。
在强光场景下,相较于正常行为场景来说,影响动态阈值的主要因素为光照强度,可以根据预设的光照强度与动态阈值范围之间的变化关系,来确定第一行为场景对应的动态阈值,其中,变化关系可以为线性变化关系,也可以为非线性变化关系,此处不做具体限定。
步骤410,根据正常行为场景对应的静态阈值和确定出的动态阈值,确定注视分数阈值。
例如,正常行为场景对应的静态阈值为50,第一行为场景对应的动态阈值为-5,则第一行为场景对应的注视分数阈值为45。在注视分数大于45时,判断为注视图像,进行解锁,在注视分数小于或等于45时,判断为非注视图像,不进行解锁。
在另一种可选的实现方式中,电子设备中包括预设的行为场景与预设的分数阈值之间的第一对应关系。在步骤404之后,在步骤407之前,电子设备还可以根据第一行为场景和第一对应关系,确定第一行为场景对应的预设的分数阈值,然后将第一行为场景信息对应的预设的分数阈值作为注视分数阈值。
本申请实施例中,通过根据行为场景设定注视阈值,可以针对性地增强注视模型在某些特定场景的鲁棒性与泛化性。
用户在使用电子设备拍摄人脸时,由于用户握持电子设备的姿势多变,电子设备的设备姿态可以为横屏状态,也可以为竖屏状态,还可以是除横屏状态和竖屏状态之外的其它状态,例如倒屏状态。当电子设备处于非竖屏状态时采集人脸图像,会导致难以提取人脸、眼部特征信息,影响到解锁结果。
为解决该问题,在步骤403之前,电子设备还可以根据传感器数据确定电子设备的设备姿态,根据设备姿态确定是否需要对第一图像进行旋转,之后再进行人脸特征检测。电子设备可以确定电子设备处于设备姿态时屏幕长轴所在的方向与电子设备处于竖屏状态时屏幕长轴所在的方向之间的偏转角度,然后将第一图像旋转偏转角度。
下面对电子设备的设备姿态进行介绍。
在横屏状态下,电子设备的显示屏基本呈横条形。在竖屏状态下,电子设备的显示屏基本成竖条形。具体的,在横屏状态下和在竖屏状态下,电子设备的显示屏的高宽比是不同的。显示屏的高宽比又可以称之为显示屏的纵横比,为显示屏的高度与宽度的比值。在横屏状态下,显示屏的高度为显示屏的短边的长度,显示屏的宽度为显示屏的长边的长度。在竖屏状态下,显示屏的高度为显示屏的长边的长度,显示屏的宽度为显示屏的短边的长度。其中,显示屏的长边为显示屏的四条边中相互平行且相等的两条长一点的边,显示屏的短边为显示屏的四条边中相互平行且相等的两条短一点的边。
例如,电子设备在如图6中(A)所示横屏状态下,显示屏的高度为Y,显示屏的宽 度为X,则显示屏的高宽比为Y/X,其中Y/X<1。需要说明的是,当电子设备在如图6中(A)所示的横屏状态下倾斜或旋转一个较小的角度(例如该角度不大于第一角度阈值,比如20°、15°、5°等),电子设备仍然视为处于横屏状态。例如,电子设备在图6中(A)的横屏状态下,顺时针旋转的角度为α,使得电子设备处于图6中(B)所示的状态,α不大于第一角度阈值时,电子设备将图6中(B)所示的状态视为横屏状态。再例如,电子设备在图6中(C)所示的竖屏状态下,显示屏的高度为X,显示屏的宽度为Y,则显示屏的高宽比为X/Y,其中,X/Y>1。还需要说明的是,当电子设备在如图6中(C)所示的竖屏状态下倾斜或旋转一个较小的角度(例如该角度不大于第二角度阈值,比如20°、15°、5°等),电子设备仍然视为处于竖屏状态。例如,电子设备在图6中(C)所示的竖屏状态下,逆时针旋转的角度为β,使得电子设备处于图6中(D)所示的状态,β不大于第二角度阈值时,电子设备将图6中(D)所示的状态视为竖屏状态。可以理解的是,第一角度阈值和第二角度阈值可以相同,也可以不同,可以是根据实际需要进行设定的,对此不作限定。
示例的,当电子设备处于竖屏状态时,拍摄的用户人脸图像如图5中(A)所示,当电子设备处于横屏状态时,拍摄的用户人脸图像如图7中(A)所示,当电子设备处于如图6中(E)所示的倒屏状态时,拍摄的用户人脸图像如图7中(B)所示。如图7中(A)和图7中(B)所示的用户人脸图像,进行人脸特征提取较为困难,需要花费很长的时间。
例如,电子设备在如图6中(C)所示的竖屏状态下倾斜或旋转一个较大的角度(例如该角度大于或等于第二角度阈值),如该角度等于90度或270度,则为横屏状态,如该角度为108度,则为倒屏状态。
本申请实施例中,若电子设备处于非竖屏状态采集第一图像,以电子设备处于横屏状态为例,拍摄得到如图7中(A)所示的人脸图像,电子设备确定设备姿态与竖屏状态的偏转角度为90度,按照电子设备的偏转方向将人脸图像旋转90度,这样可得到的如图5中(A)所示的人脸图像。如此,可以便于准确的提取人脸和眼部特征信息。
通过结合传感器数据对处于非竖屏状态下采集的第一图像进行旋转操作,可以很好地解决电子设备倒屏无法解锁问题。
下面提供一个具体的示例,来说明本申请实施例提供的人脸注视解锁方法的实现过程。
如图8所示,该人脸注视解锁方法包括如下步骤:
步骤801,采集第一图像。
步骤802,获取在采集所述第一图像时所述电子设备中的传感器数据。
步骤803,根据传感器数据(如姿态传感器)确定电子设备是否倒屏,若是,则执行步骤804;若否,则保持原图,执行步骤805。
步骤804,根据电子设备的倒屏方向旋转第一图像。
步骤805,对第一图像进行人脸检测,并确定是否检测到人脸,若是,则执行步骤806;若否,则执行步骤810。
步骤806,对第一图像进行人脸姿态检测,并确定是否检测到人脸姿态,若是,则执行步骤807和步骤808;若否,则执行步骤810。
步骤807,对第一图像进行人脸姿态特征提取,得到人脸姿态信息。
步骤808,对第一图像进行眼部检测,并确定是否检测到眼睛,若是,则执行步骤809;若否,则执行步骤810。
步骤809,对第一图像进行人脸、眼部特征提取,得到人脸、眼部特征信息。之后,进行步骤811。
步骤810,进入异常处理,流程结束。
步骤811,根据所述第一图像和所述传感器数据,确定场景信息。
场景信息包括光照强度、拍摄距离、所述电子设备的姿态、摄像头温度。
步骤812,根据所述场景信息和所述人脸姿态信息,定位所述第一图像对应的行为场景,并匹配行为场景对应的图像优化器或优化参数。
步骤813,按照行为场景对应的图像优化器或优化参数优化人脸、眼部特征信息,得到优化后的人脸、眼部特征信息。
步骤814,将优化后的人脸、眼部特征信息输入至注视模型。
步骤815,输出注视分数。
步骤816,确定所述注视分数是否大于注视分数阈值,若是,则执行步骤817;若否,则执行步骤818。
步骤817,进行解锁。
步骤818,不进行解锁。
应理解,本申请实施例提供的人脸注视解锁方法可以适用于多种场景。比如,电子设备锁屏状态下需要进行解锁的场景,或者,某个设置有人脸注视解锁功能的应用(例如支付宝、微信等)或某个应用的页面需要解锁的场景。总之,本申请实施例提供的人脸注视解锁方法可以应用在任何需要进行人脸注视解锁的场景,本文将不一一列举。
此外,本申请实施例中根据传感器数据定位行为场景,匹配优化器或优化参数优化输入图像的方式不局限于优化人脸注视场景检测输入图像,也可用于其他目标检测(如车辆、动物等)的输入数据优化。本方案的通过行为场景来设定注视阈值的方式不局限注视模型或人脸注视分类器,还可用于大多数目标分类器(人脸检测、目标识别)的阈值设置。
本申请的各个实施方式可以任意进行组合,以实现不同的技术效果。
上述本申请提供的实施例中,从电子设备作为执行主体的角度对本申请实施例提供的方法进行了介绍。为了实现上述本申请实施例提供的方法中的各功能,电子设备可以包括硬件结构和/或软件模块,以硬件结构、软件模块、或硬件结构加软件模块的形式来实现上述各功能。上述各功能中的某个功能以硬件结构、软件模块、还是硬件结构加软件模块的方式来执行,取决于技术方案的特定应用和设计约束条件。
采用硬件实现时,该电子设备的硬件实现可参考图9及其相关描述。
参见图9,所述电子设备100,包括:触摸屏901,其中,所述触摸屏901包括触控面板907和显示屏908;一个或多个处理器902;存储器903;一个或多个应用程序(未示出);以及一个或多个计算机程序904,传感器905、上述各器件可以通过一个或多个通信总线906连接。其中该一个或多个计算机程序904被存储在上述存储器903中并被配置为被该一个或多个处理器902执行,该一个或多个计算机程序904包括指令,上述指令可以用于执行上述任一实施例中的方法。
本申请实施例还提供一种计算机可读存储介质,该存储介质可以包括存储器,该存储器可存储有程序,该程序被执行时,使得电子设备执行包括如前的图3、图4、图8所示的方法实施例中记载的全部或部分步骤。
本申请实施例还提供一种包含计算机程序产品,当所述计算机程序产品在电子设备上 运行时,使得所述电子设备执行包括如前的图3、图4、图8所示的方法实施例中记载的全部或部分步骤。
另外,本申请的实施例还提供一种装置,这个装置具体可以是芯片,组件或模块,该装置可包括相连的处理器和存储器;其中,存储器用于存储计算机执行指令,当装置运行时,处理器可执行存储器存储的计算机执行指令,以使芯片执行上述各方法实施例中的方法。
其中,本申请实施例提供的电子设备、计算机存储介质、计算机程序产品或芯片均用于执行上文所提供的对应的方法,因此,其所能达到的有益效果可参考上文所提供的对应的方法中的有益效果,此处不再赘述。
通过以上实施方式的描述,所属领域的技术人员可以了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其他的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其他的形式。
作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。

Claims (13)

  1. 一种人脸注视解锁方法,其特征在于,应用于电子设备,所述方法包括:
    采集第一图像,并获取在采集所述第一图像时所述电子设备中的传感器数据;
    根据所述第一图像和所述传感器数据,确定场景信息;所述场景信息包括以下内容中的至少一项:当前的光照强度、拍摄距离、所述电子设备的姿态、摄像头温度;
    从所述第一图像中提取人脸、眼部特征信息和人脸姿态信息;
    根据所述场景信息和所述人脸姿态信息,定位所述第一图像对应的第一行为场景;
    在第一行为场景为非正常行为场景时,采用与所述第一行为场景对应的图像优化器对所述人脸、眼部特征信息进行优化,得到优化后的人脸、眼部特征信息;
    将所述优化后的人脸、眼部特征信息输入至注视模型中,得到注视分数;
    在确定所述注视分数大于注视分数阈值时,进行解锁。
  2. 如权利要求1所述的方法,其特征在于,所述从所述第一图像中提取人脸、眼部特征信息和人脸姿态信息之前,还包括:
    根据所述传感器数据确定所述电子设备的设备姿态;
    确定所述电子设备处于所述设备姿态时屏幕长轴所在的方向与所述电子设备处于竖屏状态时屏幕长轴所在的方向之间的偏转角度;
    将所述第一图像旋转所述偏转角度。
  3. 如权利要求1或2所述的方法,其特征在于,在确定所述注视分数大于注视分数阈值时,进行解锁之前,还包括:
    根据所述第一行为场景和第一对应关系,确定所述第一行为场景对应的预设的分数阈值;所述第一对应关系包括预设的行为场景与预设的分数阈值之间的对应关系;
    将所述第一行为场景对应的预设的分数阈值作为所述注视分数阈值。
  4. 如权利要求1或2所述的方法,其特征在于,在确定所述注视分数大于注视分数阈值时,进行解锁之前,还包括:
    确定所述第一行为场景对应的动态阈值范围;
    根据所述场景信息,从所述第一行为场景对应的动态阈值范围中确定出一个动态阈值;
    根据正常行为场景对应的静态阈值和确定出的所述动态阈值,确定所述注视分数阈值。
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:
    获取注视图像集和非注视图像集,所述注视图像集包括在各个预设的行为场景下采集的注视图像,所述非注视图像集包括在各个预设的行为场景下采集的非注视图像;
    针对所述注视图像集中的每个注视图像,采用采集所述注视图像时的行为场景所对应的图像优化器,对所述注视图像中的人脸、眼部特征信息进行优化,得到优化后的第一人脸、眼部特征信息;
    针对所述非注视图像集中的每个非注视图像,采用采集所述注视图像时的行为场景所对应的图像优化器,对所述非注视图像中的人脸、眼部特征信息进行优化,得到优化后的第二人脸、眼部特征信息;
    为每个所述优化后的第一人脸、眼部特征信息和每个所述优化后的第二人脸、眼部特征信息设置行为场景标签;
    将设置有行为场景标签的所述优化后的第一人脸、眼部特征信息和设置有行为场景标 签的所述优化后的第二人脸、眼部特征信息输入至神经网络模型中进行模型训练,得到注视模型。
  6. 如权利要求1-5任一项所述的方法,其特征在于,传感器数据包括以下内容中的至少一项:所述电子设备中的姿态传感器采集的数据、距离传感器采集的数据、环境光传感器采集的数据、温度传感器采集的数据。
  7. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;
    以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述电子设备执行时,使得所述电子设备执行以下步骤:
    采集第一图像,并获取在采集所述第一图像时所述电子设备中的传感器数据;
    根据所述第一图像和所述传感器数据,确定场景信息;所述场景信息包括以下内容中的至少一项:当前的光照强度、拍摄距离、所述电子设备的姿态、摄像头温度;
    从所述第一图像中提取人脸、眼部特征信息和人脸姿态信息;
    根据所述场景信息和所述人脸姿态信息,定位所述第一图像对应的第一行为场景;
    在第一行为场景为非正常行为场景时,采用与所述第一行为场景对应的图像优化器对所述人脸、眼部特征信息进行优化,得到优化后的人脸、眼部特征信息;
    将所述优化后的人脸、眼部特征信息输入至注视模型中,得到注视分数;
    在确定所述注视分数大于注视分数阈值时,进行解锁。
  8. 如权利要求7所述的电子设备,其特征在于,当所述指令被所述电子设备执行时,使得所述电子设备在从所述第一图像中提取人脸、眼部特征信息和人脸姿态信息之前,执行以下步骤:
    根据所述传感器数据确定所述电子设备的设备姿态;
    确定所述电子设备处于所述设备姿态时屏幕长轴所在的方向与所述电子设备处于竖屏状态时屏幕长轴所在的方向之间的偏转角度;
    将所述第一图像旋转所述偏转角度。
  9. 如权利要求7或8所述的电子设备,其特征在于,当所述指令被所述电子设备执行时,使得所述电子设备在确定所述注视分数大于注视分数阈值时,进行解锁之前,执行以下步骤:
    根据所述第一行为场景和第一对应关系,确定所述第一行为场景对应的预设的分数阈值;所述第一对应关系包括预设的行为场景与预设的分数阈值之间的对应关系;
    将所述第一行为场景信息对应的预设的分数阈值作为所述注视分数阈值。
  10. 如权利要求7或8所述的电子设备,其特征在于,当所述指令被所述电子设备执行时,使得所述电子设备在确定所述注视分数大于注视分数阈值时,进行解锁之前,执行以下步骤:
    确定所述第一行为场景对应的动态阈值范围;
    根据所述场景信息,从所述第一行为场景对应的动态阈值范围中确定出一个动态阈值;
    根据正常行为场景对应的静态阈值和确定出的所述动态阈值,确定所述注视分数阈值。
  11. 如权利要求7-10任一项所述的电子设备,其特征在于,当所述指令被所述电子设 备执行时,使得所述电子设备还执行以下步骤:
    获取注视图像集和非注视图像集,所述注视图像集包括在各个预设的行为场景下采集的注视图像,所述非注视图像集包括在各个预设的行为场景下采集的非注视图像;
    针对所述注视图像集中的每个注视图像,采用采集所述注视图像时的行为场景所对应的图像优化器,对所述注视图像进行优化,得到优化后的注视图像;
    针对所述非注视图像集中的每个非注视图像,采用采集所述注视图像时的行为场景所对应的图像优化器,对所述非注视图像进行优化,得到优化后的非注视图像;
    为每个所述优化后的注视图像和每个所述优化后的非注视图像设置行为场景标签;
    将设置有行为场景标签的所述优化后的注视图像和设置有行为场景标签的所述优化后的非注视图像输入至神经网络模型中进行模型训练,得到注视模型。
  12. 如权利要求7-11任一项所述的电子设备,其特征在于,传感器数据包括以下内容中的至少一项:所述电子设备中的姿态传感器采集的数据、距离传感器采集的数据、环境光传感器采集的数据、温度传感器采集的数据。
  13. 一种计算机可读存储介质,其特征在于,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-6中任一项所述的方法。
PCT/CN2021/082993 2020-05-26 2021-03-25 一种人脸注视解锁方法及电子设备 WO2021238373A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010452422.8A CN113723144A (zh) 2020-05-26 2020-05-26 一种人脸注视解锁方法及电子设备
CN202010452422.8 2020-05-26

Publications (1)

Publication Number Publication Date
WO2021238373A1 true WO2021238373A1 (zh) 2021-12-02

Family

ID=78671165

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/082993 WO2021238373A1 (zh) 2020-05-26 2021-03-25 一种人脸注视解锁方法及电子设备

Country Status (2)

Country Link
CN (1) CN113723144A (zh)
WO (1) WO2021238373A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116052261A (zh) * 2022-05-31 2023-05-02 荣耀终端有限公司 视线估计方法及电子设备
CN116048243A (zh) * 2022-05-20 2023-05-02 荣耀终端有限公司 一种显示方法和电子设备
CN117711040A (zh) * 2023-05-24 2024-03-15 荣耀终端有限公司 标定方法和电子设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116704589B (zh) * 2022-12-01 2024-06-11 荣耀终端有限公司 一种注视点估计方法、电子设备和计算机可读存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107580114A (zh) * 2017-08-24 2018-01-12 广东欧珀移动通信有限公司 生物识别方法、移动终端以及计算机可读存储介质
CN107862265A (zh) * 2017-10-30 2018-03-30 广东欧珀移动通信有限公司 图像处理方法及相关产品
CN110472504A (zh) * 2019-07-11 2019-11-19 华为技术有限公司 一种人脸识别的方法和装置
CN110610117A (zh) * 2018-06-15 2019-12-24 中兴通讯股份有限公司 一种人脸识别方法、装置及存储介质
CN110647865A (zh) * 2019-09-30 2020-01-03 腾讯科技(深圳)有限公司 人脸姿态的识别方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107580114A (zh) * 2017-08-24 2018-01-12 广东欧珀移动通信有限公司 生物识别方法、移动终端以及计算机可读存储介质
CN107862265A (zh) * 2017-10-30 2018-03-30 广东欧珀移动通信有限公司 图像处理方法及相关产品
CN110610117A (zh) * 2018-06-15 2019-12-24 中兴通讯股份有限公司 一种人脸识别方法、装置及存储介质
CN110472504A (zh) * 2019-07-11 2019-11-19 华为技术有限公司 一种人脸识别的方法和装置
CN110647865A (zh) * 2019-09-30 2020-01-03 腾讯科技(深圳)有限公司 人脸姿态的识别方法、装置、设备及存储介质

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116048243A (zh) * 2022-05-20 2023-05-02 荣耀终端有限公司 一种显示方法和电子设备
CN116048243B (zh) * 2022-05-20 2023-10-20 荣耀终端有限公司 一种显示方法和电子设备
CN116052261A (zh) * 2022-05-31 2023-05-02 荣耀终端有限公司 视线估计方法及电子设备
CN117711040A (zh) * 2023-05-24 2024-03-15 荣耀终端有限公司 标定方法和电子设备

Also Published As

Publication number Publication date
CN113723144A (zh) 2021-11-30

Similar Documents

Publication Publication Date Title
WO2021238373A1 (zh) 一种人脸注视解锁方法及电子设备
WO2020182065A1 (zh) 快捷功能启动的方法及电子设备
WO2021249053A1 (zh) 图像处理的方法及相关装置
CN111768416B (zh) 照片裁剪方法及装置
WO2021008551A1 (zh) 一种指纹防伪方法和电子设备
CN111553846B (zh) 超分辨率处理方法及装置
WO2022052897A1 (zh) 调整内存配置参数的方法和装置
WO2021051982A1 (zh) 调用硬件接口的方法及电子设备
CN111400605A (zh) 基于眼球追踪的推荐方法及装置
CN111768352B (zh) 图像处理方法及装置
WO2021000943A1 (zh) 一种指纹开关的管理方法及装置
CN111669462A (zh) 一种显示图像的方法及相关装置
CN111612723B (zh) 图像修复方法及装置
WO2021115424A1 (zh) 一种语音支付方法和电子设备
CN111524528B (zh) 防录音检测的语音唤醒方法及装置
CN111381996B (zh) 内存异常处理方法及装置
CN111880661A (zh) 手势识别方法及装置
CN114422686A (zh) 参数调整方法及相关装置
CN116311389B (zh) 指纹识别的方法和装置
CN115633255B (zh) 视频处理方法和电子设备
US20230401897A1 (en) Method for preventing hand gesture misrecognition and electronic device
CN115390738A (zh) 卷轴屏开合方法及相关产品
CN111581119B (zh) 页面回收方法及装置
CN112712377A (zh) 一种产品缺陷整理汇总管理数据库平台系统
WO2022143083A1 (zh) 应用程序搜索方法、设备及介质

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: 21813139

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: 21813139

Country of ref document: EP

Kind code of ref document: A1