A method for realizing real-time mirroring behavior of robots based on lightweight neural networks

Through a method based on lightweight neural networks, the technical problems of real-time mirroring behavior of facial expressions and head movements of humanoid robots are solved, and high-precision and natural mirroring behaviors are achieved, which is suitable for multiple application fields.

CN115648203BActive Publication Date: 2024-09-24HOHAI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211122584.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-15
Publication Date
2024-09-24
Estimated Expiration
2042-09-15

AI Technical Summary

Technical Problem

It is difficult to achieve natural and effective human-computer interaction in humanoid robots with existing technology, especially in the real-time mirroring behavior of facial expressions and head movements, which is limited by the mechanical structure and facial feature point extraction accuracy.

Method used

Using a method based on lightweight neural networks, preprocessing sample face images is used to establish and train a lightweight deep neural network, extract facial feature points, and calculate the servo displacement through Euclidean distance and Euler angles to control the movement of the anthropomorphic robot. Facial expressions and head posture to achieve real-time mirroring behavior.

Benefits of technology

It achieves high-precision, real-time and natural mirroring behavior, is suitable for medical rehabilitation, education and teaching and other fields, and has great economic and academic reference value.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000
    Figure 00000000_0000
Patent Text Reader

Abstract

The present invention discloses a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network, which is specifically as follows: 1: preprocessing a sample face image; 2: establishing a lightweight deep neural network, and using the sample face image to train the lightweight deep neural network; 3: using the lightweight deep neural network to extract facial feature points in the current face image collected by the camera; 4: the face of the anthropomorphic robot is provided with a plurality of facial expression servos and head posture servos, and the displacement of the corresponding facial expression servos is obtained according to the Euclidean distance between the facial feature points; the rotation matrix is ​​calculated through the conversion relationship between the image coordinate system and the world coordinate system, and the rotation matrix is ​​converted into Euler angles, and the displacement of the head posture servos is obtained according to the Euler angles; finally, the anthropomorphic robot is controlled to realize anthropomorphic mirroring behavior. The present invention has the characteristics of high precision, real-time performance, high naturalness, etc.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of human-computer interaction. Background Art

[0002] With the development of artificial intelligence, it is inevitable that humanoid robots will enter human life. Intelligent humanoid robots can help humans in their daily lives in terms of teaching, guidance, and elderly companionship. However, some studies have pointed out that more than 60% of human-computer interactions are generated through non-verbal behaviors, such as facial expressions and head movements. In order to achieve natural and effective human-computer interaction, it is of great significance that humanoid robots need to make the same changes in facial expressions and head movements as humans in real time to convey the current motivational state and emotions. Therefore, under the constraints of the servo and hardware, it is crucial for humanoid robots to provide more natural and effective social services by generating mirror behaviors of facial expressions and head movements in real time.

[0003] In recent years, many studies have reported on the research progress of mirror behavior generation, such as virtual avatar technology, which can simulate the changes of human facial features, expressions, gestures and postures in the virtual world. However, there is a big difference between robots and virtual avatars. We divide the human face into pixels, and in the process of realizing mirror behavior, the virtual avatar can usually adjust the state of each pixel because there is no limitation of mechanical structure. Therefore, the generated mirror behavior is more realistic. The movement of the humanoid robot's face requires the servo device to pull, and when the internal space of the robot is limited, it is unrealistic to set up a corresponding servo device for each pixel. Therefore, realizing the mirror behavior of human facial expressions and head movements in real time is still a challenge for humanoid robots.

[0004] In addition to the limitations of the mechanical structure, it is also crucial to improve the accuracy of camera-based facial feature point extraction, whose accuracy determines the similarity of the robot's mirror behavior. However, traditional facial feature point extraction methods, such as those based on point distribution modules, have limited computational efficiency and are sensitive to noise. The linear regression method has few detection points and is difficult to adjust parameters. Traditional convolutional neural networks have poor robustness and weak generalization ability. Compared with the above traditional technologies, deep learning technology has stronger learning ability and adaptability in facial feature point extraction. Through deep learning technology, high accuracy and high robustness of facial feature information extraction can be ensured, and facial feature information can be converted from 2D to 3D to reduce the dependence of depth information on the camera. In addition, in human-computer interaction, good real-time performance is more in line with human expectations during interaction. However, due to the limited memory and computing power of embedded devices deployed in humanoid robots, the oversized models obtained from deep learning networks can lead to problems of insufficient memory and high latency.

