Infant pain recognition system based on participation degree of facial action unit
Through the infant pain recognition system based on facial action unit participation, the uniqueness and active areas of infant pain are identified, solving the problems of manual evaluation limitations and subjective bias in the existing technology, and achieving a more accurate and generalized pain recognition effect. .
Patent Information
- Application Number
- CN202410528446.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-08-30
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing infant pain assessment system relies on manual assessment, has limitations and subjective biases, and is difficult to accurately identify infant pain. It also directly applies adult pain identification methods to infants, ignoring the uniqueness of infant expressions.
An infant pain recognition system based on facial action unit participation is adopted. Through image processing, facial active area module and core facial action unit screening module, the uniqueness of infant pain expression is mined, the active area and core facial action unit are determined, and multi-layer perception is used To predict pain intensity.
It improves the accuracy and generalization of the infant pain identification system, provides a new pain measurement standard, and can effectively identify infant pain in different environments.
Smart Images

Figure CN118570849A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep learning and biomedicine, and in particular to an infant pain recognition system based on facial action unit engagement. Background Art
[0002] For infants, timely assessment of pain and adoption of effective pain management measures are worthy of attention. Pain in infancy can affect future mental health and their response to pain. Limited by the self-expression ability of infants, it is difficult for them to express their feelings effectively. At present, the intensity of infant pain is mainly assessed manually in clinical practice, such as using face, legs, activity, crying, comfort child pain assessment scale, infant pain scale and infant facial coding system. However, there are limitations in manual assessment of infant pain, which requires a large number of well-trained professionals, making it difficult for infant guardians and non-professional medical staff to accurately assess infant pain. In addition, due to the subjective bias of third-party observers, such as factors such as region, culture and gender, manual pain assessment may be biased. Therefore, it is very necessary to carry out research on automatic pain recognition system for infants so as to take necessary pain management measures to reduce the adverse effects of pain on the physical and mental development of infants.
[0003] There are many studies on automatic pain assessment systems for infants, however, most existing methods ignore the difference between infant and adult expressions and directly apply adult pain recognition methods to infants. Due to the influence of acquired education and social factors, the facial expressions of adults are very different from those of infants. Infants have stronger reactions to pain and have more mouth movements. Summary of the invention
[0004] The purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art, and proposes an infant pain recognition system based on the participation of facial action units. By exploring the uniqueness of infant pain expressions, a pain recognition system dedicated to infants is realized. Secondly, the active areas and facial action units behind infant pain expressions are revealed, the accuracy of the pain recognition system is enhanced, and a new infant pain measurement standard is provided to medical staff.
[0005] To achieve the above object, the technical solution provided by the present invention is: an infant pain recognition system based on facial action unit participation, comprising:
[0006] An image processing module, used for loading the facial frame of the baby and pre-processing the facial frame to obtain a processed frame of the baby's face with the head cropped and at a frontal angle;
[0007] The facial active region module is used to explore the facial regions that are active when infants are in pain. It uses the processed frames obtained by the image processing module as input, fine-tunes the pain classification task on the pre-trained model, intercepts the gradient of the model and calculates the corresponding class activation map, thereby determining the facial regions that are active when infants are in pain.
[0008] A core facial action unit screening module is used to obtain the core facial action unit when the infant is in pain, and calculate the participation of different facial action units when the infant is in pain by defining the center of the facial action unit and combining it with the class activation map output by the facial active area module, and finally determine the core facial action unit when the infant is in pain through a screening experiment; wherein the facial action unit is a system for describing facial muscle movements, which decomposes facial expressions into facial muscle movements, i.e., facial action units, wherein the facial action unit that best represents the infant's expression of pain is the core facial action unit, and the facial action unit center is the center of the relevant area of each facial action unit, which is determined by the position of the facial muscle group related to the corresponding facial action unit;
[0009] The infant pain intensity prediction module takes the intensity of the core facial action unit output by the core facial action unit screening module as input and the participation of the core facial action unit as weight, and uses a multi-layer perceptron to detect the infant's pain intensity.
[0010] Further, the image processing module performs the following operations:
[0011] First, load the JPG or PNG RGB file of the original image frame of the baby's face to obtain the image object, use a high-precision dual-branch face detector to crop the baby's face and obtain the facial coordinates, then calculate the inclination angle of the baby's face based on the obtained facial coordinates, and finally, rotate the cropped baby's face to the frontal angle based on the inclination angle, so as to obtain the facial action unit intensity and participation of the image frame in the subsequent steps.
[0012] Further, the facial active area module comprises the following steps:
[0013] 3.1) Fine-tune the pain classification task on the pre-trained model. In this step, the pre-trained model used is ResNet-18, which consists of a residual convolution block with a residual structure and a fully connected layer. ResNet-18 uses a basic residual block, which contains two convolution layers and a corresponding residual structure. The output formula is as follows:
[0014] F(x)=ReLU(W2·ReLU(W1·x+b1)+b2)+x
[0015] H(x)=F(x)+x
[0016] Where x is the input image of the model or the input of the previous layer, W1 and W2 are the weights of the two convolutional layers, b1 and b2 are the bias terms of the corresponding convolutional layers, ReLU is the activation function used by the convolutional layer, F(x) is the output of the convolutional layer, and H(x) is the output with the basic residual block;
[0017] Replace the fully connected layer of the model, and replace the size of the fully connected layer with the corresponding pain classification level. The output formula is as follows:
[0018] z=Wx+b
[0019] In the formula, W is the weight matrix of the fully connected layer, x is the input of the previous layer, and z is the output of the fully connected layer. After obtaining the output of the fully connected layer, Softmax is used to obtain the predicted probability of each category, thereby predicting the pain intensity level of the infant. In training, the cross entropy loss function is used as the loss function of the model, and the formula is as follows:
[0020]
[0021] Where N is the number of infant image frames, C is the number of pain level categories, and y i,c is the true label of the cth category of the ith sample. If the sample belongs to category c, it is 1, otherwise it is 0; p i,c represents the probability that the model predicts that the i-th sample belongs to category c; log is the logarithmic function with base e; after calculating the loss, the model is trained using back propagation to adjust all parameters of the model, thereby completing the fine-tuning of the pre-trained model for the pain classification task;
[0022] 3.2) Calculate the class activation map and determine the active areas of the infant's pain expression. In order to determine the activity of different facial areas of the infant in the pain classification task, the gradient class activation map is used to analyze the infant pain expression classification knowledge learned by the fine-tuned pre-trained model in the previous step; in this step, the gradient class activation map algorithm is used to calculate the gradient of the last convolutional layer of the pre-trained model, and the model's prediction is combined with the spatial position of the image to generate a class activation map to show in which areas the model contributes most to the pain classification results. The formula is as follows:
[0023]
[0024] In the formula, c is the category in the classification experiment, Represents the activation value of the feature map output by the last convolutional layer of ResNet-18 for category c at the coordinate (r, s) in channel k, where r is the horizontal coordinate of the width and s is the vertical coordinate of the height. represents the weight of the vertical coordinate j of the feature map in channel k for category c, L represents the total number of channels of the feature map, Rk and S k are the width and height of the feature map in channel k, respectively, and ReLU is the activation function; the gradient class activation map back-propagates the gradient information, and then weightedly summarizes the response of each feature map according to the gradient information of the specific pain category to obtain the activation map corresponding to the pain category. Through this activation map, the active area of the infant's pain expression is determined.
[0025] Further, the core facial action unit screening module includes the following steps:
[0026] 4.1) Calculating the participation of different facial action units. In this step, after obtaining the active area of the infant's pain expression in the facial active area module, the participation of different facial action units in the infant's pain expression is further determined by defining the center of the facial action unit. The center of the facial action unit is the center of the area related to each facial action unit, which is determined by the position of the facial muscle group related to the corresponding facial action unit;
[0027] The engagement of the following facial action units was calculated: raising inner eyebrows, raising outer eyebrows, lowering eyebrows, lifting cheeks, tightening eyelids, wrinkling nose, lifting upper lip, pulling up upper lip corners, stretching lips, parting lips, opening mouth wide, and squinting eyes, which are facial action units highly related to pain expressions;
[0028] According to the order of the above facial action units, the centers of the facial action units are defined in sequence according to the following rules: 1 / 2 scaling distance above the inner eyebrow, 1 / 3 scaling distance above the outer eyebrow, 1 / 3 scaling distance below the center of the eyebrow, one scaling distance below the bottom of the eye, the center of the eye, the nose wing, the center of the upper lip, the edge of the lip, one scaling distance below the edge of the lip, the center of the lip, the center of the mouth, and the center of the eye; among them, due to differences between individuals, the distance between each person's eyes is defined as the scaling distance to remove the interference caused by individual differences, and the relevant area corresponding to the facial action unit uses the center of the facial action unit as the center point and expands to a size of 10×10 in all directions;
[0029] According to the class activation map output obtained by the facial active area module, the average pixel value of each facial action unit related area is calculated to evaluate the involvement of different facial action units. The pain image correctly classified in the facial active area module is selected as input, and the involvement of the facial action unit is calculated according to the following formula:
[0030]
[0031]
[0032] …
[0033]
[0034] Where AU1 represents the facial action unit No. 1, i.e., raising the inner eyebrow; AU1E represents the participation of the facial action unit; M represents the number of correctly classified baby image frames; Area represents the size of the relevant area of the facial action unit, i.e., 10×10. They represent the rightmost width value, leftmost width value, lowest height value, and highest height value corresponding to the relevant area of the first facial action unit in the class activation map of the i-th image, that is, the range corresponding to the relevant area; AU2 represents facial action unit No. 2, that is, raising the outer eyebrow, and AU2E represents the participation degree of the facial action unit. The rightmost width, leftmost width, lowest height, and highest height values of the relevant area of the second facial action unit in the class activation map of the i-th image are represented respectively; AU 43 Represents facial action unit 43, which means eyes narrowed into slits, AU 43 E represents the participation of the facial action unit. The rightmost width value, leftmost width value, lowest height value, and highest height value corresponding to the relevant area of the forty-third facial action unit in the class activation map of the i-th image are represented respectively; CA i represents the pixel value in the output of the i-th class activation map, (r, s) is the coordinate of the relevant area of the corresponding facial action unit, r is the horizontal coordinate of the width, and s is the vertical coordinate of the height;
[0035] 4.2) Screening the core facial action units of infant pain expression. In this step, the facial action units are screened according to the calculated engagement levels of different infant pain expression facial action units. Different pre-trained models, including DenseNet, GoogLeNet, ResNet18, ResNet34, VGG11 and VGG16, are used to perform fine-tuning tasks for pain classification. The engagement levels of different facial action units are calculated according to the above step 4.1), and the facial action units are sorted according to the engagement levels. Finally, the six facial action units of opening the mouth wide, parting the lips, lifting the upper lip, wrinkling the nose, pulling up the upper lip corners and lifting the cheeks are determined as the core facial action units of infant pain expression.
[0036] Further, the infant pain intensity prediction module comprises the following steps:
[0037] 1) Using the strength of core facial action units as input, where the strength of facial action units is evaluated using the OpenFace detection tool;
[0038] 2) Using the participation of the core facial action unit calculated by the core facial action unit screening module as the weight, the core facial action unit strength and the participation are fused element-by-element multiplication at the input layer of the multilayer perceptron;
[0039] 3) A multi-layer perceptron with three layers is used to evaluate the pain intensity of infants. The first layer is the input layer, the size of which is the number of core facial action units, the second layer is a hidden layer of size 3, and the third layer is the output layer to predict the pain intensity of infants.
[0040] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0041] 1. By exploring the uniqueness of infants’ pain expressions, a pain recognition system specifically for infants has been developed.
[0042] 2. The active areas and action units behind infants’ pain expressions are revealed, enhancing the accuracy of the pain recognition system.
[0043] 3. By using the individual-independent facial action unit intensity and its engagement as input, the generalization of the pain recognition system is further improved, enabling better pain recognition in real and unfamiliar environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] Figure 1 Schematic diagram of the relationship between various modules of the system of the present invention.
[0045] Figure 2 Schematic diagram of the structure of the facial active area module.
[0046] Figure 3 Schematic diagram of the structure of the core facial action unit screening module.
[0047] Figure 4 Schematic diagram of the structure of the infant pain intensity prediction module. DETAILED DESCRIPTION
[0048] The present invention will be further described below in conjunction with specific embodiments.
[0049] This embodiment discloses an infant pain recognition system based on facial action unit participation, which is developed based on Python's Pytorch framework and runs on Windows devices. The relationship between the modules of the system is as follows: Figure 1 As shown, including:
[0050] An image processing module, used for loading the facial frame of the baby and pre-processing the facial frame to obtain a processed frame of the baby's face with the head cropped and at a frontal angle;
[0051] The facial active region module is used to explore the facial regions that are active when infants are in pain. It uses the processed frames obtained by the image processing module as input, fine-tunes the pain classification task on the pre-trained model, intercepts the gradient of the model and calculates the corresponding class activation map, thereby determining the facial regions that are active when infants are in pain.
[0052] A core facial action unit screening module is used to obtain the core facial action unit when the infant is in pain, and calculate the participation of different facial action units when the infant is in pain by defining the center of the facial action unit and combining it with the class activation map output by the facial active area module, and finally determine the core facial action unit when the infant is in pain through a screening experiment; wherein the facial action unit is a system for describing facial muscle movements, which decomposes facial expressions into facial muscle movements, i.e., facial action units, wherein the facial action unit that best represents the infant's expression of pain is the core facial action unit, and the facial action unit center is the center of the relevant area of each facial action unit, which is determined by the position of the facial muscle group related to the corresponding facial action unit;
[0053] The infant pain intensity prediction module takes the intensity of the core facial action unit output by the core facial action unit screening module as input and the participation of the core facial action unit as weight, and uses a multi-layer perceptron to detect the infant's pain intensity.
[0054] Specifically, the image processing module performs the following operations:
[0055] First, load the JPG or PNG RGB file of the original image frame of the baby's face to obtain the image object, use a high-precision dual-branch face detector to crop the baby's face and obtain the facial coordinates, then calculate the inclination angle of the baby's face based on the obtained facial coordinates, and finally, rotate the cropped baby's face to the frontal angle based on the inclination angle, so as to obtain the facial action unit intensity and participation of the image frame in the subsequent steps.
[0056] Specifically, Figure 2 As shown, the facial active area module includes the following steps:
[0057] 3.1) Fine-tune the pain classification task on the pre-trained model. In this step, the pre-trained model used is ResNet-18, which consists of a residual convolution block with a residual structure and a fully connected layer. ResNet-18 uses a basic residual block, which contains two convolution layers and a corresponding residual structure. The output formula is as follows:
[0058] F(x)=ReLU(W2·ReLU(W1·x+b1)+b2)+x
[0059] H(x)=F(x)+x
[0060] Where x is the input image of the model or the input of the previous layer, W1 and W2 are the weights of the two convolutional layers, b1 and b2 are the bias terms of the corresponding convolutional layers, ReLU is the activation function used by the convolutional layer, F(x) is the output of the convolutional layer, and H(x) is the output with the basic residual block;
[0061] Replace the fully connected layer of the model, and replace the size of the fully connected layer with the corresponding pain classification level. The output formula is as follows:
[0062] z=Wx+b
[0063] In the formula, W is the weight matrix of the fully connected layer, x is the input of the previous layer, and z is the output of the fully connected layer. After obtaining the output of the fully connected layer, Softmax is used to obtain the predicted probability of each category, thereby predicting the pain intensity level of the infant. In training, the cross entropy loss function is used as the loss function of the model, and the formula is as follows:
[0064]
[0065] Where N is the number of infant image frames, C is the number of pain level categories, and y i,c is the true label of the cth category of the ith sample. If the sample belongs to category c, it is 1, otherwise it is 0; p i,c represents the probability that the model predicts that the i-th sample belongs to category c; log is the logarithmic function with base e; after calculating the loss, the model is trained using back propagation to adjust all parameters of the model, thereby completing the fine-tuning of the pre-trained model for the pain classification task;
[0066] 3.2) Calculate the class activation map and determine the active areas of the infant's pain expression. In order to determine the activity of different facial areas of the infant in the pain classification task, the gradient class activation map is used to analyze the infant pain expression classification knowledge learned by the fine-tuned pre-trained model in the previous step; in this step, the gradient class activation map algorithm is used to calculate the gradient of the last convolutional layer of the pre-trained model, and the model's prediction is combined with the spatial position of the image to generate a class activation map to show in which areas the model contributes most to the pain classification results. The formula is as follows:
[0067]
[0068] In the formula, c is the category in the classification experiment, Represents the activation value of the feature map output by the last convolutional layer of ResNet-18 for category c at the coordinate (r, s) in channel k, where r is the horizontal coordinate of the width and s is the vertical coordinate of the height. represents the weight of the vertical coordinate j of the feature map in channel k for category c, L represents the total number of channels of the feature map, R k and S k are the width and height of the feature map in channel k, respectively, and ReLU is the activation function; the gradient class activation map back-propagates the gradient information, and then weightedly summarizes the response of each feature map according to the gradient information of the specific pain category to obtain the activation map corresponding to the pain category. Through this activation map, the active area of the infant's pain expression is determined.
[0069] Specifically, Figure 3 As shown, the core facial action unit screening module includes the following steps:
[0070] Table 1 Facial action units and facial action unit center rules
[0071]
[0072] 4.1) Calculate the participation of different facial action units. In this step, after obtaining the active area of the infant's pain expression in the facial active area module, the participation of different action units in the infant's pain expression is further determined by defining the center of the facial action unit, as shown in Table 1, using the facial action units and their center rules in the table. The center of the facial action unit is the center of the relevant area of each facial action unit, which is determined by the position of the facial muscle group related to the corresponding facial action unit. Among them, due to differences between individuals, the distance between each person's eyes is defined as the scaling distance to remove the interference caused by individual differences. The relevant area of the corresponding facial action unit uses the center of the facial action unit as the center point and expands to a size of 10×10 in all directions.
[0073] According to the class activation map output obtained by the facial active area module, the average pixel value of each facial action unit related area is calculated to evaluate the involvement of different facial action units. The pain image correctly classified in the facial active area module is selected as input, and the involvement of the facial action unit is calculated according to the following formula:
[0074]
[0075]
[0076] …
[0077]
[0078] Where AU1 represents the facial action unit No. 1, i.e., raising the inner eyebrow; AU1E represents the participation of the facial action unit; M represents the number of correctly classified baby image frames; Area represents the size of the relevant area of the facial action unit, i.e., 10×10. They represent the rightmost width value, leftmost width value, lowest height value, and highest height value corresponding to the relevant area of the first facial action unit in the class activation map of the i-th image, that is, the range corresponding to the relevant area; AU2 represents facial action unit No. 2, that is, raising the outer eyebrow, and AU2E represents the participation degree of the facial action unit. The rightmost width, leftmost width, lowest height, and highest height values of the relevant area of the second facial action unit in the class activation map of the i-th image are represented respectively; AU 43 Represents facial action unit 43, which means eyes narrowed into slits, AU 43 E represents the participation of the facial action unit. The rightmost width value, leftmost width value, lowest height value, and highest height value corresponding to the relevant area of the forty-third facial action unit in the class activation map of the i-th image are represented respectively; CA i represents the pixel value in the output of the i-th class activation map, (r, s) is the coordinate of the relevant area of the corresponding facial action unit, r is the horizontal coordinate of the width, and s is the vertical coordinate of the height;
[0079] 4.2) Screening the core facial action units of infant pain expression. In this step, the facial action units are screened according to the calculated engagement levels of different infant pain expression facial action units. Different pre-trained models, including DenseNet, GoogLeNet, ResNet18, ResNet34, VGG11 and VGG16, are used to perform fine-tuning tasks for pain classification. The engagement levels of different facial action units are calculated according to the above step 4.1), and the facial action units are sorted according to the engagement levels. Finally, the six facial action units of opening the mouth wide, parting the lips, lifting the upper lip, wrinkling the nose, pulling up the upper lip corners and lifting the cheeks are determined as the core facial action units of infant pain expression.
[0080] Specifically, Figure 4 As shown, the infant pain intensity prediction module comprises the following steps:
[0081] 1) Using the strength of core facial action units as input, where the strength of facial action units is evaluated using the OpenFace detection tool;
[0082] 2) The participation of the core facial action unit calculated by the core facial action unit screening module is used as the weight, and the core facial action unit strength and participation are fused element by element multiplication in the input layer of the multilayer perceptron
[0083] 3) A multi-layer perceptron with three layers is used to evaluate the pain intensity of infants. The first layer is the input layer, the size of which is the number of core facial action units, the second layer is a hidden layer of size 3, and the third layer is the output layer to predict the pain intensity of infants.
[0084] Table 2 Dataset details
[0085]
[0086]
[0087] To verify the effectiveness of the system of the present invention, experiments and comparative analyses were carried out on three commonly used infant pain datasets: YouTube immunization dataset, YouTube blood test dataset, and iCOPEVid dataset.
[0088] The YouTube Immunization Dataset aims to review YouTube videos showing infant vaccinations. In this dataset, observers scored at three time points: 15 seconds before, during, and 15 seconds after the infant's injection. Since some videos are no longer available on YouTube (non-public or offline) and the infant's face cannot be observed at certain time points in some videos, a total of 76 available videos and 4069 FLACC-scored frames were obtained. The YouTube Blood Test Dataset is similar to the YouTube Immunization Dataset. This dataset reviews YouTube videos of infants undergoing blood tests. This dataset is also scored at three time points: 15 seconds before, during, and after the blood test. In the end, a total of 19 videos and 396 NFCS-scored frames were obtained. The iCOPEVid dataset aims to obtain a set of representative and challenging video sequences of infant pain facial expressions. The difficulty of this dataset is that infants' tense expressions are not only related to painful stimuli, but infants will show tense expressions in many situations. This dataset contains 49 pain video clips and 185 non-pain video clips. After preprocessing the dataset, 445 non-pain frames and 183 pain frames were finally collected. The distribution of all datasets is shown in Table 2.
[0089] In order to prove the effectiveness of the system of the present invention, the system of the present invention is also compared with other methods. Weighted indicators and unweighted accuracy are used to evaluate the performance of the model. The weighted indicators used include accuracy, recall, precision and F1 value. Weighted indicators are easily affected by classes with more class samples in the data set. Unweighted accuracy is calculated by calculating the average of the correctly predicted scores in the class, which can effectively reflect the performance of the model when the data set is unbalanced. The indicator formula used is shown in the following formula:
[0090]
[0091]
[0092]
[0093]
[0094] In the formula, Accuracy, Recall and Precision are accuracy, recall and precision respectively. WA represents weighted accuracy, and UA represents unweighted accuracy. TP, TN, FP and FN are the number of correctly identified positive samples, the number of correctly identified negative samples, the number of false positive negative samples and the number of false positive positive samples respectively. The experimental results are compared in Tables 3 to 5:
[0095] Table 3 Experimental results on YouTube immunization dataset
[0096]
[0097] Table 4 Experimental results of YouTube blood detection dataset
[0098]
[0099]
[0100] Table 5 Experimental results of iCOPEVid dataset
[0101]
[0102] As shown in Tables 3 to 5, the performance indicators of the PSPI pain assessment standard are lower than those of other models. The PSPI standard screens key facial action units based on the facial expressions of pain in adults, and assesses pain by the intensity of facial action units. However, the expressions of pain in adults and infants are significantly different, and infants tend to express pain more directly and intensely, which explains why the PSPI method performed poorly in the experiment. The results of the pain assessment system based on the participation of facial action units show that the performance is better than the PSPI model and the end-to-end facial data pre-training model, which shows that the facial action unit features can better represent facial information and have richer semantics. In particular, the UA results show that the system of the present invention has more advantages than the end-to-end model when dealing with unbalanced data distribution, which further illustrates the effectiveness and advantages of using core facial action units that are closely related to infant pain to assess pain.
[0103] The above-described embodiments are only preferred embodiments of the present invention and are not intended to limit the scope of implementation of the present invention. Therefore, all changes made according to the shape and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. Infant pain recognition system based on facial action unit engagement, characterized by: include: An image processing module, used for loading the facial frame of the baby and pre-processing the facial frame to obtain a processed frame of the baby's face with the head cropped and at a frontal angle; The facial active region module is used to explore the facial regions that are active when the infant is in pain. It uses the processed frames obtained by the image processing module as input, fine-tunes the pain classification task on the pre-trained model, intercepts the gradient of the model and calculates the corresponding class activation map, thereby determining the facial regions that are active when the infant is in pain. A core facial action unit screening module is used to obtain the core facial action unit when the infant is in pain, and calculate the participation of different facial action units when the infant is in pain by defining the center of the facial action unit and combining it with the class activation map output by the facial active area module, and finally determine the core facial action unit when the infant is in pain through a screening experiment; wherein the facial action unit is a system for describing facial muscle movements, which decomposes facial expressions into facial muscle movements, i.e., facial action units, wherein the facial action unit that best represents the infant's expression of pain is the core facial action unit, and the facial action unit center is the center of the relevant area of each facial action unit, which is determined by the position of the facial muscle group related to the corresponding facial action unit; The infant pain intensity prediction module uses the intensity of the core facial action unit output by the core facial action unit screening module as input and the participation of the core facial action unit as a weight, and uses a multi-layer perceptron to detect the infant's pain intensity.
2. The infant pain recognition system based on facial action unit participation according to claim 1, characterized in that: The image processing module performs the following operations: First, load the JPG or PNG RGB file of the original image frame of the baby's face to obtain the image object, use a high-precision dual-branch face detector to crop the baby's face and obtain the facial coordinates, then calculate the inclination angle of the baby's face based on the obtained facial coordinates, and finally, rotate the cropped baby's face to the frontal angle based on the inclination angle, so as to obtain the facial action unit intensity and participation of the image frame in the subsequent steps.
3. The infant pain recognition system based on facial action unit participation according to claim 1, characterized in that: The facial active area module comprises the following steps: 3.1) Fine-tune the pain classification task on the pre-trained model. In this step, the pre-trained model used is ResNet-18, which consists of a residual convolution block with a residual structure and a fully connected layer. ResNet-18 uses a basic residual block, which contains two convolution layers and a corresponding residual structure. The output formula is as follows: F(x)=ReLU(W2·ReLU(W1·x+b1)+b2)+x H(x)=F(x)+x Where x is the input image of the model or the input of the previous layer, W1 and W2 are the weights of the two convolutional layers, b1 and b2 are the bias terms of the corresponding convolutional layers, ReLU is the activation function used by the convolutional layer, F(x) is the output of the convolutional layer, and H(x) is the output with the basic residual block; Replace the fully connected layer of the model, and replace the size of the fully connected layer with the corresponding pain classification level. The output formula is as follows: z=Wx+b In the formula, W is the weight matrix of the fully connected layer, x is the input of the previous layer, and z is the output of the fully connected layer. After obtaining the output of the fully connected layer, Softmax is used to obtain the predicted probability of each category, thereby predicting the pain intensity level of the infant. In training, the cross entropy loss function is used as the loss function of the model, and the formula is as follows: Where N is the number of infant image frames, C is the number of pain level categories, and y i,c is the true label of the cth category of the ith sample. If the sample belongs to category c, it is 1, otherwise it is 0; p i,c represents the probability that the model predicts that the i-th sample belongs to category c; log is the logarithmic function with base e; after calculating the loss, the model is trained using back propagation to adjust all parameters of the model, thereby completing the fine-tuning of the pre-trained model for the pain classification task; 3.2) Calculate the class activation map and determine the active areas of the infant's pain expression. In order to determine the activity of different facial areas of the infant in the pain classification task, the gradient class activation map is used to analyze the infant pain expression classification knowledge learned by the fine-tuned pre-trained model in the previous step; in this step, the gradient class activation map algorithm is used to calculate the gradient of the last convolutional layer of the pre-trained model, and the model's prediction is combined with the spatial position of the image to generate a class activation map to show in which areas the model contributes most to the pain classification results. The formula is as follows: In the formula, c is the category in the classification experiment, Represents the activation value of the feature map output by the last convolutional layer of ResNet-18 for category c at the coordinate (r, s) in channel k, where r is the horizontal coordinate of the width and s is the vertical coordinate of the height. represents the weight of the vertical coordinate j of the feature map in channel k for category c, L represents the total number of channels of the feature map, R k and S k are the width and height of the feature map in channel k, respectively, and ReLU is the activation function; the gradient class activation map back-propagates the gradient information, and then weightedly summarizes the response of each feature map according to the gradient information of the specific pain category to obtain the activation map corresponding to the pain category. Through this activation map, the active area of the infant's pain expression is determined.
4. The infant pain recognition system based on facial action unit engagement according to claim 1, characterized in that: The core facial action unit screening module includes the following steps: 4.1) Calculating the participation of different facial action units. In this step, after obtaining the active area of the infant's pain expression in the facial active area module, the participation of different facial action units in the infant's pain expression is further determined by defining the center of the facial action unit. The center of the facial action unit is the center of the area related to each facial action unit, which is determined by the position of the facial muscle group related to the corresponding facial action unit; The engagement of the following facial action units was calculated: raising inner eyebrows, raising outer eyebrows, lowering eyebrows, lifting cheeks, tightening eyelids, wrinkling nose, lifting upper lip, pulling up upper lip corners, stretching lips, parting lips, opening mouth wide, and squinting eyes, which are facial action units highly related to pain expressions; According to the order of the above facial action units, the centers of the facial action units are defined in sequence according to the following rules: 1 / 2 scaling distance above the inner eyebrow, 1 / 3 scaling distance above the outer eyebrow, 1 / 3 scaling distance below the center of the eyebrow, one scaling distance below the bottom of the eye, the center of the eye, the nose wing, the center of the upper lip, the edge of the lip, one scaling distance below the edge of the lip, the center of the lip, the center of the mouth, and the center of the eye; among them, due to differences between individuals, the distance between each person's eyes is defined as the scaling distance to remove the interference caused by individual differences, and the relevant area corresponding to the facial action unit uses the center of the facial action unit as the center point and expands to a size of 10×10 in all directions; According to the class activation map output obtained by the facial active area module, the average pixel value of each facial action unit related area is calculated to evaluate the involvement of different facial action units. The pain image correctly classified in the facial active area module is selected as input, and the involvement of the facial action unit is calculated according to the following formula: … Where AU1 represents the facial action unit No. 1, i.e., raising the inner eyebrow; AU1E represents the participation of the facial action unit; M represents the number of correctly classified baby image frames; Area represents the size of the relevant area of the facial action unit, i.e., 10×10. They represent the rightmost width value, leftmost width value, lowest height value, and highest height value corresponding to the relevant area of the first facial action unit in the class activation map of the i-th image, that is, the range corresponding to the relevant area; AU2 represents facial action unit No. 2, that is, raising the outer eyebrow, and AU2E represents the participation degree of the facial action unit. The rightmost width, leftmost width, lowest height, and highest height values of the relevant area of the second facial action unit in the class activation map of the i-th image are represented respectively; AU 43 Represents facial action unit 43, which means eyes narrowed into slits, AU 43 E represents the participation of the facial action unit. The rightmost width value, leftmost width value, lowest height value, and highest height value corresponding to the relevant area of the forty-third facial action unit in the class activation map of the i-th image are represented respectively; CA i represents the pixel value in the output of the i-th class activation map, (r, s) is the coordinate of the corresponding facial action unit related area, r is the horizontal coordinate of the width, and s is the vertical coordinate of the height; 4.2) Screening the core facial action units of infant pain expression. In this step, the facial action units are screened according to the calculated engagement levels of different infant pain expression facial action units. Different pre-trained models, including DenseNet, GoogLeNet, ResNet18, ResNet34, VGG11 and VGG16, are used to perform fine-tuning tasks for pain classification. The engagement levels of different facial action units are calculated according to the above step 4.1), and the facial action units are sorted according to the engagement levels. Finally, the six facial action units of opening the mouth wide, parting the lips, lifting the upper lip, wrinkling the nose, pulling up the upper lip corners and lifting the cheeks are determined as the core facial action units of infant pain expression.
5. The infant pain recognition system based on facial action unit engagement according to claim 1, characterized in that: The infant pain intensity prediction module comprises the following steps: 1) Using the strength of core facial action units as input, where the strength of facial action units is evaluated using the OpenFace detection tool; 2) Using the participation of the core facial action unit calculated by the core facial action unit screening module as the weight, the core facial action unit strength and the participation are fused element-by-element multiplication at the input layer of the multilayer perceptron; 3) A multi-layer perceptron with three layers is used to evaluate the pain intensity of infants. The first layer is the input layer, the size of which is the number of core facial action units, the second layer is a hidden layer of size 3, and the third layer is the output layer to predict the pain intensity of infants.
Citation Information
Patent Citations
Newborn pain degree assessment method and system based on facial expression recognition
CN108388890A
Neonatal pain identificaiton from neonatal facial expressions
US20210030354A1
