Face pain recognition method and system based on lightweight optimization target detector
Through the facial pain recognition method based on lightweight optimized object detector, the problem of traditional pain assessment methods being susceptible to environmental influences and difficulty in capturing facial expression changes is solved, and pain with high accuracy, rapid response and efficient resource utilization is achieved Management effect.
Patent Information
- Application Number
- CN202411510756.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-28
- Publication Date
- 2025-02-18
AI Technical Summary
Traditional pain assessment methods are susceptible to the environment, it is difficult to capture facial expression changes, low accuracy and calculation efficiency of facial pain recognition, and poor real-time performance.
A face pain recognition method based on lightweight optimized object detector is proposed. By obtaining face pain video information, preprocessing is performed to obtain training data sets, replacing and improving the backbone and attention module of the object detector model, training The optimal object detector model is obtained to identify face pain expressions.
While maintaining high accuracy, it achieves rapid response and efficient resource utilization, improves the accuracy of pain management, reduces the work burden of medical staff, and improves the efficiency of medical services.
Smart Images

Figure CN119479034A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of machine vision applications, and in particular to a facial pain recognition method and system based on a lightweight optimized target detector. Background Art
[0002] Pain management is a crucial aspect in the field of human health and well-being. Accurately identifying and assessing pain levels has an important impact on medical diagnosis, treatment planning, and the patient's recovery process. However, traditional pain assessment methods mainly rely on self-reporting by patients, which may not be accurate or feasible in some cases. For example, infants, patients with Alzheimer's disease, or people with speech disorders may not be able to effectively express their pain feelings. To overcome these challenges, automated facial pain recognition technology has emerged. By analyzing facial expressions, automated systems can objectively assess pain levels and provide more reliable data support. This can not only improve the accuracy of pain management, but also reduce the workload of medical staff and improve the efficiency of medical services. Although facial pain recognition technology has great potential, it still faces many challenges in practical applications. First, the changes in facial expressions are often very subtle, and traditional object detection models may have difficulty capturing these details. Second, changes in lighting conditions can also affect the recognition performance of the model, resulting in unstable results. In addition, real-time and computational efficiency are also important factors to consider, especially in resource-constrained environments. To address these challenges, a facial pain recognition method based on a lightweight optimized object detector was proposed, which achieves fast response and efficient resource utilization while maintaining high accuracy to meet the needs of practical applications. Summary of the invention
[0003] In order to solve the problems that traditional pain assessment methods are easily affected by the environment, it is difficult to capture facial expression changes, the accuracy and computational efficiency of facial pain recognition are low, and the real-time performance is poor, etc. This disclosure proposes a facial pain recognition method based on a lightweight optimized target detector to solve the above problems.
[0004] According to one aspect of the present disclosure, a method for facial pain recognition based on a lightweight optimized target detector is provided, comprising:
[0005] S10, obtaining video information of human face pain, and preprocessing the video information of human face pain to obtain a training data set;
[0006] S20, inputting the training data set into the target detector model, replacing the backbone module of the target detector model, and performing improved normalization processing on the attention module of the target detector model to obtain an optimized target detector model;
[0007] S30, training the optimized target detector model using the training data set to obtain an optimal target detector model;
[0008] S40, using the obtained optimal target detector model to recognize facial pain expressions.
[0009] Preferably, obtaining the facial pain video information, and preprocessing the facial pain video information to obtain a training data set, including:
[0010] Get a video of the experimenter;
[0011] Split the captured video into video clips and extract pictures from the video clips;
[0012] According to the pain degree measurement standard, three types of expression images, calm, painful and extremely painful, were selected from the pictures. The pain degree measurement standard is:
[0013] PSPI=AU4+max(AU6,AU7)max(AU9,AU10)+AU43
[0014] Among them, AU4 means lowering the eyebrows and bringing them together, AU6 and AU7 mean tightening the eye sockets, AU9 and AU10 mean contracting the levator muscles, and AU43 means closing the eyes.
[0015] The screened expression images are classified and labeled according to the degree of pain to obtain a training data set.
[0016] Preferably, the backbone module of the target detector model is replaced, including:
[0017] A cloning module is used to replace the backbone module of the target detector model. The input channel in the cloning module is divided into two parts. The backbone network in the cloning module accepts half of the input channels, processes them using convolution kernels, and generates a backbone feature map; the cloning network in the cloning module accepts the other half of the input channels and outputs the corresponding clone feature map. The obtained intrinsic feature map and the clone feature map are spliced to obtain the final result output.
[0018] Preferably, the backbone network in the cloning module accepts half of the input channels, processes them using convolution kernels, and generates a backbone feature map, which is expressed as:
[0019] Y=X*a+b
[0020] In the formula, Y represents the output feature map, X represents the input data, which is the feature or original pixel value of the previous layer, a represents the filter, and b represents the bias term, which is used to adjust the overall scale of the convolution result;
[0021] The clone network in the clone module accepts the other half of the input channels and outputs the corresponding feature map, expressed as:
[0022]
[0023] In the formula, y i is the i-th intrinsic feature map in Y, λ i,j Represents the j-th ghost feature map y ij The j-th linear operation of .
[0024] Preferably, the attention module of the target detector model is improved and normalized, including:
[0025] The attention module is improved and normalized using the scaling factor of batch normalization, which is expressed as:
[0026]
[0027] In the formula, B out is the output data after batch normalization, B in is the original input data, ω B and σ B are the mean and standard deviation of the mini-batch B, ρ and τ are the trainable affine transformation scale and offset parameters, and θ is a learning parameter that is dynamically updated with model training;
[0028] The attention module includes a channel attention submodule and a spatial attention submodule. The variance of the channel attention submodule is measured using a batch normalized scaling factor, expressed as:
[0029] M c =σ(W δ (BN(F1)))
[0030] Where M c represents the output feature, σ is the sigmoid function, represents the scale factor of each channel in the channel attention submodule, and W δ is the weight of the channel attention submodule, F1 is the input feature of the channel attention submodule;
[0031] In the spatial attention submodule, the attention module applies the scaling factor of batch normalization to the spatial dimension, expressed as:
[0032] M s =σ(W μ (BN(F2)))
[0033] Where M s represents the output feature, μ is the scaling factor of each channel in the spatial attention submodule, and W μ is the weight of the spatial attention submodule, F2 is the input feature of the spatial attention submodule.
[0034] Preferably, the attention module of the target detector model is improved and normalized, and also includes applying a weight sparsity penalty to suppress the contribution of the weight of the attention module, which is expressed as:
[0035]
[0036] Where Loss represents the loss function in the attention mechanism, x represents input, y represents output, W represents weight, l() represents loss function, g() is l1 norm penalty function, and p is the penalty for balancing g(δ) and g(μ).
[0037] Preferably, the optimized target detector model is trained using the training data set to obtain the optimal target detector model, which is expressed as:
[0038] Adaptively learn the positive sample threshold parameter and the negative sample threshold parameter γ, and perform non-maximum suppression training on the optimized target detector model through a consistent dual allocation strategy to obtain the optimal target detector model, which is expressed as:
[0039]
[0040] Where f(x) is the output of Slide Loss.
[0041] According to one aspect of the present disclosure, a facial pain recognition system based on a lightweight optimized target detector is provided, comprising:
[0042] A training data set acquisition module is used to acquire video information of human face pain and to obtain a training data set after preprocessing the video information of human face pain;
[0043] A target detector model optimization module, which inputs the training data set into the target detector model, replaces the backbone module of the target detector model, and performs improved normalization processing on the attention module of the target detector model to obtain an optimized target detector model;
[0044] The target detector model training module uses the training data set to train the optimized target detector model to obtain the optimal target detector model;
[0045] The facial pain expression recognition module uses the obtained optimal target detector model to recognize facial pain expressions.
[0046] According to one aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to: execute the above-mentioned facial pain recognition method based on a lightweight optimized target detector.
[0047] According to one aspect of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the above-mentioned facial pain recognition method based on a lightweight optimized target detector is implemented.
[0048] Compared with the prior art, the beneficial effects of the present disclosure are:
[0049] 1) This paper proposes a facial pain recognition method based on a lightweight optimized target detector. By analyzing facial expressions, the degree of pain can be objectively evaluated, which not only improves the accuracy of pain management, but also reduces the workload of medical staff and improves the efficiency of medical services.
[0050] 2) The present invention introduces an improved normalized attention module to achieve lightweight and efficient detection. By capturing subtle changes in facial expressions, the computational efficiency and performance of the model are improved, achieving rapid response and efficient resource utilization while maintaining a high accuracy rate.
[0051] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
[0052] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present disclosure and are used to illustrate the technical solutions of the present disclosure together with the specification.
[0054] Figure 1 A flow chart of a method for facial pain recognition based on a lightweight optimized target detector is shown;
[0055] Figure 2 The working principle diagram of the Ghost module in the embodiment of the present disclosure is shown;
[0056] Figure 3 A working principle diagram of the channel attention submodule in an embodiment of the present disclosure is shown;
[0057] Figure 4 A working principle diagram of the spatial attention submodule in an embodiment of the present disclosure is shown;
[0058] Figure 5 The improved structure diagram of YOLOv10 in the embodiment of the present disclosure is shown;
[0059] Figure 6 The structural block diagram of the facial pain recognition system based on lightweight optimized object detector is shown. DETAILED DESCRIPTION
[0060] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the accompanying drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the accompanying drawings, the drawings are not necessarily drawn to scale unless otherwise specified.
[0061] The word “exemplary” is used exclusively herein to mean “serving as an example, example, or illustration.” Any embodiment described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments.
[0062] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0063] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0064] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0065] Example 1
[0066] Based on the above ideas, the present invention proposes a facial pain recognition method based on a lightweight optimized target detector. Figure 1 A flowchart of a method for facial pain recognition based on a lightweight optimized target detector is shown. The method comprises:
[0067] S10, obtaining video information of human face pain, and preprocessing the video information of human face pain to obtain a training data set;
[0068] S20, inputting the training data set into the target detector model, replacing the backbone module of the target detector model, and performing improved normalization processing on the attention module of the target detector model to obtain an optimized target detector model;
[0069] S30, training the optimized target detector model using the training data set to obtain an optimal target detector model;
[0070] S40, using the obtained optimal target detector model to recognize facial pain expressions.
[0071] The present disclosure provides a method for facial pain recognition based on a lightweight optimized target detector, comprising the following steps:
[0072] S10, obtaining video information of human face pain, and preprocessing the video information of human face pain to obtain a training data set.
[0073] In this embodiment, facial pain video information is obtained, and the facial pain video information is preprocessed to obtain a training data set, including:
[0074] The video of the experimenter was obtained and recorded using a high-definition camera. Each video segment was 1 minute long, and a total of 100 videos were collected.
[0075] The captured video was divided into video segments, and pictures were extracted from the video segments. Each level of pain video collected was divided into 10 5s video segments (excluding the first 10s), and 2 frames of pictures were extracted from the video per second. One video segment contained 10 pictures. Each level of pain video could be divided into 10 video sequences and 100 pictures.
[0076] According to the pain degree measurement standard, three types of expression images, calm, painful and extremely painful, were selected from the pictures. The pain degree measurement standard is:
[0077] PSPI=AU4+max(AU6, AU7)max(AU9, AU10)+AU43
[0078] Among them, AU4 means lowering the eyebrows and bringing them together, AU6 and AU7 mean tightening the eye sockets, AU9 and AU10 mean contracting the levator muscles, and AU43 means closing the eyes.
[0079] The screened expression images were classified and divided into training set, validation set and test set in a ratio of 7:2:1. The training set and validation set were annotated in YOLO format using the labelimg tool according to the degree of pain to obtain the training data set.
[0080] S20. Input the training data set into the target detector model, replace the backbone module of the target detector model, improve and normalize the attention module of the target detector model, and obtain an optimized target detector model.
[0081] In this embodiment, the backbone module of the target detector model is replaced, including: using a clone module to replace the backbone module of the target detector model, the input channel in the clone module is divided into two parts, the backbone network in the clone module accepts half of the input channels, uses a convolution kernel to process, and generates a backbone feature map; the clone network in the clone module accepts the other half of the input channels and outputs a corresponding clone feature map, and the obtained intrinsic feature map and the clone feature map are spliced to obtain the final result output.
[0082] S201. Considering that real-time performance is very important in face pain recognition applications, fast response is the key for both medical monitoring and emotional computing. Here, the convolution method of the YOLOv10 backbone is improved, and the convolution of the backbone is replaced to improve performance while reducing computational costs. Specifically, the Clone (Ghost) module is used to replace the CIB module in C2fCIB, and the required feature maps are generated by simple and cheap linear changes, without the need to use redundant filters, so as to improve the computational efficiency of the network.
[0083] S202. In the cloning module, the input channel is divided into two parts. The backbone network manages one input channel and processes it using a 3×3 convolution kernel, while the Ghost network processes the other input channel. The backbone is responsible for performing convolution operations and generating a backbone feature map. The backbone network in the cloning module accepts half of the input channels, processes them using convolution kernels, and generates a backbone feature map, which is expressed as:
[0084] Y=X*a+b
[0085] In the formula, Y represents the output feature map, X represents the input data, which is the feature or original pixel value of the previous layer, a represents the filter (also called convolution kernel or weight kernel), and b represents the bias term, which is used to adjust the overall scale of the convolution result.
[0086] S203, the clone network in the clone module accepts the other half of the input channels and outputs the corresponding feature map, which is expressed as:
[0087]
[0088] In the formula, y i is the i-th intrinsic feature map in Y, λ i,j Represents the j-th ghost feature map y ij The jth linear operation of , that is, y iCan have one or more ghosting feature maps
[0089] S204: Finally, the intrinsic feature map obtained in step S202 and the Ghost feature map obtained in step S203 are spliced (identity connection) to obtain the final result Output. The working principle diagram of the Ghost module is as follows: Figure 2 shown.
[0090] Furthermore, the attention module (NAM) of the object detector model is improved and normalized to enhance the characteristics of the feature map.
[0091] S205. The channel and spatial attention submodules are redesigned based on the CBAM module. Then, a NAM module is embedded at the end of each network block. For the residual network, it is embedded at the end of the residual structure. The attention mechanism is improved by utilizing the contribution factors of the weights.
[0092] The attention module of the target detector model is improved and normalized, including: using a batch normalization scaling factor to improve the normalization of the attention module, the scaling factor uses the standard deviation to represent the importance of the weight, so as to avoid adding fully connected layers and convolutional layers, thereby making the attention mechanism more efficient and lightweight. The scaling factor is expressed as:
[0093]
[0094] In the formula, B out is the output data after batch normalization, B in is the original input data, ω B and σ B are the mean and standard deviation of the mini-batch B, ρ and τ are the trainable affine transformation scale and offset parameters, and θ is a learning parameter that is dynamically updated with model training;
[0095] S206, the attention module includes a channel attention submodule and a spatial attention submodule, and the variance of the channel attention submodule is measured using a scaling factor of batch normalization (BN), which helps to identify and suppress less significant channel features, thereby improving the computational efficiency and performance of the model, expressed as:
[0096] M c =σ(W δ (BN(F1)))
[0097] Where M c represents the output feature, σ is the sigmoid function, represents the scale factor of each channel in the channel attention submodule, and W δ is the weight of the channel attention submodule, F1 is the input feature of the channel attention submodule. The working principle diagram of the channel attention submodule is as follows Figure 3 shown.
[0098] S207. In the spatial attention submodule, the attention module applies the scaling factor of batch normalization to the spatial dimension to measure the importance of pixels. This method is called pixel normalization. It helps to identify and suppress unimportant areas in the image, further optimizing the performance of the model, expressed as:
[0099] M s =σ(W μ (BN(F2)))
[0100] Where M s represents the output feature, μ is the scaling factor of each channel in the spatial attention submodule, and W μ is the weight of the spatial attention submodule, F2 is the input feature of the spatial attention submodule. The working principle diagram of the spatial attention submodule is as follows Figure 4 shown.
[0101] S208, performing improved normalization processing on the attention module of the target detector model, and also applying weight sparsity penalty to suppress the contribution of the weight of the attention module, thereby improving computational efficiency while maintaining similar performance. This method helps the model focus more on important features when facing complex tasks, improves the accuracy and efficiency of the model, and is expressed as:
[0102]
[0103] Where Loss represents the loss function in the attention mechanism, x represents input, y represents output, W represents weight, l() represents loss function, g() is l1 norm penalty function, and p is the penalty for balancing g(δ) and g(μ).
[0104] S30. Train the optimized target detector model using the training data set to obtain the optimal target detector model.
[0105] In this embodiment, the optimized target detector model is trained using the training data set to obtain the optimal target detector model in the following specific steps.
[0106] S301, SlideLoss is introduced to solve the problem of unbalanced pain expressions of testers and improve the detection performance of small targets occluded by expression changes. Adaptively learn the positive sample threshold parameter and the negative sample threshold parameter γ, and perform non-maximum suppression training on the optimized target detector model through a consistent dual allocation strategy to obtain the optimal target detector model. Setting a higher weight near γ will increase the relative loss of difficult-to-classify examples, thereby focusing more attention on difficult-to-classify erroneous examples, expressed as:
[0107]
[0108] Where f(x) is the output of Slide Loss.
[0109] S302, NMS-free (non-maximum suppression) training is performed through a consistent dual assignment strategy, which significantly reduces inference latency. This strategy combines one-to-many and one-to-one label assignments, eliminating the need for NMS during inference. The improved structure of YOLOv10 is shown in the figure Figure 5 shown.
[0110] S40, using the obtained optimal target detector model to recognize facial pain expressions.
[0111] In this embodiment, the trained YOLOv10 network is applied to the face pain picture or video to be detected to perform detection and form a target detection frame.
[0112] The present embodiment provides a method for facial pain recognition based on lightweight optimized YOLOv10, including: using a high-definition camera to obtain facial pain video information, and using it as a data set for training a YOLOv10 model after preprocessing; inputting the processed data set into the YOLOv10 model, using Ghost to replace the convolution method of the YOLOv10 backbone to improve performance while reducing computing costs; introducing an improved normalized attention module to achieve lightweight and efficient detection; training and testing the improved YOLOv10 to obtain a trained YOLOv10 with the advantages of high accuracy, high efficiency, real-time, robustness, etc.
[0113] Example 2
[0114] As another aspect of the embodiment of the present disclosure, a facial pain recognition system 100 based on a lightweight optimized target detector is also provided. Figure 6 As shown, including:
[0115] The training data set acquisition module 1 acquires video information of human face pain and pre-processes the video information of human face pain to obtain a training data set;
[0116] The target detector model optimization module 2 inputs the training data set into the target detector model, replaces the backbone module of the target detector model, and performs improved normalization processing on the attention module of the target detector model to obtain an optimized target detector model;
[0117] The target detector model training module 3 uses the training data set to train the optimized target detector model to obtain the optimal target detector model;
[0118] The facial pain expression recognition module 4 uses the obtained optimal target detector model to recognize the facial pain expression.
[0119] In the absence of any contradiction, the above modules in the system of the embodiment of the present disclosure can implement any implementation of the above method.
[0120] Based on the description of the above embodiments, it can be seen that the embodiments of the present disclosure can achieve the following technical effects:
[0121] 1) This paper proposes a facial pain recognition method based on a lightweight optimized target detector. By analyzing facial expressions, the degree of pain can be objectively evaluated, which not only improves the accuracy of pain management, but also reduces the workload of medical staff and improves the efficiency of medical services.
[0122] 2) The present invention introduces an improved normalized attention module to achieve lightweight and efficient detection. By capturing subtle changes in facial expressions, the computational efficiency and performance of the model are improved, achieving rapid response and efficient resource utilization while maintaining a high accuracy rate.
[0123] The embodiment of the present disclosure also proposes an electronic device, comprising: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to implement the above-mentioned method for facial pain recognition based on a lightweight optimized target detector. The electronic device can be provided as a terminal, a server, or other forms of devices.
[0124] The present disclosure also provides a computer-readable storage medium on which computer program instructions are stored, and when the computer program instructions are executed by a processor, the above-mentioned method for facial pain recognition based on a lightweight optimized target detector is implemented. The computer-readable storage medium may be a non-volatile computer-readable storage medium.
[0125] Those skilled in the art will understand that in the above-mentioned facial pain recognition method and system based on lightweight optimized target detector in the specific implementation mode, the writing order of each step does not mean a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0126] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the specified logical function. In some alternative implementations, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or action, or can be implemented with a combination of special hardware and computer instructions.
[0127] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or technical improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A facial pain recognition method based on a lightweight optimized target detector, characterized in that: The steps include: S10, obtaining video information of human face pain, and preprocessing the video information of human face pain to obtain a training data set; S20, inputting the training data set into the target detector model, replacing the backbone module of the target detector model, and performing improved normalization processing on the attention module of the target detector model to obtain an optimized target detector model; S30, training the optimized target detector model using the training data set to obtain an optimal target detector model; S40, using the obtained optimal target detector model to recognize facial pain expressions.
2. The method according to claim 1, characterized in that Obtain the video information of human face pain, and pre-process the video information of human face pain to obtain a training data set, including: Get a video of the experimenter; Split the captured video into video clips and extract pictures from the video clips; According to the pain degree measurement standard, three types of expression images, calm, painful and extremely painful, were selected from the pictures. The pain degree measurement standard is: PSPI=AU4+max(AU6, AU7)max(AU9, AU10)+AU43 Among them, AU4 means lowering the eyebrows and bringing them together, AU6 and AU7 mean tightening the eye sockets, AU9 and AU10 mean contracting the levator muscles, and AU43 means closing the eyes. The screened expression images are classified and labeled according to the degree of pain to obtain a training data set.
3. The method according to claim 1, characterized in that Replace the backbone modules of the target detector model, including: A cloning module is used to replace the backbone module of the target detector model. The input channel in the cloning module is divided into two parts. The backbone network in the cloning module accepts half of the input channels, processes them using convolution kernels, and generates a backbone feature map; the cloning network in the cloning module accepts the other half of the input channels and outputs the corresponding clone feature map. The obtained intrinsic feature map and the clone feature map are spliced to obtain the final result output.
4. The method according to claim 3, characterized in that The backbone network in the cloning module accepts half of the input channels, processes them using convolution kernels, and generates a backbone feature map, which is expressed as: Y=X*a+b In the formula, Y represents the output feature map, X represents the input data, which is the feature or original pixel value of the previous layer, a represents the filter, and b represents the bias term, which is used to adjust the overall scale of the convolution result; The clone network in the clone module accepts the other half of the input channels and outputs the corresponding feature map, expressed as: In the formula, y i is the i-th intrinsic feature map in Y, λ i,j Represents the j-th ghost feature map y ij The j-th linear operation of .
5. The method according to claim 1, characterized in that Improved normalization of the attention module of the target detector model, including: The attention module is improved and normalized using the scaling factor of batch normalization, which is expressed as: In the formula, B out is the output data after batch normalization, B in is the original input data, ω B and σ B are the mean and standard deviation of the mini-batch B, ρ and τ are the trainable affine transformation scale and offset parameters, and θ is a learning parameter that is dynamically updated with model training; The attention module includes a channel attention submodule and a spatial attention submodule. The variance of the channel attention submodule is measured using a batch normalized scaling factor, expressed as: M c =σ(W δ (BN(F1))) Where M c represents the output feature, σ is the sigmoid function, represents the scaling factor of each channel in the channel attention submodule, and W δ is the weight of the channel attention submodule, F1 is the input feature of the channel attention submodule; In the spatial attention submodule, the attention module applies the scaling factor of batch normalization to the spatial dimension, expressed as: M s =σ(W μ ((BN(F2))) Where M s represents the output feature, μ is the scaling factor of each channel in the spatial attention submodule, and W μ is the weight of the spatial attention submodule, F2 is the input feature of the spatial attention submodule.
6. The method according to claim 5, characterized in that The improved normalization of the attention module of the target detector model also includes applying a weight sparsity penalty to suppress the contribution of the weight of the attention module, expressed as: Where Loss represents the loss function in the attention mechanism, x represents input, y represents output, W represents weight, l() represents loss function, g() is l1 norm penalty function, and p is the penalty for balancing g(δ) and g(μ).
7. The method according to claim 1, characterized in that The optimized target detector model is trained using the training data set to obtain the optimal target detector model, which is expressed as: Adaptively learn the positive sample threshold parameter and the negative sample threshold parameter γ, and perform non-maximum suppression training on the optimized target detector model through a consistent dual allocation strategy to obtain the optimal target detector model, which is expressed as: Where f(x) is the output of Slide Loss.
8. A facial pain recognition system based on a lightweight optimized target detector, characterized in that: include: A training data set acquisition module is used to acquire video information of human face pain and to obtain a training data set after preprocessing the video information of human face pain; A target detector model optimization module, which inputs the training data set into the target detector model, replaces the backbone module of the target detector model, and performs improved normalization processing on the attention module of the target detector model to obtain an optimized target detector model; The target detector model training module uses the training data set to train the optimized target detector model to obtain the optimal target detector model; The facial pain expression recognition module uses the obtained optimal target detector model to recognize facial pain expressions.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for facial pain recognition based on a lightweight optimized target detector according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for facial pain recognition based on a lightweight optimized target detector according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Automatic valve control mechanism for tractor mounted loaders
AU430014B
Grating
AU430078B