[0005] Emotional interaction ability is essential for humanoid robots to have good human-computer interaction. In previous studies, it was found that robots with anthropomorphic appearance and facial expressions have strong comprehensive abilities and can adapt to human inertial thinking. Humans can understand the corresponding status from the non-verbal behavior of humanoid robots, just like getting along with other humans. Therefore, generating natural facial expressions and head movements on humanoid robots is essential for effective human-computer interaction, and the most direct and simple way to generate natural movements is to let the robot imitate human facial expressions and head movements. At the same time, for the robot's mirror behavior, accurate mirror behavior generation methods and good real-time performance can also help improve the naturalness and effectiveness of human-computer interaction.

[0006] Traditional methods for robots to imitate facial expressions and head movements mainly rely on a set of fixed pre-programmed movements. For example, the application document with application number CN202110791164.0 discloses a robot expression driving method, which binds the robot's facial static expression model to multiple facial expressions of real people; the application document with application number CN202120709378.4 discloses a bionic mechanical head with facial expression sensing control, which can complete the movement of specific simulated skin according to different touches; the application document with application number CN202120664217.8 discloses a toy robot that can change facial expressions, simulating human expression changes by lighting up the eye and mouth hole lights. Although many scholars have conducted relevant research, these ways of imitating expressions cannot accurately reflect the movement relationship between humans and humanoid robots, and the expression types are limited and the similarity is low.

[0007] For natural and effective robot mirroring behavior, facial feature recognition has high requirements for accuracy and real-time performance. In previous studies, for example, the application document with application number CN201810593985.1 discloses a robot expression imitation method based on a smooth constraint inverse mechanical model, which generates the optimal motor control sequence with the performer's real-time facial features as the target; for example, the application document with application number CN201810813473.1 discloses a robot-oriented multimodal fusion emotion computing method, which realizes the robot's emotion computing by fusing the user's multimodal information and linear regression model; for example, the application document with application number CN201910101743.0 discloses a conditional generative adversarial network three-dimensional facial expression motion unit synthesis method. However, most of the above studies are still in the experimental theory stage, and most of the current algorithms do not consider the real-time problem on embedded devices, and the deviation of expression imitation is large when running on actual anthropomorphic robots. Existing robot mirroring behavior research usually has defects such as real-time problems of embedded devices and large deviations in robot expression imitation. Summary of the invention

[0008] Purpose of the invention: In order to solve the problems existing in the above-mentioned prior art, the present invention provides a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network.

[0009] Technical solution: The present invention provides a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network, characterized in that the method is:

[0010] Step 1: Preprocess the sample face image;

[0011] Step 2: Establish a lightweight deep neural network and use sample face images to train the lightweight deep neural network;

[0012] Step 3: Use the trained lightweight deep neural network to extract facial feature points in the current face image captured by the camera;

[0013] Step 4: The face of the anthropomorphic robot is provided with a plurality of facial expression servos and head posture servos, wherein the facial expression servos are used to control the facial expression of the anthropomorphic robot, and the head posture servos are used to control the head posture of the anthropomorphic robot; the displacement of the corresponding facial expression servos is obtained according to the Euclidean distance between the facial feature points; the rotation matrix is ​​calculated through the conversion relationship between the image coordinate system and the world coordinate system, and the rotation matrix is ​​converted into Euler angles, and the displacement of the head posture servos is obtained according to the Euler angles; finally, the anthropomorphic robot is controlled to realize anthropomorphic mirror behavior.

[0014] Furthermore, the preprocessing includes: face alignment, pixel conversion and grayscale processing.

[0015] Furthermore, the lightweight deep neural network includes a first convolutional layer, a first maximum pooling layer, first to fourth lightweight network components, a second maximum pooling layer, fifth to seventh lightweight network components, a third maximum pooling layer, an eighth lightweight network component, a second convolutional layer, a first fully connected layer and a second fully connected layer connected in sequence;

