Emotion detection method, device, medium and electronic equipment
By using a camera device in a mobile device to collect video frames and extract facial feature vectors, the convenience and accuracy of emotion detection are achieved, the problem of device dependence in the existing technology is solved, and driving safety is improved.
Patent Information
- Application Number
- CN202011435243.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-10
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2040-12-10
AI Technical Summary
Existing technology relies on special equipment such as temperature sensors and heartbeat sensors for emotion detection of drivers and passengers, resulting in high cost and inconvenience, and making it difficult to achieve convenient emotion detection.
Emotion detection is achieved by installing a camera device in a mobile device, collecting video frames, extracting facial feature vectors of the driver or passenger, and determining the confidence that their emotions belong to multiple preset emotion categories.
Without adding additional equipment, the ease of use and accuracy of emotion detection are improved. Auditory, olfactory and visual adjustment measures are adopted through emotion detection to improve the driving safety of mobile devices.
Smart Images

Figure CN112541425B
Abstract
Description
Technical Field
[0001] The present disclosure relates to computer vision technology, and in particular to an emotion detection method, an emotion detection device, a storage medium, and an electronic device. Background Art
[0002] In the field of driving, since certain emotions of drivers and passengers of mobile devices may affect the safe driving of mobile devices, it is very necessary to detect the emotions of drivers and passengers and take corresponding measures in a timely manner according to the emotions obtained from the detection to calm the emotions of relevant personnel as much as possible, thereby reducing the impact of emotions on the safe driving of mobile devices. Summary of the invention
[0003] In order to solve the above technical problems, the present disclosure is proposed. Embodiments of the present disclosure provide an emotion detection method, device, storage medium and electronic device.
[0004] According to one aspect of an embodiment of the present disclosure, there is provided an emotion detection method, comprising: acquiring an image block sequence containing a target object from a plurality of video frames acquired by a camera device disposed in a mobile device; determining a facial feature vector corresponding to the image block sequence; determining, based on the facial feature vector, the confidence that the emotions of the target objects in the plurality of video frames belong to a plurality of preset emotion categories, respectively, to obtain a plurality of confidences; and determining, based on the plurality of confidences, the emotions of the target objects in the plurality of video frames.
[0005] According to another aspect of an embodiment of the present disclosure, there is provided an emotion detection device, comprising: an image block acquisition module, for acquiring an image block sequence containing a target object from a plurality of video frames acquired by a camera device disposed in a mobile device; a feature vector acquisition module, for determining a facial feature vector corresponding to the image block sequence acquired by the image block acquisition module; a confidence acquisition module, for determining, based on the facial feature vector acquired by the feature vector acquisition module, the confidence that the emotions of the target objects in the plurality of video frames belong to a plurality of preset emotion categories, respectively, to obtain a plurality of confidences; and an emotion determination module, for determining the emotions of the target objects in the plurality of video frames based on the plurality of confidences acquired by the confidence acquisition module.
[0006] According to another aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to implement the above method.
[0007] According to another aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the above method.
[0008] Based on the above-mentioned embodiment of the present disclosure, an emotion detection method and device are provided. By extracting an image block sequence of the facial region of a target object such as a driver or a passenger located in the mobile device from a video frame captured by a camera device set in the mobile device, and obtaining a facial feature vector from the image block sequence, since the emotional changes of the target object are often presented through the face, the facial feature vector obtained by the present disclosure can show the emotional characteristics of the target object, so that the present disclosure can obtain the confidence that the target object's emotions belong to multiple preset emotional categories by using the facial feature vector, and since the confidence can reflect the emotional tendency of the target object in multiple video frames, the present disclosure can timely and accurately determine the emotion of the target object in the video based on the image block sequence containing the facial region of the target object without using special equipment such as temperature sensors and heartbeat sensors. It can be seen that the technical solution provided by the present disclosure is conducive to improving the ease of use and accuracy of emotion detection, and by taking measures such as auditory adjustment, olfactory adjustment and visual adjustment according to the detected emotions of the target object, it is conducive to improving the driving safety of the mobile device.
[0009] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] By describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present disclosure will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. In the drawings, the same reference numerals generally represent the same components or steps.
[0011] Figure 1 is a schematic diagram of an embodiment of a DMS structure in a vehicle of the present disclosure;
[0012] Figure 2 A flowchart of an embodiment of the emotion detection method disclosed herein;
[0013] Figure 3 A flowchart of an embodiment of the present disclosure for realizing emotion detection using facial feature vectors of image blocks;
[0014] Figure 4A flowchart of an embodiment of the present disclosure for determining the confidence that the emotions of target objects in multiple video frames belong to multiple preset emotion categories;
[0015] Figure 5 A flowchart of a more specific embodiment of the present disclosure for determining the confidence that the emotions of target objects in multiple video frames belong to multiple preset emotion categories;
[0016] Figure 6 A flowchart of another more specific embodiment of the present disclosure for determining the confidence that the emotions of a target object in a plurality of video frames respectively belong to a plurality of preset emotion categories;
[0017] Figure 7 A schematic diagram of another embodiment of the present disclosure for determining the confidence that the emotions of a target object in a plurality of video frames respectively belong to a plurality of preset emotion categories;
[0018] Figure 8 It is a structural schematic diagram of an embodiment of the emotion detection device disclosed in the present invention;
[0019] Fig. 9 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present application. DETAILED DESCRIPTION
[0020] The exemplary embodiments according to the present disclosure will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all the embodiments of the present disclosure, and it should be understood that the present disclosure is not limited to the exemplary embodiments described here.
[0021] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
[0022] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0023] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0024] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0025] In addition, the term "and / or" in this disclosure is only a description of the association relationship of associated objects, indicating that there may be three relationships, such as A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0026] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0027] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0028] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0029] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0030] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0031] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems or servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0032] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, target programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment. In a distributed cloud computing environment, tasks can be performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0033] SUMMARY OF THE DISCLOSURE
[0034] In the process of implementing the present disclosure, the inventors found that currently, special devices such as sensors are usually used to detect the emotions of the target object. For example, special devices such as temperature sensors and heartbeat sensors are set to detect the emotions of the target object.
[0035] In practical applications, setting up special equipment such as sensors may not only lead to increased costs, but also cause problems for the usability of emotion detection. For example, a heartbeat sensor usually needs to be in contact with the target object's body. The heartbeat sensor may not only cause inconvenience to the target object, but also, if the target object forgets to wear the heartbeat sensor, the target object's emotions cannot be detected.
[0036] It is common to install cameras in mobile devices such as vehicles for fatigue detection and driving records. If the video frames captured by the cameras installed in the mobile devices can be used to detect the emotions of the target objects, it will be helpful to conveniently detect the emotions of the target objects without adding additional equipment.
[0037] Exemplary Overview
[0038] The emotion detection technology solution disclosed in the present invention can be applied to a variety of scenarios. For example, the emotion detection technology solution provided by the present invention can be applied to DMS (Driver Monitor System) applications. Figure 1 shown.
[0039] Combine the following Figure 1 , the application of the emotion detection technology disclosed in the present invention is explained.
[0040] Figure 1In the present invention, at least one camera device 100 and a DMS 101 are arranged in a vehicle, and the video frames acquired by the camera device 100 can be provided to the DMS 101 in real time. When the driver is in the driving position of the vehicle, the driver's face should be within the field of view of the camera device 100, that is, the video acquired by the camera device 100 usually includes the driver's face (such as the front face, etc.).
[0041] DMS101 at least includes a receiving module 1011, an emotion detection device 1012 and an emotion regulation module 1013. After receiving the video frames transmitted in real time by the camera device 100, the receiving module 1011 triggers the emotion detection device 1012 to perform emotion detection processing on the received video frames. The emotion detection device 1012 determines the emotions of the target object in multiple video frames in each time window (such as 2 seconds, etc.). If the emotion of the target object determined by the emotion detection device 1012 is an emotion that is not conducive to the safe driving of the vehicle, the emotion regulation module 1013 can alleviate the emotion of the target object by implementing auditory adjustment, olfactory adjustment and visual adjustment measures, thereby ensuring the safe driving of the vehicle.
[0042] The emotions that are not conducive to safe driving of the vehicle may be negative emotions such as sadness or anger. The auditory adjustment measures may include turning on the music playback function and the comfort voice playback function. The olfactory adjustment measures may include the function of emitting a predetermined fragrance. The visual adjustment measures may include turning on the smiley face video playback function and the light flashing function.
[0043] In addition, the technical solution for emotion detection provided by the present disclosure can also be applied to IMS (In-cabin Monitoring System) applications. For example, the present disclosure can use the IMS in the vehicle to detect the emotions of people in the co-pilot seat or the back seat of the vehicle, so as to help avoid the negative emotions of the people in the co-pilot seat or the back seat of the vehicle from affecting the driver as much as possible. The technical solution provided by the present disclosure is applicable to the specific implementation process in IMS applications, which is basically the same as the above-mentioned specific implementation process applicable to DMS applications, and will not be described in detail here.
[0044] Exemplary Methods
[0045] Figure 2 FIG. 1 is a flow chart of an embodiment of the emotion detection method disclosed in the present invention. Figure 2 The method shown includes steps: S200, S201, S202 and S203. Each step is described below.
[0046] S200: Acquire a sequence of image blocks including a facial region of a target object from a plurality of video frames acquired by a camera device disposed in a mobile device.
[0047] The mobile device in the present disclosure may refer to a vehicle capable of carrying people, such as a private car and public transportation, etc. The target object in the present disclosure generally refers to the driver of the mobile device. Of course, the target object may also be other people in the mobile device, such as a person in the co-pilot seat and a passenger in a public transportation vehicle, etc.
[0048] In the case where the target object is the driver of the mobile device, the camera device in the present disclosure can be installed at the steering column of the mobile device or the A-pillar on the driver's side. The installation position of the camera device should ensure that the face (such as the front face) of the driver at the driving position is within the field of view of the camera device. In the case where the target object is a passenger in the mobile device, the installation position of the camera device can be set according to actual needs. For example, the camera device can be installed at the A-pillar on the co-pilot side of the mobile device to ensure that the face (such as the front face) of the passenger at the co-pilot position is within the field of view of the camera device. For another example, the camera device can be installed at the B-pillar or the back of the front seat of the mobile device to ensure that the face (such as the front face) of the passenger in the back row is within the field of view of the camera device. In addition, multiple cameras can be installed in the mobile device to achieve real-time shooting of the driver and at least one passenger, so that the emotion detection of the driver and at least one passenger can be achieved based on the video frames acquired by each camera device.
[0049] The camera device in the present disclosure may be a camera device based on RGB (Red Green Blue) or a camera device based on IR (Infrared Radiation), etc. In addition, the camera device may be a monocular camera device or a binocular camera device, etc.
[0050] The multiple video frames in the present disclosure can be all video frames in a predetermined time window (such as n seconds, where n is a positive number); or can be multiple video frames selected from all video frames in a predetermined time window; for example, multiple video frames containing the face of a target object selected from all video frames in a predetermined time window.
[0051] The present disclosure can obtain image blocks containing the face region of the target object in each video frame by performing image recognition and other processing on multiple video frames, thereby obtaining an image block sequence. The face region here generally refers to a region containing at least one organ of the face. In an example, the image block of the present disclosure can be an image block containing facial organs such as eyebrows, eyes, nose, mouth, and ears.
[0052] S201: Determine a facial feature vector corresponding to an image block sequence.
[0053] The present disclosure may utilize a neural network processing unit or other methods to perform feature extraction operations on an image block sequence, thereby obtaining a facial feature vector corresponding to the image block sequence, and the facial feature vector may refer to a one-dimensional array formed by multiple vector elements used to describe facial features. The neural network processing unit in the present disclosure may be a data processing unit such as a CPU (Central Processing Unit), a GPU (Graphics Processing Unit), or a BPU (Brain Processing Unit) for executing the algorithm included in the neural network. The facial feature vector corresponding to the image block sequence in the present disclosure may include: a facial feature vector of each image block in the image block sequence.
[0054] In one example, the present disclosure can use each image block in the image block sequence as input, and successively provide it to the neural network processing unit for extracting features, so as to successively obtain the facial feature vector of each image block, and the facial feature vectors of all image blocks are the facial feature vectors corresponding to the image block sequence. The neural network for extracting features here can be a convolutional neural network, etc.
[0055] S202: Determine, based on the facial feature vector, the confidence levels that the emotions of the target object in the multiple video frames belong to multiple preset emotion categories, and obtain multiple confidence levels.
[0056] The preset emotion categories of the present disclosure may include, but are not limited to, at least one of: happy, sad, angry, disgust, surprise, fear, and neutral.
[0057] The confidence level that the emotion of the target object in the present disclosure belongs to a preset emotion category may refer to the possibility that the emotion of the target object belongs to a preset emotion category. The number of multiple confidence levels finally obtained in step S202 is usually related to the number of multiple preset emotion categories. For example, the number of multiple confidence levels finally obtained in step S202 is usually the same as the number of multiple preset emotion categories. That is, if the number of multiple preset emotion categories is n (n is an integer greater than 1), step S202 finally obtains n confidence levels.
[0058] In one example, for an image block of any facial area in an image block sequence, the present disclosure can perform emotion recognition processing on the facial feature vector of the image block, thereby obtaining the confidence that the emotions of the target object in the video frame corresponding to the image block belong to multiple preset emotion categories, that is, obtaining a set of confidences (such as a set of confidences including n confidences), so that the present disclosure can obtain a set of confidences corresponding to each of the m (m is an integer greater than 1) image blocks contained in the image block sequence, that is, after obtaining m sets of confidences (such as n×m confidences), the present disclosure can determine the confidence that the emotions of the target objects in multiple video frames belong to multiple preset emotion categories according to a set of confidences corresponding to each image block in the image block sequence, that is, finally obtain multiple confidences (such as n confidences).
[0059] S203: Determine the emotions of the target objects in the multiple video frames according to the multiple confidence levels.
[0060] The emotion of the target object in the multiple video frames finally determined by the present disclosure is usually one of the preset emotion categories. The present disclosure can use the conditions pre-set for the confidence level to judge whether the confidence levels meet the conditions for the multiple confidence levels, and according to the judgment results, the preset emotion category corresponding to the confidence levels that meet the conditions is used as the emotion of the target object in the multiple video frames.
[0061] The present disclosure extracts an image block sequence of the facial region of a target object such as a driver or a passenger located in the mobile device from a video frame captured by a camera device disposed in the mobile device, and obtains a facial feature vector from the image block sequence. Since the emotional changes of the target object are often presented through the face, the facial feature vector obtained by the present disclosure can show the emotional characteristics of the target object, so that the present disclosure can obtain the confidence that the target object's emotions belong to multiple preset emotional categories by using the facial feature vector. Since the confidence can reflect the emotional tendency of the target object in multiple video frames, the present disclosure can accurately determine the emotion of the target object in the video based on the image block sequence containing the facial region of the target object without using special equipment such as temperature sensors and heartbeat sensors. It can be seen that the technical solution provided by the present disclosure is conducive to improving the ease of use and accuracy of emotion detection, and by taking measures such as auditory adjustment, olfactory adjustment and visual adjustment according to the detected emotions of the target object, it is conducive to improving the driving safety of the mobile device.
[0062] In an optional example, the present disclosure can perform face recognition processing on multiple video frames respectively, obtain face identification of target objects in multiple video frames, and use image blocks of face areas with the same face identification obtained from multiple video frames as an image block sequence. The present disclosure can use a neural network processing unit for face recognition to perform face recognition processing on multiple video frames respectively, so that the face identification of at least one target object in each video frame can be obtained based on the information output by the neural network processing unit. The neural network for face recognition can be a convolutional neural network that includes at least a convolutional layer, a pooling layer, and a fully connected layer.
[0063] The present disclosure obtains an image block sequence based on face recognition, and can realize emotion detection on a specific target object among multiple target objects in a video frame, and can also realize emotion detection on multiple target objects in a video frame separately.
[0064] In an optional example, the present disclosure may adopt a serial face region detection method to obtain an image block sequence. For example, each video frame in the present disclosure has its own acquisition time (i.e., the time when the camera device set in the mobile device acquires and generates the video frame). The present disclosure may perform face region detection on each video frame in sequence according to the sequence of the acquisition time of each video frame, thereby successively obtaining image blocks containing the face region of the target object extracted from each video frame, and then obtaining an image block sequence. As a more specific example, the present disclosure can use video frames captured in real time by a camera device disposed in a mobile device as inputs, respectively, and sequentially execute operations of a model for face detection through the mobile device, and sequentially obtain face detection results of each video frame based on the calculation results of the model, that is, obtain the face area of the target object in each video frame. The present disclosure can perform expansion processing on the face area in each video frame, for example, the length and width of the face area are each expanded by n1 (n1 is an integer greater than 1, such as n1 is an even number such as 10) pixels to obtain the face expansion area in each video, so that the face expansion area can be cut out from each video frame, thereby obtaining an image block sequence formed by multiple face expansion image blocks.
[0065] Since the video frames collected by the camera device in real time can form a time-based video stream, the present disclosure, by adopting serial detection, is conducive to obtaining image blocks in real time, thereby facilitating timely acquisition of image block sequences, and further facilitating improving the real-time performance of emotion detection.
[0066] In an optional example, the present disclosure may adopt a parallel face region detection method to obtain an image block sequence. For example, the present disclosure may obtain multiple video frames at one time, and the present disclosure may perform face region detection on each obtained video frame at the same time, thereby obtaining image blocks containing the face region of the target object extracted from each video frame in parallel, and then obtaining an image block sequence. In a more specific example, when receiving a video frame packet transmitted by a camera device set in a mobile device, the present disclosure may use multiple video frames in the video frame packet as inputs respectively, and execute multiple models for face detection in parallel through the mobile device, and obtain face detection results of each video frame according to the calculation results of each model for face detection, for example, simultaneously obtain the face region of the target object in each video frame, and the present disclosure may simultaneously perform expansion processing on the face region in each video frame, for example, the length and width of the face region are each expanded by n1 pixels, and the face expansion region in each video is obtained, so that the present disclosure can simultaneously cut out the face expansion region from each video frame, thereby obtaining an image block sequence formed by multiple face expansion image blocks.
[0067] Since the video frames collected by the camera device in real time can be output in the form of video frame packets, the present disclosure adopts parallel detection, which is beneficial for obtaining image block sequences in a timely manner while reducing delays, thereby facilitating the real-time performance of emotion detection.
[0068] In an optional example, the present disclosure uses a facial feature vector of an image block to implement an example of emotion detection, such as Figure 3 shown.
[0069] Figure 3 In S300, facial feature extraction processing is performed on each image block in the image block sequence to obtain a facial feature vector of each image block.
[0070] Optionally, the present disclosure can provide each image block in the image block sequence as input (such as simultaneously or successively) to a neural network processing unit for extracting features, and obtain the facial feature vector of each image block according to the output of the neural network processing unit for extracting features. The neural network for extracting features in the present disclosure can be a convolutional neural network including at least a convolutional layer, a pooling layer, and a fully connected layer.
[0071] S301. Obtain multiple confidence levels corresponding to each image block according to the facial feature vector of each image block.
[0072] Optionally, the present disclosure may use the facial feature vectors of each image block as inputs respectively, and successively provide them to the neural network processing unit for emotion classification, and obtain multiple confidences corresponding to each image block according to the output of the neural network processing unit for emotion classification. For example, the preset emotion categories include the 7 types listed in the above step S202. The present disclosure may use the neural network processing unit for emotion classification to obtain 7 confidences corresponding to each image block, and the 7 confidences corresponding to one image block are a group of confidences. It should be noted that the neural network processing unit for extracting features and the neural network processing unit for emotion classification can be implemented by the same neural network processing unit, such as by the same BPU or the same GPU. Similarly, the neural network processing unit for performing different operations involved in the embodiments of the present disclosure can be implemented by the same neural network processing unit, which will not be described one by one below.
[0073] S302: Determine the emotion of the target object in the multiple video frames according to the multiple confidence levels corresponding to the image blocks.
[0074] Optionally, the present disclosure can calculate and process multiple confidences corresponding to each image block, so as to obtain the confidence corresponding to the image block sequence. The confidence corresponding to the image block sequence is the confidence corresponding to the multiple video frames. The present disclosure can determine the emotions of the target objects in the multiple video frames according to the confidence corresponding to the image block sequence, and the emotions of the target objects in the multiple video frames are the emotions of the target objects in the image block sequence.
[0075] Optionally, the calculation process of the above-mentioned multiple confidences can be a confidence mean process. Specifically, for any preset emotion type, the mean of the confidences of all the preset emotion types in the multiple confidences corresponding to each image block is calculated, so as to obtain the confidence mean of the preset emotion type, and the confidence mean represents the probability that the emotion of the target object in multiple video frames belongs to the preset emotion type. After calculating the confidence mean for each preset emotion type, the present disclosure can select the confidence mean with the highest value from all confidence means, and judge whether the relationship between the confidence mean with the highest value and a preset threshold (such as 0.75 or 0.7, etc.) meets a predetermined condition (such as judging whether the confidence mean with the highest value reaches a preset threshold, etc.), if the predetermined condition is met, it is determined that the emotion of the target object in the multiple video frames is the preset emotion type corresponding to the confidence mean with the highest value; if the predetermined condition is not met, the emotion of the target object in the multiple video frames is not successfully identified this time.
[0076] Optionally, the calculation process of the above-mentioned multiple confidences can be a confidence weighted process. Specifically, for any preset emotion type, according to the weight corresponding to each video frame, the weighted average of all the confidences of the preset emotion type in the multiple confidences corresponding to each image block is calculated, so as to obtain the confidence weighted average of the preset emotion type, and the confidence weighted average represents the probability that the emotion of the target object in the multiple video frames belongs to the preset emotion type. After calculating the confidence weighted average for each preset emotion type, the present disclosure can select the confidence weighted average with the highest value from all the confidence weighted averages, and judge whether the relationship between the confidence weighted average with the highest value and the preset threshold satisfies a predetermined condition (such as judging whether the confidence weighted average with the highest value reaches the preset threshold, etc.), if the predetermined condition is met, it is determined that the emotion of the target object in the multiple video frames is the preset emotion type corresponding to the confidence weighted average with the highest value; if the predetermined condition is not met, the emotion of the target object in the multiple video frames is not successfully identified this time.
[0077] Optionally, the weights corresponding to the respective video frames can be set according to the acquisition time of the respective video frames. For example, the weights corresponding to the video frames acquired earlier are not less than the weights corresponding to the video frames acquired later. Since human emotions are often more intense at the beginning, and the intense emotional expressions will gradually weaken in the subsequent stages, the present disclosure sets the weights corresponding to the respective video frames according to the acquisition time of the respective video frames. In fact, the weights corresponding to the respective video frames are set based on the decay of the expression over time, which is conducive to improving the accuracy of the confidence corresponding to the multiple video frames finally determined by the present disclosure.
[0078] Optionally, when setting the weights corresponding to each video frame, factors such as the image clarity of the video frame and the degree of facial deviation of the target object in the video frame may also be considered, thereby helping to avoid the impact of video frames with poor clarity or faces with large angle deflections on the accuracy of the confidence scores corresponding to the multiple video frames finally determined.
[0079] The present disclosure determines the emotions of the target object in multiple video frames by utilizing multiple confidence levels corresponding to multiple image blocks, thereby achieving smooth processing of the emotions of the target object in multiple video frames, which not only helps to avoid the inaccurate phenomenon of determining the emotions of the target object using a single video frame, but also avoids the phenomenon of emotion jumps, thereby helping to improve the accuracy of the emotions of the target object.
[0080] In an optional example, the present disclosure can not only use the facial feature vectors corresponding to the image block sequence to determine the confidence that the emotions of the target objects in multiple video frames belong to multiple preset emotion categories (such as the above Figure 3The facial feature vectors and auxiliary feature vectors corresponding to the image block sequence can also be used together to determine the confidence that the emotions of the target objects in multiple video frames belong to multiple preset emotion categories. A specific example is Figure 4 shown.
[0081] Figure 4 In S400, according to the image block sequence, an auxiliary feature vector of the target object corresponding to the image block sequence is obtained.
[0082] Optionally, the auxiliary feature vector in the present disclosure may refer to a feature vector that, in combination with the facial feature vector, can more accurately reflect the emotions of the target object. That is, although the auxiliary feature vector alone often cannot accurately determine the emotions of the target object, the use of the auxiliary feature vector to assist the facial feature vector can often more accurately determine the emotions of the target object. In an example, the auxiliary feature vector may include at least one of: a key point feature vector, a head posture feature vector, and a demographic attribute feature vector.
[0083] Optionally, the key point feature vector in the present disclosure may refer to a feature vector extracted from key point information, wherein the key point information may refer to key point information extracted from an image block. The key point feature vector in the present disclosure may be: a facial key point feature vector, and the key point feature vector in the present disclosure may also be at least one organ key point feature vector. The key point feature vector in the present disclosure may also be: a facial key point feature vector and at least one organ key point feature vector.
[0084] Optionally, the present disclosure may obtain facial key points of the target object in each image block according to the image block sequence, thereby obtaining multiple groups of facial key points. Thereafter, the present disclosure may obtain key point feature vectors corresponding to each group of facial key points.
[0085] In one example, the present disclosure may utilize a neural network processing unit for key point recognition to obtain the facial key points of a target object in each image block in an image block sequence, and the facial key points of the target object obtained from an image block may be considered as a group of facial key points. Thereafter, the present disclosure may utilize a neural network processing unit for extracting key point features to obtain key point feature vectors corresponding to each group of facial key points.
[0086] In a more specific example, the present disclosure can use each image block as input information, and provide it to a neural network processing unit for key point recognition in sequence, and perform facial key point recognition processing via the neural network processing unit. The present disclosure can obtain the facial key points of the target object in each image block in sequence according to the output information of the neural network processing unit. The present disclosure can also use each image block as input information, and provide it to multiple neural network processing units for key point recognition at the same time, and perform facial key point recognition processing for an image via each neural network processing unit. The present disclosure can simultaneously obtain the facial key points of the target object in each image block according to the output information of each neural network processing unit. The facial key points here can include: the number of the facial key points and the coordinate information of the facial key points in the image block, etc. The present disclosure can perform standardization processing (such as normalization processing) on the facial key points, so that the values of the coordinate information of the facial key points in the image block belong to a predetermined range, such as between -1 and 1. The standardization process can also be considered as a coordinate system conversion process, that is, the initial coordinate system is a two-dimensional coordinate system of the image block, and the target coordinate system is a two-dimensional coordinate system with the facial center point of the target object as the origin and -1 and 1 as the maximum coordinate values. Afterwards, the present disclosure can use each group of standardized facial key points as input, and successively provide them to a neural network processing unit for extracting facial key point features, and successively obtain the key point feature vectors corresponding to each group of facial key points according to the output of the neural network processing unit. Of course, the present disclosure can also use each group of standardized facial key points as input, and simultaneously provide them to multiple neural network processing units for extracting facial key point features, and each neural network processing unit performs feature vector extraction processing for a group of standardized facial key points respectively. The present disclosure can simultaneously obtain the key point feature vectors corresponding to each group of facial key points according to the output of each neural network processing unit. The neural network used for key point recognition in the present disclosure can be a convolutional neural network that at least includes a convolutional layer, a pooling layer, and a fully connected layer. The neural network used to extract facial key point features in the present disclosure may be a convolutional neural network including at least a convolutional layer, a pooling layer, and a fully connected layer.
[0087] In another example, the present disclosure may utilize a neural network processing unit for key point recognition to obtain facial key points of a target object in each image block in an image block sequence. The facial key points of the target object obtained from an image block may be considered as a group of facial key points. Thereafter, the present disclosure may obtain key points of at least one organ located on the face from each group of facial key points, thereby obtaining multiple groups of organ key points. Thereafter, the present disclosure may utilize a neural network processing unit for extracting organ key point features to obtain organ key point feature vectors corresponding to each group of organ key points.
[0088] In a more specific example, the present disclosure can use each image block as input information, and provide it to a neural network processing unit for key point recognition in sequence, and perform facial key point recognition processing via the neural network processing unit. The present disclosure can obtain the facial key points of the target object in each image block in sequence according to the output information of the neural network processing unit. The present disclosure can also use each image block as input information, and provide it to multiple neural network processing units for key point recognition at the same time, and perform facial key point recognition processing for an image via each neural network processing unit. The present disclosure can simultaneously obtain the facial key points of the target object in each image block according to the output information of each neural network processing unit. The facial key points here can include: the number of the facial key points and the coordinate information of the facial key points in the image block, etc. The present disclosure can perform standardization processing (such as normalization processing) on the facial key points, so that the values of the coordinate information of the facial key points in the image block belong to a predetermined range, such as between -1 and 1. This standardization process can also be considered as a coordinate system conversion process, that is, the initial coordinate system is the two-dimensional coordinate system of the image block, and the target coordinate system is a two-dimensional coordinate system with the facial center point of the target object as the origin and -1 and 1 as the maximum coordinate values. Afterwards, the present disclosure can identify the organ key points of organs such as eyes, nose, mouth and ears from each group of facial key points according to the labels of the facial key points. The present disclosure can select n2 (n2 is an integer greater than 0) organ key points from each group of facial key points, and the organ key points of any organ selected from a group of facial key points are taken as a group of organ key points, and a group of organ key points usually includes multiple organ key points. In one example, the present disclosure selects eye key points, mouth key points and nose key points from a group of facial key points, thereby obtaining three groups of organ key points. Then, the present disclosure can take each group of organ key points as input, and provide them to a neural network processing unit for extracting organ key point features in sequence, perform feature vector extraction processing through the neural network processing unit, and obtain the organ key point feature vectors corresponding to each group of organ key points according to the output information of the neural network processing unit. The present disclosure can also take each group of organ key points as input, and provide them to multiple neural network processing units for extracting organ key point features at the same time, perform feature vector extraction processing through each neural network processing unit, and obtain the organ key point feature vectors corresponding to each group of organ key points according to the output information of each neural network processing unit. The neural network used for key point recognition in the present disclosure can be a convolutional neural network that at least includes a convolutional layer, a pooling layer, and a fully connected layer. The neural network used for extracting organ key point features in the present disclosure can be a convolutional neural network that at least includes a convolutional layer, a pooling layer, and a fully connected layer.
[0089] As another more specific example, the present disclosure may use each image block as input information, and provide it to a neural network processing unit for key point recognition in sequence, and perform facial key point recognition processing via the neural network processing unit. The present disclosure may obtain the facial key points of the target object in each image block in sequence based on the output information of the neural network processing unit. The present disclosure may use each image block as input information, and provide it to multiple neural network processing units for key point recognition at the same time, and perform facial key point recognition processing for an image via the neural network processing units. The present disclosure may obtain the facial key points of the target object in each image block at the same time based on the output information of each neural network processing unit. The facial key points here may include: the number of the facial key points and the coordinate information of the facial key points in the image block, etc. The present disclosure can identify organ key points of organs such as eyes, mouth and ears from each group of facial key points according to the labels of facial key points. The present disclosure can select n2 (n2 is an integer greater than 0) organ key points from each group of facial key points, and the organ key points of any organ selected from a group of facial key points are taken as a group of organ key points, and a group of organ key points usually includes multiple organ key points. In an example, the present disclosure selects eye key points, mouth key points and nose key points from a group of facial key points, thereby obtaining three groups of organ key points. The present disclosure can perform standardization processing on each group of organ key points. The standardization processing can also be considered as a coordinate system conversion processing, that is, the initial coordinate system is a two-dimensional coordinate system of the image block, and the target coordinate system is a two-dimensional coordinate system with the organ center point of the target object as the origin and -1 and 1 as the maximum coordinate values. Afterwards, the present disclosure can use each group of organ key points after standardization as input, and provide them to a neural network processing unit for extracting organ key point features in sequence, perform feature vector extraction processing through the neural network processing unit, and obtain the organ key point feature vectors corresponding to each group of organ key points according to the output information of the neural network processing unit. The present disclosure can also use each group of organ key points after standardization as input, and provide them to multiple neural network processing units for extracting organ key point features at the same time, perform feature vector extraction processing through the neural network processing units, and obtain the organ key point feature vectors corresponding to each group of organ key points after standardization at the same time according to the output information of the neural network processing units. The neural network used for key point recognition in the present disclosure can be a convolutional neural network that at least includes a convolutional layer, a pooling layer, and a fully connected layer. The neural network used for extracting organ key point features in the present disclosure can be a convolutional neural network that at least includes a convolutional layer, a pooling layer, and a fully connected layer.
[0090] Optionally, the head posture feature vector in the present disclosure may refer to a feature vector obtained by encoding the head posture information. The length of the head posture feature vector (i.e., the number of vector elements contained in the head posture feature vector) may be the same as the length of the facial feature vector, or may be different from the length of the facial feature vector. The head posture information may include: Yaw (yaw angle rotating around the Y axis), Roll (roll angle rotating around the Z axis), and Pitch (pitch angle rotating around the X axis), etc.
[0091] Optionally, for any image block in the image block sequence, the present disclosure may utilize a neural network processing unit for extracting head posture information to obtain the head posture information of the target object in the image block. The head posture information of the target object obtained from an image block in the present disclosure may be considered as a group of head posture information. The present disclosure may obtain a group of head posture information corresponding to each image block, thereby obtaining multiple groups of head posture information. Afterwards, the present disclosure may utilize a neural network processing unit (such as an encoder, etc.) for extracting head posture features to obtain head posture feature vectors corresponding to each group of head posture information. For example, the present disclosure may directly use each group of head posture information as input, and successively provide it to a neural network processing unit for extracting head posture features, and successively obtain head posture feature vectors corresponding to each group of head posture information according to the output of the neural network processing unit. For another example, the present disclosure may directly use each group of head posture information as input, and simultaneously provide it to multiple neural network processing units for extracting head posture features, and simultaneously obtain head posture feature vectors corresponding to each group of head posture information according to the output of each neural network processing unit. For another example, the present disclosure may first perform normalization processing on each group of head posture information, so that the value of each element in each group of head posture information is between -1 and 1, and then, the present disclosure uses each group of head posture information after normalization as input, and successively provides them to a neural network processing unit for extracting head posture features, and obtains the head posture feature vectors corresponding to each group of head posture information according to the output of the neural network processing unit. For another example, the present disclosure may first perform normalization processing on each group of head posture information, so that the value of each element in each group of head posture information is between -1 and 1, and then, the present disclosure uses each group of head posture information after normalization as input, and simultaneously provides them to multiple neural network processing units for extracting head posture features, and simultaneously obtains the head posture feature vectors corresponding to each group of head posture information according to the output of each neural network processing unit.
[0092] Optionally, the demographic attribute feature vector in the present disclosure may refer to a feature vector obtained by encoding demographic attribute information. The length of the demographic attribute feature vector (i.e., the number of vector elements contained in the demographic attribute feature vector) may be the same as the length of the facial feature vector, or may be different from the length of the facial feature vector. The demographic attribute feature vector in the present disclosure may include: at least one of: a gender feature vector and an age feature vector, etc. That is, the demographic attribute information of the present disclosure may include: at least one of: gender and age. For any image block in the image block sequence, the present disclosure may use a neural network processing unit for extracting demographic attributes to obtain the demographic attribute information of the target object in the image block. The demographic attribute information of the target object obtained from an image block in the present disclosure may be considered as a group of demographic attribute information. The present disclosure may obtain a group of demographic attribute information corresponding to each image block, thereby obtaining multiple groups of demographic attribute information. Afterwards, the present disclosure may use a neural network processing unit (such as an encoder, etc.) for extracting demographic attribute features to obtain the demographic attribute feature vectors corresponding to each group of demographic attribute information. For example, the present disclosure can directly use each group of demographic attribute information as input, and successively provide it to a neural network processing unit for extracting demographic attribute features, and successively obtain the demographic attribute feature vectors corresponding to each group of demographic attribute information according to the output of the neural network processing unit. For another example, the present disclosure can directly use each group of demographic attribute information as input, and simultaneously provide it to multiple neural network processing units for extracting demographic attribute features, and simultaneously obtain the demographic attribute feature vectors corresponding to each group of demographic attribute information according to the output of each neural network processing unit. For another example, the present disclosure can first normalize each group of demographic attribute information, so that the values of each element in each group of demographic attribute information are between -1 and 1, and then, the present disclosure uses each group of demographic attribute information after normalization as input, and successively provides it to a neural network processing unit for extracting demographic attribute features, and obtains the demographic attribute feature vectors corresponding to each group of demographic attribute information according to the output of the neural network processing unit. For another example, the present disclosure may first normalize each group of demographic attribute information so that the value of each element in each group of demographic attribute information is between -1 and 1. Then, the present disclosure uses each group of normalized demographic attribute information as input and provides them to multiple neural network processing units for extracting demographic attribute features. Based on the output of each neural network processing unit, the demographic attribute feature vector corresponding to each group of demographic attribute information is obtained.
[0093] S401. Determine, based on the facial feature vector and the auxiliary feature vector, the confidence that the emotions of the target object in the plurality of video frames belong to a plurality of preset emotion categories, and obtain a plurality of confidences.
[0094] Optionally, the present disclosure can provide the facial feature vector and the auxiliary feature vector of each image block as input to a neural network processing unit for emotion classification, and the present disclosure can obtain multiple confidences corresponding to each image block according to the output of the neural network processing unit for emotion classification. For example, the preset emotion categories include 7 kinds, and the present disclosure can use the neural network processing unit for emotion classification to perform neural network operations on each image block respectively, and obtain 7 confidences corresponding to each image block.
[0095] Optionally, the present disclosure may calculate and process multiple confidences corresponding to each image block, thereby obtaining multiple confidences corresponding to the image block sequence, for example, finally obtaining 7 confidences. The present disclosure may obtain multiple confidences corresponding to the image block sequence by processing methods such as mean calculation or weight calculation, and the details may refer to the description of S302 in the above embodiment, which will not be repeated here.
[0096] Since the auxiliary feature vector of the present invention is associated with the emotion of the target object, the present invention determines the confidence that the emotion of the target object belongs to multiple preset emotion categories by combining the auxiliary feature vector and the facial feature vector, which is helpful to improve the accuracy of the confidence finally obtained, thereby helping to improve the accuracy of emotion detection.
[0097] Since human emotions can often be expressed through the shapes of organs such as eyes, mouth and nose, the positional relationship between different facial key points of the same organ of the target object on the face usually has a certain relationship with the emotion, so the key point feature vector (such as facial key point feature vector and / or at least one organ key point feature vector) extracted from the key point information of the present disclosure can auxiliaryly reflect the target object's emotions. It can be seen that in the process of using facial feature vectors to obtain the confidence that the target object's emotions belong to multiple preset emotion categories, the present disclosure adds the key point feature vector extracted from the key point information, which helps to more accurately determine the confidence that the target object's emotions belong to multiple preset emotion categories, thereby helping to improve the accuracy of emotion detection.
[0098] Since human emotions often have a certain relationship with head posture, the head posture feature vector obtained by the present disclosure through feature extraction processing of head posture information can assist in reflecting the emotions of the target object. It can be seen that in the process of using facial feature vectors to obtain the confidence that the target object's emotions belong to multiple preset emotion categories, by adding head posture feature vectors, the present disclosure helps to more accurately determine the confidence that the target object's emotions belong to multiple preset emotion categories, thereby helping to improve the accuracy of emotion detection.
[0099] For the same emotion, due to the different demographic attributes of a person, such as gender and age, the expression of the emotion may be different. Therefore, the demographic attribute feature vector obtained by the present disclosure through feature extraction processing of the demographic attribute information can assist in reflecting the emotion of the target object. It can be seen that in the process of using the facial feature vector to obtain the confidence that the target object's emotions belong to multiple preset emotion categories, the present disclosure adds the demographic attribute feature vector, which helps to more accurately determine the confidence that the target object's emotions belong to multiple preset emotion categories, thereby helping to improve the accuracy of emotion detection.
[0100] In an optional example, the present disclosure determines the confidence that the emotions of the target objects in multiple video frames belong to multiple preset emotion categories according to the facial feature vector and the auxiliary feature vector, such as Figure 5 shown.
[0101] Figure 5 In S500, the facial feature vector and the auxiliary feature vector are fused to obtain fused feature vectors corresponding to each of the plurality of video frames.
[0102] Optionally, the fusion processing of the facial feature vector and the auxiliary feature vector in the present disclosure may refer to the processing of making the facial feature vector and the auxiliary feature vector form one feature vector. For example, the fusion processing may be feature vector concatenation processing, or feature vector addition processing, etc.
[0103] Optionally, when the number of vector elements contained in the facial feature vector is the same as the number of vector elements contained in the auxiliary feature vector, the present disclosure may concatenate or add the facial feature vector and the auxiliary feature vector, and the result of the concatenation or addition is the fused feature vector.
[0104] Optionally, when the number of vector elements included in the facial feature vector is different from the number of vector elements included in the auxiliary feature vector, the present disclosure may concatenate the facial feature vector and the auxiliary feature vector, and the result of the concatenation is the fused feature vector.
[0105] In a first specific example, the present disclosure may fuse the facial feature vector and the facial key point feature vector of each image block in the image block sequence to obtain a fused feature vector of each image block, that is, a fused feature vector corresponding to each video frame.
[0106] In the second specific example, the present disclosure can fuse the facial feature vector of each image block in the image block sequence and at least one organ key point feature vector (such as at least one of the eye key point feature vector, the nose key point feature vector and the mouth key point feature vector) to obtain the fused feature vector of each image block, that is, the fused feature vector corresponding to each video frame.
[0107] In a third specific example, the present disclosure may fuse the facial feature vector and the head posture feature vector of each image block in the image block sequence to obtain a fused feature vector of each image block, that is, a fused feature vector corresponding to each video frame.
[0108] In a fourth specific example, the present disclosure may fuse the facial feature vector and the demographic attribute feature vector of each image block in the image block sequence to obtain a fused feature vector of each image block, that is, a fused feature vector corresponding to each video frame.
[0109] In the fifth specific example, the present disclosure can fuse the facial feature vector of each image block in the image block sequence with any two of at least one organ key point feature vector, a head posture feature vector and a demographic attribute feature vector to obtain the fused feature vector of each image block, that is, the fused feature vector corresponding to each video frame.
[0110] In the sixth specific example, the present disclosure can fuse the facial feature vector, at least one organ key point feature vector, head posture feature vector, and demographic attribute feature vector of each image block in the image block sequence to obtain the fused feature vector of each image block, that is, the fused feature vector corresponding to each video frame.
[0111] S501. For any video frame among the multiple video frames, perform emotion category classification processing on the fused feature vector corresponding to the video frame to obtain a set of confidences that the emotion of the target object in the video frame belongs to multiple preset emotion categories.
[0112] Optionally, the present disclosure can use the fused feature vectors corresponding to each video frame as input, provide them to the neural network processing unit for emotion classification, and obtain multiple confidences corresponding to each image block or each video frame according to the output of the neural network processing unit for emotion classification, and the multiple confidences corresponding to an image block or a video frame are taken as a group of confidences. For example, there are 7 preset emotion categories, and the present disclosure can use the neural network processing unit for emotion classification to obtain 7 confidences corresponding to each image block, and the 7 confidences corresponding to an image block are taken as a group of confidences.
[0113] S502: Determine, based on a set of confidences corresponding to each of the plurality of video frames, the confidences that the emotions of the target objects in the plurality of video frames belong to a plurality of preset emotion categories.
[0114] Optionally, the present disclosure may calculate and process a set of confidences corresponding to each of the multiple video frames, thereby obtaining confidences that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories.
[0115] Optionally, the above-mentioned calculation and processing of a set of confidences corresponding to each of the multiple video frames can be based on the average confidence processing of the same preset emotion category. Specifically, for any preset emotion type, the average of all confidences of the preset emotion type in each group of confidences is calculated to obtain the average confidence of the preset emotion type, and the average confidence represents the probability that the emotion of the target object in the multiple video frames belongs to the preset emotion type. After calculating the average confidence for each preset emotion type, the present disclosure finally obtains a set of confidences, and the set of confidences includes the average confidences corresponding to each preset emotion type.
[0116] Optionally, the above-mentioned calculation process of a set of confidences corresponding to each of the multiple video frames may be a confidence weighted process. Specifically, for any preset emotion type, the weighted average of the confidences of all the preset emotion types in each confidence group is calculated, thereby obtaining a weighted average of the confidences of the preset emotion type, and the weighted average of the confidences represents the probability that the emotion of the target object in the multiple video frames belongs to the preset emotion type. After calculating the weighted average of the confidences for each preset emotion type, the present disclosure finally obtains a set of confidences, and the set of confidences includes the weighted average of the confidences corresponding to each preset emotion type.
[0117] Optionally, the weights corresponding to the respective video frames can be set according to the acquisition time of the respective video frames. For example, the weights corresponding to the video frames with earlier acquisition time are not less than the weights corresponding to the video frames with later acquisition time. Since human emotions are often expressed more strongly in the initial stage, and the strong expression will gradually weaken in the subsequent stages, the present disclosure sets the weights corresponding to the respective video frames based on the decay of expression over time, which is conducive to improving the accuracy of the confidence corresponding to the multiple video frames finally determined. In addition, when setting the weights corresponding to the respective video frames, factors such as the clarity of the video frames and the degree of head deflection of the target object in the video frames can also be considered, so as to help avoid the influence of video frames with poor clarity or faces with large angle deflection on the accuracy of the confidence corresponding to the multiple video frames finally determined.
[0118] Since the auxiliary feature vector of the present invention is associated with the emotion of the target object, the present invention fuses the auxiliary feature vector and the facial feature vector so that the fused feature vector can represent the emotion of the target object from multiple angles. The emotions of the target object determined by the present invention belong to the confidence levels of multiple preset emotion categories, which can more accurately reflect the emotional tendency of the target object, thereby helping to improve the accuracy of emotion detection.
[0119] In an optional example, the present disclosure provides another example of determining the confidence that the emotions of the target objects in multiple video frames belong to multiple preset emotion categories respectively based on the facial feature vector and the auxiliary feature vector, such as Figure 6 shown.
[0120] Figure 6 In step S600, the facial feature vector and the auxiliary feature information are fused to obtain fused feature vectors corresponding to each of the plurality of video frames.
[0121] The specific content of step S600 can refer to the description of S500 in the above embodiment, and will not be repeated here.
[0122] S601 , performing time-series-based emotion category classification processing on the fused feature vectors corresponding to each of the multiple video frames to obtain confidences that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories.
[0123] Optionally, the present disclosure may include: performing convolution processing on the fused feature vectors corresponding to each of the multiple video frames based on time series, etc. The present disclosure may utilize an RNN (Recurrent Neural Networks) processing unit to perform time series-based emotion category classification processing on the fused feature vectors, and process the input information via the RNN processing unit, so that the present disclosure may obtain the confidence that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories based on the output of the RNN processing unit. The RNN in the present disclosure may be an LSTM (Long-Short Term Memory) neural network, etc.
[0124] The present disclosure provides another implementation method for obtaining confidence by performing time-series-based emotion category classification processing on the fused feature vectors corresponding to each of multiple video frames, which is beneficial to improving the flexibility of emotion detection.
[0125] The present disclosure provides an example of obtaining the confidence that the emotions of the target object in multiple video frames belong to multiple preset emotion categories, such as Figure 7 shown.
[0126] Figure 7 In the embodiment, assuming that the number of video frames in a time window is z, the present disclosure can obtain image blocks containing the face area of the target object from the z video frames in a time window, thereby obtaining z image blocks, namely, image block 1, image block 2, ... and image block z. Assume that the present disclosure has s preset emotion types. The present disclosure can perform feature vector extraction processing on the z image blocks respectively, for example, the z image blocks are simultaneously provided to z neural network processing units for extracting features, so that the facial feature vectors corresponding to each of the z image blocks can be obtained, and then. The present disclosure can perform time-series-based emotion category classification processing on the facial feature vectors corresponding to each of the z image blocks. For example, the facial feature vectors corresponding to each of the z image blocks are respectively used as inputs and provided to the RNN processing unit in sequence. When the RNN processing unit performs emotion category classification processing on the facial feature vector corresponding to each image block, the result of the emotion category classification processing of the facial feature vector corresponding to the previous image block in the time sequence is considered. Therefore, when the RNN processing unit performs emotion category classification processing on the facial feature vector corresponding to the last image block, the output s confidences (i.e., confidence 1, confidence 2, confidence 3, ... and confidence s, where s is an integer greater than 1) are the confidences that the emotions of the target objects in the multiple video frames finally obtained by the present disclosure belong to multiple preset emotion categories.
[0127] It should be noted that Figure 7The illustrated embodiment can also fuse the facial feature vector and the auxiliary feature vector, and perform emotion category classification on the fused feature vector, thereby facilitating improving the flexibility of emotion category classification.
[0128] Exemplary Devices
[0129] Figure 8 FIG. 1 is a schematic diagram of the structure of an embodiment of the emotion detection device disclosed in the present invention. The device of this embodiment can be used to implement the corresponding method embodiment of the present invention. Figure 8 The device shown mainly includes: an image block acquisition module 800 , a feature vector acquisition module 801 , a confidence acquisition module 802 , and an emotion determination module 803 .
[0130] The image block acquisition module 800 is used to acquire an image block sequence containing a target object from a plurality of video frames acquired by a camera device disposed in the mobile device.
[0131] The feature vector acquisition module 801 is used to determine the facial feature vector corresponding to the image block sequence obtained by the image block acquisition module 800 .
[0132] The confidence acquisition module 802 is used to determine the confidence that the emotions of the target object in multiple video frames belong to multiple preset emotion categories according to the facial feature vectors obtained by the feature vector acquisition module 801, and obtain multiple confidences.
[0133] The emotion determination module 803 is used to determine the emotion of the target object in the multiple video frames according to the multiple confidences obtained by the confidence acquisition module 802.
[0134] Optionally, the image block acquisition module 800 can be further used to perform facial area detection on the multiple video frames in sequence according to the acquisition time sequence of each of the multiple video frames acquired by a camera device arranged in the mobile device, so as to obtain an image block sequence containing the facial area of the target object in the multiple video frames.
[0135] Optionally, the confidence acquisition module 802 may include: a first submodule 8021 and a second submodule 8022. The first submodule 8021 is used to acquire, based on the image block sequence, an auxiliary feature vector of a target object corresponding to the image block sequence. The second submodule 8022 is used to determine, based on the facial feature vector and the auxiliary feature vector, the confidence that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories, and obtain multiple confidences.
[0136] Optionally, the first submodule 8021 may include at least one of a first unit 80211, a second unit 80212, and a third unit 80213. The first unit 80211 is used to obtain facial key points of the target object in the image block sequence according to the image block sequence, obtain multiple groups of facial key points, and obtain key point feature vectors corresponding to each of the multiple groups of facial key points. The second unit 80212 is used to obtain head posture information of the target object in the image block sequence according to the image block sequence, obtain multiple groups of head posture information, and obtain head posture feature vectors corresponding to each of the multiple groups of head posture information. The third unit 80213 is used to obtain demographic attribute information of the target object in the image block sequence according to the image block sequence, obtain multiple groups of demographic attribute information, and obtain demographic attribute feature vectors corresponding to each of the multiple groups of demographic attribute information. Each auxiliary feature vector includes at least one of a key point feature vector, a head posture feature vector, and a demographic attribute feature vector.
[0137] Optionally, the process of the first unit 80211 obtaining key point feature vectors corresponding to each of the multiple groups of facial key points may be: performing facial key point feature extraction processing on each of the multiple groups of facial key points to obtain facial key point feature vectors corresponding to each of the multiple groups of facial key points. The process of the first unit 80211 obtaining key point feature vectors corresponding to each of the multiple groups of facial key points may also be: obtaining key points of at least one organ located on the face from the multiple groups of facial key points, obtaining at least one group of organ key points corresponding to each of the multiple video frames, performing organ key point feature extraction processing on the at least one group of organ key points corresponding to each of the multiple video frames, and obtaining at least one organ key point feature vector corresponding to each of the multiple video frames.
[0138] Optionally, the second submodule 8022 may include: a fourth unit 80221, a fifth unit 80222, and a sixth unit 80223. The fourth unit 80221 is used to fuse the facial feature vector and the auxiliary feature vector to obtain the fused feature vectors corresponding to each of the multiple video frames. The fifth unit 80222 is used to classify the fused feature vector corresponding to any one of the multiple video frames into an emotion category to obtain a set of confidences that the emotions of the target object in the video frame belong to multiple preset emotion categories. The sixth unit 80223 is used to determine the confidences that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories based on a set of confidences corresponding to each of the multiple video frames.
[0139] Optionally, the sixth unit 80223 can be further used to calculate the mean of the confidences of the same preset emotion category in a set of confidences corresponding to each of the multiple video frames, so as to obtain the mean of the confidences corresponding to each of the multiple preset emotion types. The sixth unit 80223 can also be further used to calculate the weighted average of the confidences of the same preset emotion category in a set of confidences corresponding to each of the multiple video frames according to the weights corresponding to each of the multiple video frames, so as to obtain the weighted values of the confidences corresponding to each of the multiple preset emotion types. Among them, the weight corresponding to the video frame with a later acquisition time is not higher than the weight corresponding to the video frame with an online acquisition time.
[0140] Optionally, the confidence acquisition module 802 may include: a third submodule 8023 and a fourth submodule 8024. The third submodule 8023 is used to perform a fusion process on the facial feature vector and the auxiliary feature information to obtain the fused feature vectors corresponding to each of the multiple video frames. The fourth submodule 8024 is used to perform a time-series-based emotion category classification process on the fused feature vectors corresponding to each of the multiple video frames to obtain the confidence that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories.
[0141] Exemplary Electronic Devices
[0142] Reference below Fig. 9 An electronic device according to an embodiment of the present disclosure is described. Fig. 9 1 shows a block diagram of an electronic device according to an embodiment of the present disclosure. Fig. 9 As shown, the electronic device 91 includes one or more processors 911 and a memory 912 .
[0143] The processor 911 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 91 to perform desired functions.
[0144] The memory 912 may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory, for example, may include: random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory, for example, may include: read-only memory (ROM), hard disk, and flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 911 may run the program instructions to implement the emotion detection method of the various embodiments of the present disclosure described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage medium.
[0145] In one example, the electronic device 91 may also include: an input device 913 and an output device 914, etc., which are interconnected through a bus system and / or other forms of connection mechanisms (not shown). In addition, the input device 913 may also include, for example, a keyboard, a mouse, etc. The output device 914 may output various information to the outside. The output device 914 may include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, etc.
[0146] Of course, to simplify, Fig. 9 Only some of the components related to the present disclosure in the electronic device 91 are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device 91 may also include any other appropriate components.
[0147] Exemplary computer program products and computer-readable storage media
[0148] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the emotion detection method according to various embodiments of the present disclosure described in the above-mentioned "Exemplary Method" section of this specification.
[0149] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0150] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the emotion detection method according to various embodiments of the present disclosure described in the above "Exemplary Method" section of this specification.
[0151] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive enumeration) of readable storage media can include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0152] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. must be possessed by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, rather than limitation, and the above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0153] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0154] The block diagrams of the devices, apparatuses, equipment, and systems involved in the present disclosure are intended only as illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems may be connected, arranged, and configured in any manner. Words such as "include," "comprise," "have," and the like are open words, meaning "including but not limited to," and may be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and may be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and may be used interchangeably therewith.
[0155] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0156] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0157] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects, etc., will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0158] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for emotion detection, include: Acquire a sequence of image blocks including a face area of a target object from a plurality of video frames acquired by a camera device disposed in the mobile device; Determine a facial feature vector corresponding to the image block sequence; and obtain, based on the image block sequence, an auxiliary feature vector of a target object corresponding to the image block sequence, wherein each auxiliary feature vector includes: a key point feature vector, a head posture feature vector, and a demographic attribute feature vector, wherein the key point feature vector is a feature vector extracted from key point information of the target object, the head posture feature vector is a feature vector obtained by encoding the head posture information of the target object, and the demographic attribute feature vector is a feature vector obtained by encoding the demographic attribute information of the target object; Determining, based on the facial feature vector and the auxiliary feature vector, the confidence levels that the emotions of the target object in the multiple video frames belong to multiple preset emotion categories, respectively, to obtain multiple confidence levels; Determining emotions of target objects in the plurality of video frames based on the plurality of confidence levels; The step of determining, based on the facial feature vector and the auxiliary feature vector, the confidence that the emotions of the target objects in the plurality of video frames belong to a plurality of preset emotion categories, comprises: Performing fusion processing on the facial feature vector and the auxiliary feature vector to obtain fused feature vectors corresponding to each of the plurality of video frames; The fused feature vectors corresponding to the multiple video frames are subjected to time-series-based emotion category classification processing to obtain confidences that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories.
2. The method according to claim 1, in, The method of acquiring a sequence of image blocks including a face area of a target object from a plurality of video frames acquired by a camera device disposed in a mobile device comprises: According to the respective acquisition time sequence of multiple video frames acquired by a camera device arranged in the mobile device, face area detection is performed on the multiple video frames in sequence to obtain a sequence of image blocks containing the face area of the target object in the multiple video frames.
3. The method according to claim 1, in, The step of obtaining, according to the image block sequence, an auxiliary feature vector of a target object corresponding to the image block sequence comprises: According to the image block sequence, facial key points of the target object in the image block sequence are obtained to obtain multiple groups of facial key points, and key point feature vectors corresponding to each of the multiple groups of facial key points are obtained; According to the image block sequence, obtaining head posture information of the target object in the image block sequence, obtaining multiple groups of head posture information, and obtaining head posture feature vectors corresponding to each of the multiple groups of head posture information; According to the image block sequence, demographic attribute information of the target object in the image block sequence is obtained, a plurality of groups of demographic attribute information are obtained, and demographic attribute feature vectors corresponding to each of the plurality of groups of demographic attribute information are obtained.
4. The method according to claim 3, in, The step of obtaining key point feature vectors corresponding to each of the plurality of groups of facial key points includes: Performing facial key point feature extraction processing on the multiple groups of facial key points respectively to obtain facial key point feature vectors corresponding to the multiple groups of facial key points respectively; and / or The step of obtaining key point feature vectors corresponding to each of the plurality of groups of facial key points includes: Obtaining key points of at least one organ located on the face from among the multiple groups of facial key points, and obtaining at least one group of organ key points corresponding to each of the multiple video frames; Organ key point feature extraction processing is performed on at least one group of organ key points corresponding to each of the multiple video frames to obtain at least one organ key point feature vector corresponding to each of the multiple video frames.
5. The method according to any one of claims 1 to 4, in, The step of determining, based on the facial feature vector and the auxiliary feature vector, the confidence that the emotions of the target objects in the plurality of video frames belong to a plurality of preset emotion categories, comprises: Performing fusion processing on the facial feature vector and the auxiliary feature vector to obtain fused feature vectors corresponding to each of the plurality of video frames; For any video frame among the multiple video frames, performing emotion category classification processing on the fused feature vector corresponding to the video frame to obtain a set of confidences that the emotion of the target object in the video frame belongs to multiple preset emotion categories respectively; The confidences that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories are determined according to a set of confidences corresponding to each of the multiple video frames.
6. An emotion detection device, include: An image block acquisition module is used to acquire an image block sequence containing a target object from a plurality of video frames acquired by a camera device disposed in the mobile device; A feature vector acquisition module is used to determine the facial feature vector corresponding to the image block sequence obtained by the image block acquisition module; and according to the image block sequence, to acquire the auxiliary feature vector of the target object corresponding to the image block sequence, wherein each auxiliary feature vector includes: a key point feature vector, a head posture feature vector and a demographic attribute feature vector, wherein the key point feature vector is a feature vector extracted from the key point information of the target object, the head posture feature vector is a feature vector obtained by encoding the head posture information of the target object, and the demographic attribute feature vector is a feature vector obtained by encoding the demographic attribute information of the target object; A confidence acquisition module, configured to determine the confidences that the emotions of the target objects in the plurality of video frames belong to a plurality of preset emotion categories, respectively, based on the facial feature vectors and the auxiliary feature vectors acquired by the feature vector acquisition module, to acquire a plurality of confidences; An emotion determination module, configured to determine the emotion of the target object in the plurality of video frames according to the plurality of confidences obtained by the confidence acquisition module; Wherein, the confidence acquisition module is specifically used for: Performing fusion processing on the facial feature vector and the auxiliary feature vector to obtain fused feature vectors corresponding to each of the plurality of video frames; The fused feature vectors corresponding to the multiple video frames are subjected to time-series-based emotion category classification processing to obtain confidences that the emotions of the target objects in the multiple video frames belong to multiple preset emotion categories.
7. A computer-readable storage medium storing a computer program, wherein the computer program is used to execute the method according to any one of claims 1 to 5.
8. An electronic device, the electronic device include: processor; a memory for storing instructions executable by the processor; The processor is used to read the executable instructions from the memory and execute the instructions to implement the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Face emotion identifying method, apparatus and storage medium
CN107633203A
Emotion information generating method and device
CN108509941A
Face emotion recognition method and device, compute device and storage medium
CN109190487A
Expression recognition method, device, terminal device and storage medium
CN109522818A
Call-for-help method and device based on expression recognition, electronic equipment and storage medium
CN110121715A