[0016] The first to eighth lightweight network components have the same structure, all including first to third convolution filters, and each convolution filter is connected to an activation function corrected linear unit, the output of the first convolution filter is connected to the input of the second and third convolution filters, and the outputs of the second and third convolution filters are connected to each other; the first and second convolution filters are both 1*1 convolution filters, and the third convolution filter is a 3*3 convolution filter.

[0017] Furthermore, pruning processing is added to all 3*3 convolutional filters and two fully connected layers in the first to eighth lightweight network components.

[0018] Furthermore, the facial feature points are feature points reflecting facial action units, and the facial action units include: a left eyebrow unit, a right eyebrow unit, a left eyelid unit, a right eyelid unit, a lip unit, a left corner of the mouth unit and a right corner of the mouth unit; each facial action unit corresponds to a number of facial feature points.

[0019] Furthermore, the displacement of the corresponding facial expression servo in step 4 is obtained as follows: for each facial action unit, the Euclidean distance between every two feature points under the facial action unit is calculated, and the calculated Euclidean distance is normalized, and then the average value is calculated, and the average value is mapped to the normalized displacement of the facial expression servo corresponding to the facial action unit.

[0020] Furthermore, the displacement of the head posture servo obtained according to the Euler angle in step 4 is specifically: the relationship between the image coordinate system and the world coordinate system is expressed by the following formula:

[0021]

[0022] Among them, (x, y) represents the coordinates of the facial feature points in the image coordinate system, (x w ,y w ,z w ) represents the coordinates of the facial feature points in the world coordinate system; f is the focal length of the camera, R and T represent the rotation matrix and translation matrix from the world coordinate system to the camera coordinate system respectively;

[0023] Assume the matrix H is as follows:

[0024]

[0025] Where [R|T] is the augmented matrix containing rotation and translation information;

[0026] Randomly select a number of facial feature points in the sample face image, and substitute the coordinates of the facial feature points in the image coordinate system and the coordinates in the world coordinate system into Formula 1 to linearly solve the matrix H, and then perform QR decomposition on the matrix H to obtain the rotation matrix R and translation matrix T;

[0027] The calculated rotation matrix R is converted into a quaternion q = (w, x1, y1, z1), where where tr(R) represents the trace of the matrix R, r ij represents the i-th row and j-th column of the matrix R, i = 1, 2, ..., 3, j = 1, 2, ..., 3;

[0028] Convert the quaternion q = (w, x1, y1, z1) to Euler angles [α β γ] according to the following formula: T :

[0029]

[0030] Where T represents transposition, α represents the pitch angle of the head, β represents the yaw angle of the head, and γ represents the roll angle of the head;

[0031] Normalize α, β, and γ to the range of (-1, 1), and map each normalized Euler angle to the displacement of the head attitude servo.

[0032] Furthermore, the head of the anthropomorphic robot includes a head frame, an internal module and a neck module; the head frame is 3D printed according to a real human face, and the outside of the head frame fits tightly with the skin to present a humanoid appearance; the hollow part inside the head frame is used to place a mechanical control structure, and the internal module includes a hemispherical mechanism and a nylon rope; the opening and closing of the eyelids are controlled by a pair of hemispherical mechanisms; the up and down movement of the anthropomorphic robot's eyebrows and the concavity and convexity of the cheeks are controlled by pulling different nylon rope deformations; the neck module includes four motors, and the six degrees of freedom of rotation of the neck module are achieved by the coordinated control of the four motors.

[0033] Beneficial effects: The present invention has the characteristics of high precision, real-time performance, high naturalness, etc. In addition, the present invention has a wide range of application prospects. Currently known fields include medical rehabilitation, education and teaching, exhibition visits, emotional interaction, etc. Therefore, it has great economic and academic reference value. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1 It is a schematic diagram of the method of the present invention;

[0035] Figure 2 The structure diagram of the preprocessing and lightweight deep neural network of the present invention;

[0036] Figure 3 It is a structural diagram of the lightweight network component of the present invention;

[0037] Figure 4 The performance comparison diagram of the lightweight deep neural network of the present invention and the current advanced lightweight network; (a) is a training accuracy comparison diagram on the data set 300w; (b) is a loss comparison diagram on the data set 300w; (c) is a training accuracy comparison diagram on the data set HELEN; (d) is a loss comparison diagram on the data set HELEN; (e) is a training accuracy comparison diagram on the data set LFPW; (f) is a loss comparison diagram on the data set LFPW;

[0038] Figure 5 is the correspondence between facial feature points and facial expression servos in the present invention;

[0039] Figure 6is the similarity of the facial expression mirroring behavior of the anthropomorphic robot in the present invention;

[0040] Figure 7 1 is a comparison of three Euler angles of the mirror behavior of the head movement of the anthropomorphic robot in the present invention; (a) is a comparison diagram of the pitch angle trend, (b) is a comparison diagram of the yaw angle trend, and (c) is a comparison diagram of the roll angle trend;

[0041] Figure 8 The Euler angle frequency histogram and normal distribution fitting diagram of the head movement in the present invention; (a) is the pitch angle error diagram, (b) is the yaw angle error diagram, and (c) is the roll angle error diagram;

[0042] Fig. 9 Mirror behavior diagrams of facial expressions and head movements of the anthropomorphic robot of the present invention to different human performers. DETAILED DESCRIPTION

[0043] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.

[0044] like Figure 1 As shown, this embodiment provides a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network, specifically:

[0045] (1) The facial image information of the object to be imitated by the anthropomorphic robot is collected based on the camera, and the image preprocessing including face alignment, pixel conversion and grayscale processing is performed.

[0046] (2) Facial feature point detection process: This process is mainly to run a lightweight deep learning model on the embedded device of the anthropomorphic robot to collect facial feature points on the pre-processed image.

[0047] (3) The process of calculating the displacement of the facial action unit and the head posture. This process is mainly divided into two parts. According to the movement characteristics of the human facial organs, the relative movement between multiple feature points can reflect the displacement degree of a servo. By calculating the Euclidean distance between the corresponding feature points, it corresponds to the normalized displacement degree of the facial servo of the anthropomorphic robot. For the head posture calculation, the rotation matrix is ​​calculated through the conversion relationship between the image coordinate system and the world coordinate system, and the rotation matrix is ​​converted into Euler angles, which corresponds to the normalized displacement degree of the head servo of the anthropomorphic robot.

[0048] (4) Mapping and driving process of servo displacement. This process mainly completes the driving of the servo of the head platform of the anthropomorphic robot. First, STM32F103C8T6 obtains the normalized servo displacement data from Jetson Nano through the serial port. STM32F103C8T6 maps the displacement data of each servo to the duration of the high-level pulse width, so that each servo makes different degrees of displacement.

[0049] (5) The process of anthropomorphic robot mirroring behavior, which mainly completes the mirroring behavior of the facial expressions and head movements of the imitation object. The surface of the robot fits tightly with the soft skin, presenting a humanoid appearance, and the internal hollow part is used to place the mechanical control structure. The facial servo drives the nylon rope structure and the hemispherical mechanism to make the robot make facial expressions, and the neck servo enables the robot head to rotate with six degrees of freedom. Through the collaborative control of STM32F103C8T6, the real-time mirroring behavior of the facial expressions and head movements of the imitation object is realized.

[0050] In this implementation example, the facial information collection system of the imitation object is mainly composed of a high-definition camera and a computing core JetsonNano. The camera is installed 50 cm in front of the imitation object. Jetson Nano collects facial images of the imitation object through the camera and puts the collected images into the preprocessing module. When the user actively sends a stop command, the camera stops collecting and the anthropomorphic robot stops the mirroring behavior.

[0051] In this implementation example, the preprocessing process of the facial image of the imitation object mainly includes face alignment, pixel conversion and grayscale processing. Face alignment is achieved through face detection, and then the pixels of the image after face alignment are converted to 64×64, and the image is converted into a grayscale image. Finally, the image format of 64×64×1 is input into a lightweight deep neural network for facial feature point recognition.

[0052] In this implementation example, the following is designed: Figure 2 The lightweight deep neural network shown uses three datasets, 300W, HELEN, and LFPW, to train the network model. The three datasets contain facial image files and facial feature point coordinate files. In the preprocessing stage, the facial image files and facial feature point coordinate files in the three datasets are first read, and an augmented dataset is generated through geometric normalization and illumination processing to improve the training effect of the deep learning neural network. Then, the image pixels are converted to 64×64, and then the image is converted to a grayscale image. Finally, the facial image files and facial feature point coordinate files are converted to a format for training and sent to the lightweight deep learning network for training.

[0053] In this implementation example, the lightweight deep learning network mainly includes two standard convolutional layers, eight lightweight network components, three maximum pooling layers and two fully connected layers. Two standard convolutional layers (Conv1, Conv2), eight lightweight network components (Fire Module), three maximum pooling layers and two fully connected layers (Fc1, Fc2). The total computational amount C in the network structure is expressed as follows:

[0054]

[0055] Among them, C onv1 and C onv2 is the computational cost (i.e., amount of computation) of two standard convolutional layers, C Fc is the computational cost of the fully connected layer, is the computational cost of the kth FireModule.

[0056] For a standard convolutional layer, the computational cost expression is as follows:

[0057] D K ×D K ×M×N×D F ×D F (4)

[0058] Among them, D K is the convolution kernel size, M is the number of channels of the input feature map, N is the number of channels of the output feature map, and D F is the size of the output feature map. Therefore, to achieve the same result as the Fire Module, the computational cost of the standard convolution is expressed as follows:

[0059]

[0060] in, Enter the number of channels of the Fire Module. is the number of channels output by the Fire Module. H is the length of the feature image, and W is the width of the input feature image;

[0061] like Figure 3 As shown, each Fire Module includes two 1×1 convolution filters and one 3×3 convolution filter. In this embodiment, a 1×1 convolution filter is used instead of a 3×3 convolution filter to reduce the number of input channels of the 3×3 convolution filter, so as to reduce the computational cost. The computational cost expression of the lightweight network component in this embodiment is as follows:

[0062] The computational cost of the first convolution filter (1*1 filter):

[0063] The computational cost of the second convolution filter (1*1 filter):

[0064] The computational cost of the third convolution filter (3*3 filter):

[0065] Computational cost of lightweight network components:

[0066] In this embodiment, The ratio of the computational reduction of each Fire Module compared to ordinary convolution is shown in the following formula:

[0067]

[0068] The reduction in computational cost depends on and even though The computational complexity of the Fire Module is also 12 times less than that of ordinary convolution, with only a slight reduction in accuracy.

[0069] In this embodiment, each convolution filter is followed by an activation function corrected linear unit.

[0070] In this implementation example, pruning is added to the 3×3 convolutional filters and two fully connected layers of the eight Fire Modules to perform weight pruning. The weight pruning method will iteratively delete connections based on the weight values. When the model reaches a convergence level, weight pruning begins to work. The weight pruning method will eliminate the minimum order of magnitude of weights until the current sparse target is reached, resulting in a smaller network.

[0071] In this implementation example, three data sets, 300W, HELEN and LFPW, are used to train the lightweight deep neural network of this embodiment. The lightweight neural network of this embodiment is trained and compared with five advanced lightweight deep neural networks under the same conditions. Figure 4 The accuracy and loss curves of six lightweight neural networks in the data sets HELEN, 300W and LFPW are shown. The experimental results show that the lightweight neural network of this embodiment has high prediction accuracy and good prediction performance under three different data sets. Compared with other lightweight neural networks, the method proposed in this embodiment has better performance, smaller prediction deviation and higher accuracy.

[0072] In this embodiment, the pre-processed simulated object face picture is passed into the lightweight deep neural network, and the two-dimensional and three-dimensional coordinates of the facial feature points are tracked to realize the mirror behavior of the facial expression of the anthropomorphic robot. In this embodiment, 68 facial feature points are collected. These 68 facial feature points are as follows: Figure 5 As shown. The set expression formed by these points is as follows:

[0073] P = {p|p i =(x i ,y i ,z i ),0≤i<68} (7)

[0074] Where (x i ,y i ,z i ) represents the coordinates of the ith facial feature point. The displacement vector expression of the servo that drives the humanoid robot to achieve mirroring behavior is as follows:

[0075] S=(s1,s2,…s M ) (8)

[0076] M represents the total number of servos, s M It represents the optimal displacement of the Mth servo. In this embodiment, M=10. The first seven servos are used to control the facial expressions of the anthropomorphic robot and are facial expression servos. The last three servos are used to control the head movements of the anthropomorphic robot and are head posture servos.

[0077] The servo displacement depends on the initial facial shape set P0 = {p0|p i0 =(x i0 ,y i0 ,z i0 ),0≤i<68}, the initial servo displacement vector S0 and the current facial shape set P are tracked in real time by a lightweight deep neural network. Therefore, the relationship between S and P is expressed as follows:

[0078]

[0079] in Indicates that the optimal displacement of all current servos is determined by the initial face shape, the initial servo displacement vector, and the current face shape.

[0080] The displacement of a servo can affect the positions of multiple facial feature points. Each facial action unit of the anthropomorphic robot head platform (the facial action units include: left eyebrow unit, right eyebrow unit, left eyelid unit, right eyelid unit, lip unit, left mouth corner unit and right mouth corner unit) is controlled by an independent servo. Figure 5 As shown, Figure 5 The corresponding relationship between 68 facial feature points and 10 controllable head servo systems is shown; the corresponding relationship between 7 facial expression servos and the relevant facial feature points in Figure 5, as well as the facial action units is shown in Table 1:

[0081] Table 1

[0082] Servo No. Figure 5 Mid-face landmark number Facial Action Unit <![CDATA[s1]]> <![CDATA[p 19 ,p 20 ,p 21 ,p 27 ]]> Left eyebrow unit <![CDATA[s2]]> <![CDATA[p 22 ,p 23 ,p 24 ,p 27 ]]> Right eyebrow unit <![CDATA[s3]]> <![CDATA[p 37 ,p 38 ,p 40 ,p 41 ]]> Left eyelid unit <![CDATA[s4]]> <![CDATA[p 43 ,p 44 ,p 46 ,p 47 ]]> Right eyelid unit <![CDATA[s5]]> <![CDATA[p 48 ,p 50 ,p 58 ]]> Left mouth corner unit <![CDATA[s6]]> <![CDATA[p 52 ,p 54 ,p 56 ]]> Right corner of mouth <![CDATA[s7]]> <![CDATA[p 51 ,p 57 ,p 62 ,p 66 ]]> Lip unit

[0083] According to the movement law of human facial organs, the servo displacement can be calculated by the relative change of the Euclidean distance between the corresponding facial feature points. The Euclidean distance between any two facial feature points is shown as follows:

[0084]

[0085] Among them, (x m ,y m ,z m ) is the coordinate of facial feature point m in the world coordinate system, (x n1 ,y n1 ,z n1 ) is the coordinate of facial feature point n1

[0086] The calculated Euclidean distance is normalized and mapped to the displacement of the corresponding servo. The normalized expression is as follows:

[0087]

[0088] Among them, E max and E min It is the Euclidean distance between facial feature points when the corresponding servo reaches the maximum and minimum displacement. For the servo mapping of the lip unit and the left and right corners of the mouth unit, the initial Euclidean distance is the minimum distance between the two facial feature points. Finally, all the Euclidean distances of the two units are normalized to the range of (0, 1). At the same time, for the eyebrow unit and the eyelid unit, the initial distance is the average of the maximum and minimum distances, and the Euclidean distance of the two units is normalized to the range of (-1, 1). For any facial action unit, calculate the normalized mean and map the mean to the normalized displacement of the facial expression servo corresponding to the facial action unit.

[0089] In this implementation example, the three Euler angles of head movement can be inferred from the corresponding facial feature points in the 2D (image) and 3D (world) coordinate systems to achieve the mirror behavior of the anthropomorphic robot's head movement. The relationship between the image coordinate system and the world coordinate system is expressed as follows:

[0090]

[0091] Where [xy] T is the coordinate of the facial feature point in the image coordinate system, [x w y w z w ] T is the coordinate of the facial landmarks in world coordinates, f is the focal length of the camera, R and T are the rotation matrix and translation matrix from the world coordinate system to the camera coordinate system, and Zc =Rz w +T. Define [R|T] as an augmented matrix containing rotation and translation information, and let the matrix H be as follows:

[0092]

[0093] Since the matrix H has 12 dimensions in total, a number of feature points (6 in this embodiment) are randomly selected from the 68 facial feature points, and the coordinates of the selected facial feature points in the image coordinate system and the coordinates in the world coordinate system are brought into the relationship expression between the image coordinate system and the world coordinate system, and a linear solution is performed on the matrix H. Finally, the matrix H is subjected to QR decomposition to obtain the rotation matrix R and the translation matrix T.

[0094] Secondly, the calculated rotation matrix R is converted into a quaternion q = (w, x1, y1, z1), and then converted into Euler angles [α, β, γ] T , the three posture angles of head rotation are calculated. The conversion function expression from rotation matrix to quaternion is as follows:

[0095]

[0096]

[0097]

[0098]

[0099] where tr(R) represents the trace of the matrix R, r ij Represents the i-th row and j-th column of matrix R, i = 1, 2, …, 3, j = 1, 2, …, 3.

[0100] Convert quaternion q = (w, x, y, z) to Euler angles [α β γ] T The formula expression is as follows:

[0101]

[0102] Among them, [α, β, γ] T Represent the pitch angle, yaw angle and roll angle of the head respectively. Calculate the values ​​of the four servo systems used for head motion control when they reach the maximum and minimum displacements, and normalize the three Euler angles. The three Euler angles are finally normalized to the range of (-1, 1), and the normalized Euler angles can be mapped to the normalized displacement of the corresponding servo.

[0103] In this embodiment, the optimal servo displacement mapping of facial feature points is performed on the humanoid robot to achieve the mirror behavior between the human performer and the humanoid robot. In order to qualitatively evaluate the mirror behavior of facial expressions and head movements between the human performer and the humanoid robot, two practical verification systems were established to evaluate the mirror behavior of facial expressions and head movements. A camera was installed about 50 cm in front of the three human subjects to collect facial images and record these facial expressions and the corresponding mirror behaviors of the humanoid robot.

[0104] In this embodiment, in order to analyze the specific similarities of facial expression mirroring behaviors, the facial expressions of the human performer and the anthropomorphic robot are input into the same facial expression recognition algorithm, and the corresponding emotion categories and prediction probabilities are calculated to evaluate the similarities of facial expression mirroring behaviors. Figure 6 As shown, the ordinate represents the predicted probability of emotion recognition. The results show that the expressions generated by the humanoid robot are highly similar to those of real human faces.

[0105] In this embodiment, in order to analyze the similarity of the mirror behavior of the head movement, the NOKOV optical motion capture system is used as a reference to calculate the head rotation angle. Five reflective markers are installed on the surface of the robot head platform, and eight optical high-speed cameras track the reflective marker points on the robot head platform from different angles to capture the head movement. The NOKOV system records the movement of the anthropomorphic robot head, and the camera records the movement of the human performer's head.

[0106] Figure 7 A comparison of the three Euler angles of head rotation between the NOKOV system and the camera system is shown, and the results show that the anthropomorphic robot is able to accurately track head movements. Figure 8 The corresponding frequency histogram and normal distribution fit are shown, and the error curve is normally distributed around zero, which is a normal distribution.

[0107] Fig. 9 The similarity comparison of the facial images of human performers, the distribution of facial feature points and the mirror behavior of the anthropomorphic robot was presented. The results showed that the humanoid robot was able to imitate the main features of human facial expressions, and the mirror behavior of facial expressions and head movements had a high similarity.

[0108] Compared with other systems, this implementation example has the characteristics of high precision, real-time performance, high naturalness, etc. In addition, this type of system has a wide range of application prospects. Currently known fields include medical rehabilitation, education and teaching, exhibition visits, emotional interaction, etc. Therefore, it has great economic and academic reference value.

[0109] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not further describe various possible combinations.

Claims

1. A method for realizing real-time mirroring behavior of a robot based on a lightweight neural network, characterized in that: The method is: Step 1: Preprocess the sample face image; Step 2: Establish a lightweight deep neural network and use sample face images to train the lightweight deep neural network; Step 3: Use the trained lightweight deep neural network to extract facial feature points in the current face image captured by the camera; Step 4: The face of the anthropomorphic robot is provided with a plurality of facial expression servos and head posture servos, wherein the facial expression servos are used to control the facial expression of the anthropomorphic robot, and the head posture servos are used to control the head posture of the anthropomorphic robot; the displacement of the corresponding facial expression servos is obtained according to the Euclidean distance between the facial feature points; the rotation matrix is ​​calculated through the conversion relationship between the image coordinate system and the world coordinate system, and the rotation matrix is ​​converted into Euler angles, and the displacement of the head posture servos is obtained according to the Euler angles; finally, the anthropomorphic robot is controlled to realize anthropomorphic mirror behavior; The lightweight deep neural network includes a first convolutional layer, a first maximum pooling layer, first to fourth lightweight network components, a second maximum pooling layer, fifth to seventh lightweight network components, a third maximum pooling layer, an eighth lightweight network component, a second convolutional layer, a first fully connected layer and a second fully connected layer connected in sequence; The first to eighth lightweight network components have the same structure, all including first to third convolution filters, and each convolution filter is connected to an activation function corrected linear unit, the output of the first convolution filter is connected to the input of the second and third convolution filters, and the outputs of the second and third convolution filters are connected to each other; the first and second convolution filters are both 1*1 convolution filters, and the third convolution filter is a 3*3 convolution filter.

2. According to claim 1, a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network is characterized in that: The preprocessing includes: face alignment, pixel conversion and grayscale processing.

3. According to claim 1, a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network is characterized in that: Pruning is added to all 3*3 convolutional filters and two fully connected layers in the first to eighth lightweight network components.

4. According to claim 1, a method for realizing real-time mirroring behavior of a robot based on a lightweight neural network is characterized in that: The facial feature points are feature points reflecting facial action units, and the facial action units include: a left eyebrow unit, a right eyebrow unit, a left eyelid unit, a right eyelid unit, a lip unit, a left corner of the mouth unit, and a right corner of the mouth unit; each facial action unit corresponds to a number of facial feature points.

5. The method for realizing real-time mirroring behavior of a robot based on a lightweight neural network according to claim 4, characterized in that: The displacement of the corresponding facial expression servo in step 4 is obtained specifically as follows: for each facial action unit, the Euclidean distance between every two feature points under the facial action unit is calculated, and the calculated Euclidean distance is normalized, and then the average value is calculated, and the average value is mapped to the normalized displacement of the facial expression servo corresponding to the facial action unit.

6. The method for realizing real-time mirroring behavior of a robot based on a lightweight neural network according to claim 4, characterized in that: In step 4, the displacement of the head posture servo is obtained according to the Euler angle as follows: The relationship between the image coordinate system and the world coordinate system is expressed by the following formula: , Among them, (x, y) represents the coordinates of the facial feature points in the image coordinate system, represents the coordinates of facial feature points in the world coordinate system, f is the focal length of the camera, and They represent the rotation matrix and translation matrix from the world coordinate system to the camera coordinate system respectively; Let matrix Is the following formula: (2), in is the augmented matrix containing rotation and translation information; Randomly select several facial feature points in the sample face image, and substitute the coordinates of the facial feature points in the image coordinate system and the coordinates in the world coordinate system into formula (1) to calculate the matrix Perform a linear solution and then apply the matrix Perform QR decomposition to obtain the rotation matrix and translation matrix ; The calculated rotation matrix Convert to quaternion ,in , , , ,in represents the trace of the matrix R, Representation Matrix The i-th row and j-th column of , ; According to the following formula, the quaternion Convert to Euler angles : , Where T represents transpose, represents the pitch angle of the head, represents the yaw angle of the head, Indicates the roll angle of the head; Will , and Normalized to the range of (-1, 1), each normalized Euler angle is mapped to the displacement of the head attitude servo.

7. The method for realizing real-time mirroring behavior of a robot based on a lightweight neural network according to claim 1, characterized in that: The head of the anthropomorphic robot includes a head frame, an internal module and a neck module; the head frame is 3D printed according to a real human face, and the outside of the head frame fits tightly with the skin, presenting a humanoid appearance; the hollow part inside the head frame is used to place the mechanical control structure, and the internal module includes a hemispherical mechanism and a nylon rope; the opening and closing of the eyelids are controlled by a pair of hemispherical mechanisms; the up and down movement of the anthropomorphic robot's eyebrows and the concavity and convexity of the cheeks are controlled by pulling different nylon rope deformations; the neck module includes four motors, and the four motors are used to coordinately control the neck module to achieve six degrees of freedom of rotation.