Pain measurement method and system based on facial image recognition

By dynamically adjusting the gain and image enhancement processing technology of the camera sensor, combined with the pain expression recognition of the deep learning model, the accuracy and reliability of pain measurement methods in different environments are solved, and efficient and reliable pain assessment and feedback are achieved.

CN119632506AActive Publication Date: 2025-03-18HEALTH HOPE (BEIJING) TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411772211.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-18
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

Existing pain measurement methods based on facial image recognition are affected under different ambient lighting conditions. The quality of image acquisition and recognition accuracy of deep learning models are difficult to train and optimize, and a large amount of labeled data and model tuning is required.

Method used

By dynamically adjusting the gain signal value of the camera sensor, adapting to the lighting conditions of different environments, and improving the image acquisition quality. At the same time, image enhancement processing technology is used for pre-processing, and pain expression recognition is used with a well-trained and tested deep learning model.

Benefits of technology

It improves the accuracy and reliability of pain assessment, realizes high-quality pain expression recognition in different environments, and promptly feedback to medical staff for corresponding measures.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119632506A_ABST
    Figure CN119632506A_ABST
Patent Text Reader

Abstract

The invention provides a pain measurement method and system based on facial image recognition. The pain measurement method based on facial image recognition comprises the following steps: dynamically adjusting a gain signal value of a camera sensor, and collecting video data corresponding to a target area in real time through the camera sensor arranged in the target area; performing image enhancement processing on the video data to obtain image data after image enhancement processing; calling a trained and tested deep learning model from a database, and performing pain expression recognition on the image data subjected to image enhancement processing by using the deep learning model to obtain a pain judgment result; and when the pain judgment result shows that the pain target appears in the target area, marking the image data with the pain target, and sending the image data to a mobile monitoring terminal. The system comprises modules corresponding to the steps of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention proposes a pain measurement method and system based on facial image recognition, belonging to the technical field of pain detection. Background Art

[0002] As a subjective feeling, accurate assessment of pain is crucial for medical diagnosis, formulation of treatment plans and patient care. Traditional pain assessment methods mainly rely on the subjective description of patients and clinical observation of medical staff, but these methods have many limitations. For example, patients may not be able to accurately express their pain feelings due to language barriers, unconsciousness or limited cognitive ability; and medical staff may be affected by personal experience, distraction and other factors when conducting pain assessment, resulting in subjective and inconsistent assessment results.

[0003] With the rapid development of computer vision and artificial intelligence technology, pain measurement methods based on facial image recognition have gradually shown their great potential in the field of pain assessment. This type of method can objectively and real-timely reflect the patient's pain state by analyzing the patient's facial expression characteristics, thereby improving the accuracy and reliability of pain assessment.

[0004] However, the existing pain measurement methods based on facial image recognition still face some challenges. First, the lighting conditions in different environments, camera performance, and the diversity of patients' facial features may affect the quality of image acquisition and the accuracy of facial recognition. Secondly, the complexity of pain expressions makes the training and optimization of deep learning models particularly difficult, requiring a large amount of labeled data and fine model tuning. In addition, how to process and analyze image data in real time and efficiently, and how to communicate the recognition results to relevant personnel in a timely manner, are also problems that need to be solved urgently in current technology.

[0005] In response to the above challenges, the present invention proposes a pain measurement method based on facial image recognition, which dynamically adjusts the gain signal value of the camera sensor to adapt to the lighting conditions in different environments, thereby improving the quality of image acquisition. At the same time, the collected video data is pre-processed using image enhancement processing technology to further improve the clarity and contrast of the image, providing high-quality input data for subsequent pain expression recognition. In addition, the present invention also uses a fully trained and tested deep learning model for pain expression recognition, which can accurately identify a variety of pain expression features, thereby improving the accuracy of pain assessment. Finally, the present invention realizes real-time feedback of pain recognition results through a mobile monitoring terminal, allowing medical staff to respond quickly and take appropriate intervention measures. Summary of the invention

[0006] The present invention provides a pain measurement method and system based on facial image recognition to solve the problems in the prior art: A pain measurement method based on facial image recognition, the pain measurement method based on facial image recognition comprising: Dynamically adjust the gain signal value of the camera sensor, and collect video data corresponding to the target area in real time through the camera sensor deployed in the target area; Performing image enhancement processing on the video data to obtain image data after the image enhancement processing; Retrieving a deep learning model that has been trained and tested from a database, and using the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result; When the pain determination result indicates that a pain target appears in the target area, the image data with the pain target is marked and the image data is sent to the mobile monitoring terminal.

[0007] Furthermore, the gain signal value of the camera sensor is dynamically adjusted, and the video data corresponding to the target area is collected in real time by the camera sensor arranged in the target area, including: Real-time monitoring of light intensity in the target area; Dynamically adjusting the gain signal value of the camera sensor according to the light intensity in the monitoring target area to obtain a target gain signal value; Controlling the camera sensor to adjust the current gain according to the target gain signal value, and obtaining the camera sensor after gain adjustment; The gain-adjusted camera sensors deployed in the target area are controlled to collect video data corresponding to the target area in real time.

[0008] Furthermore, dynamically adjusting the gain signal value of the camera sensor according to the light intensity in the monitoring target area to obtain the target gain signal value includes: Extract the light intensity in the current target area; Comparing the light intensity in the current target area with a preset first light intensity threshold and a second light intensity threshold; When the light intensity in the current target area is lower than a preset first light intensity threshold, but not lower than a preset second light intensity threshold, a target gain signal value is obtained by using a first gain adjustment strategy; When the light intensity in the current target area is lower than a preset second light intensity threshold, the second gain adjustment strategy is used to obtain a target gain signal value.

[0009] Furthermore, the first gain adjustment strategy is as follows: Extract the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area; Extracting a first theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the first light intensity threshold, and a second theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the second light intensity threshold; Compare the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with the first theoretical signal-to-noise ratio to obtain a first signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the first theoretical signal-to-noise ratio; Compare the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with the second theoretical signal-to-noise ratio to obtain a second signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the second theoretical signal-to-noise ratio; Obtaining a first gain adjustment coefficient using the first signal-to-noise ratio difference and the second signal-to-noise ratio difference; The first gain adjustment coefficient is obtained by the following formula: Among them, K 01 represents the first gain adjustment coefficient; β0 represents the second enhancement adjustment factor, and the value range of the second enhancement adjustment factor is 1.28-2.81; S c01 represents the first signal-to-noise ratio difference; S c02 represents the second signal-to-noise ratio difference; k represents the light intensity change rate corresponding to the current target area; S b Indicates the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target area; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I b Indicates the standard deviation of light intensity variation in the current target area; f 01 represents a first gain adjustment factor, and the first gain adjustment factor is obtained by the following formula: Among them, f 01 represents the first gain adjustment factor; α0 represents the first enhancement adjustment factor, and the value range of the first enhancement adjustment factor is 0.62-1.19; ISO represents the sensitivity of the camera sensor; I 01 Represents the first light intensity threshold; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; Ir Indicates the maximum light change amplitude in the current target area; Retrieve the gain value of the current camera sensor; Obtaining a target gain signal value by using the first gain adjustment coefficient in combination with a gain value of a current camera sensor; The target gain signal value is obtained by the following formula: Among them, X 01 represents the target gain signal value obtained by the first gain adjustment coefficient; K 01 represents the first gain adjustment coefficient; X d Indicates the gain value of the current camera sensor.

[0010] Furthermore, the second gain adjustment strategy is as follows: Extract the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area; Compare the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with a preset signal-to-noise ratio reference value to obtain a signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the preset signal-to-noise ratio reference value; Obtaining a second gain adjustment coefficient using a signal-to-noise ratio difference between a signal-to-noise ratio of frame image data of video data acquired by a camera sensor under the light intensity in the current target area and a preset signal-to-noise ratio reference value; The second gain adjustment coefficient is obtained by the following formula: Among them, K 02 represents the second gain adjustment coefficient; β0 represents the second enhancement adjustment factor, and the value range of the second enhancement adjustment factor is 1.28-2.81; S c represents the difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the preset signal-to-noise ratio reference value; k represents the rate of change of the light intensity corresponding to the current target area; S b Indicates the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target area; f 02 represents a second gain adjustment factor, and the second gain adjustment factor is obtained by the following formula: Among them, f 02represents the second gain adjustment factor; α0 represents the first enhancement adjustment factor, and the value range of the first enhancement adjustment factor is 0.62-1.19; I p Indicates the average light intensity in the target area; ISO indicates the sensitivity of the camera sensor; I 01 Represents the first light intensity threshold; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I r Indicates the maximum light change amplitude in the current target area; Retrieve the gain value of the current camera sensor; Obtaining a target gain signal value by using the second gain adjustment coefficient in combination with a gain value of a current camera sensor; The target gain signal value is obtained by the following formula: Among them, X 02 represents the target gain signal value obtained by the second gain adjustment coefficient; K 02 represents the second gain adjustment coefficient; X d Indicates the gain value of the current camera sensor.

[0011] Further, performing image enhancement processing on the video data to obtain image data after image enhancement processing includes: Performing frame processing on the video data to obtain frame image data corresponding to the video data; Extracting the image area occupied by the face of a person in the frame image data; Extracting a signal-to-noise ratio value of the frame image data; The sliding local window is set according to the image area occupied by the face of the person and the signal-to-noise ratio value of the frame image data; wherein the size of the sliding local window is obtained by the following formula: Wherein, G represents the size of the sliding local window, and the size of the sliding local window is rounded up; X d Indicates the gain value of the current camera sensor; X indicates the target gain signal value; G b represents the size of the preset basic sliding local window; S represents the signal-to-noise ratio value of the frame image data; A f A represents the image area occupied by the face of the person in the frame image data; s represents the image area of ​​the frame image data; S e Indicates the minimum signal-to-noise ratio value that meets the image quality requirements; I b Indicates the standard deviation of light intensity variation in the current target area; Ip Indicates the average light intensity in the target area; The sliding local window is controlled to slide in the image area occupied by the human face, and during the sliding process, local contrast adjustment is performed on the image area occupied by the human face passed by the sliding local window to obtain frame image data after contrast adjustment, wherein the frame image data after contrast adjustment is the image data after image enhancement processing.

[0012] Furthermore, during the sliding process, the local contrast of the image area occupied by the face of the human face that the sliding local window passes through is adjusted, including: During the sliding process of the sliding local window in the image area occupied by the face, the contrast value corresponding to the inner area of ​​the sliding local window is collected in real time; Real-time acquisition of the signal-to-noise ratio value corresponding to the inner area of ​​the sliding local window; The contrast target value corresponding to the inner area of ​​the sliding local window is obtained by using the contrast value corresponding to the inner area of ​​the sliding local window and the signal-to-noise ratio value corresponding to the inner area of ​​the sliding local window; wherein the contrast target value is obtained by the following formula: Among them, D t represents the contrast target value; D represents the overall image contrast corresponding to the frame image data; n represents the number of sliding local window traversals; S zi represents the signal-to-noise ratio value of the internal area of ​​the sliding local window corresponding to the i-th sliding of the moving local window; S represents the signal-to-noise ratio value of the frame image data; D zi S represents the contrast value of the internal area of ​​the sliding local window corresponding to the i-th sliding of the sliding local window; e Indicates the minimum signal-to-noise ratio value that meets the image quality requirements; D e Indicates the minimum contrast value that meets the image quality requirements; According to the contrast target value, the contrast of the inner area of ​​the corresponding sliding local window is adjusted until the sliding local window traverses the image area occupied by the face.

[0013] Furthermore, a deep learning model that has been trained and tested is retrieved from a database, and the deep learning model is used to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result, including: Retrieve the trained and tested deep learning model from the database; Inputting the image data after the image enhancement processing into the deep learning model that has completed training and testing; The deep learning model performs pain expression recognition on the image area occupied by the face of the image data after image enhancement processing, and obtains the pain level based on the pain expression recognition.

[0014] Furthermore, the structure of the deep learning model that has been trained and tested is as follows: Input layer: used to input image data after image enhancement processing; Convolutional layers and activation layers: Multiple convolutional layers are used to extract low-level to high-level features in the image, and activation functions such as ReLU are used to help the model learn complex patterns; Pooling layer: used to use the maximum pooling layer to reduce the number of parameters and computation while keeping the important parts of the features; Fully connected layers: One or more fully connected layers for high-level reasoning from features extracted by the convolutional layers; Output layer: used to output the pain level and use the softmax activation function to classify pain expressions into different pain levels.

[0015] A pain measurement system based on facial image recognition, the pain measurement system based on facial image recognition comprising: A video data acquisition module is used to dynamically adjust the gain signal value of the camera sensor, and collect the video data corresponding to the target area in real time through the camera sensor arranged in the target area; An image enhancement processing module is used to perform image enhancement processing on the video data to obtain image data after image enhancement processing; A pain determination module is used to retrieve a deep learning model that has been trained and tested from a database, and use the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result; The data sending module is used to mark the image data with the pain target when the pain determination result shows that the pain target appears in the target area, and send the image data to the mobile monitoring terminal.

[0016] Beneficial effects of the present invention: The present invention proposes a method and system for pain measurement based on facial image recognition. Through the method for pain measurement based on facial image recognition, the method can objectively and in real time reflect the patient's pain state, avoiding the subjectivity and inconsistency in the traditional pain assessment method. At the same time, the introduction of the deep learning model further improves the accuracy of pain expression recognition, making the pain assessment result more reliable. The above technical solution can dynamically adjust the gain signal value of the camera sensor to adapt to video data acquisition under different lighting conditions. In addition, the deep learning model can also adapt to the recognition of a variety of pain expression features, so that the above technical solution has good adaptability in different environments and application scenarios. By realizing real-time feedback of pain recognition results through a mobile monitoring terminal, medical staff can respond quickly and take appropriate intervention measures. This helps to relieve the patient's pain perception in time and improve the efficiency and quality of medical services. The above technical solution is not only applicable to pain assessment in medical institutions, but can also be extended to various application scenarios such as home environments and clinical research environments. This helps to promote the popularization and application of pain assessment technology and provide more patients with timely and accurate pain assessment services. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 is a flow chart of the method of the present invention; Figure 2 The system block diagram of the system of the present invention. DETAILED DESCRIPTION

[0018] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0019] The embodiment of the present invention proposes a pain measurement method based on facial image recognition, such as Figure 1 As shown, the pain measurement method based on facial image recognition includes: S1, dynamically adjusting the gain signal value of the camera sensor, and collecting the video data corresponding to the target area in real time through the camera sensor deployed in the target area; wherein the target area includes but is not limited to medical institutions, home environments and clinical research environments, etc.; and the camera sensor includes but is not limited to CMOS and CCD, etc.; S2, performing image enhancement processing on the video data to obtain image data after image enhancement processing; S3, retrieving a deep learning model that has been trained and tested from a database, and using the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result; S4. When the pain determination result indicates that a pain target appears in the target area, the image data with the pain target is marked, and the image data is sent to a mobile monitoring terminal, wherein the mobile monitoring terminal includes but is not limited to a smart phone, a laptop computer, etc.

[0020] The working principle of the above technical solution is as follows: The above technical solution is intended to ensure that the camera sensor can collect clear and high-quality video data under different lighting conditions. By dynamically adjusting the gain signal value, the camera sensor can adapt to the lighting changes in various target areas such as medical institutions, home environments and clinical research environments, thereby ensuring that the collected video data has sufficient brightness and contrast, providing a good foundation for subsequent image enhancement processing and pain expression recognition. The camera sensors arranged in the target area are used to collect video data containing the patient's face in real time. These camera sensors use high-performance image sensors such as CMOS or CCD, which can ensure that the collected video data has sufficient resolution and clarity. The collected video data is image enhanced to improve the clarity and contrast of the image. The above technical solution helps to eliminate image quality problems caused by factors such as insufficient lighting and noise interference, and provide higher quality input data for subsequent pain expression recognition. The deep learning model that has been trained and tested is retrieved from the database. After a large amount of pain expression image data training and optimization, the model can accurately identify a variety of pain expression features. The model is used to perform pain expression recognition on the image data after image enhancement processing to obtain the pain judgment result. When the pain determination result indicates that a pain target appears in the target area, the image data with the pain target is marked. Subsequently, the marked image data is sent to a mobile monitoring terminal, such as a smart phone, a laptop, etc., so that medical staff can obtain pain information in time and take corresponding intervention measures.

[0021] The effect of the above technical solution is: through the pain measurement method based on facial image recognition, the patient's pain state can be objectively and real-time reflected, avoiding the subjectivity and inconsistency in the traditional pain assessment method. At the same time, the introduction of the deep learning model further improves the accuracy of pain expression recognition, making the pain assessment result more reliable. The above technical solution can dynamically adjust the gain signal value of the camera sensor to adapt to video data acquisition under different lighting conditions. In addition, the deep learning model can also adapt to the recognition of a variety of pain expression characteristics, so that the above technical solution has good adaptability in different environments and application scenarios. Through the mobile monitoring terminal to achieve real-time feedback of pain recognition results, medical staff can respond quickly and take appropriate intervention measures. This helps to relieve the patient's pain in time and improve the efficiency and quality of medical services. The above technical solution is not only applicable to pain assessment in medical institutions, but can also be extended to various application scenarios such as home environment and clinical research environment. This helps to promote the popularization and application of pain assessment technology and provide more patients with timely and accurate pain assessment services.

[0022] In summary, the above technical solution has significant technical effects such as improving the accuracy of pain assessment, strong adaptability, real-time feedback and expanding application scenarios.

[0023] In one embodiment of the present invention, the gain signal value of the camera sensor is dynamically adjusted, and the video data corresponding to the target area is collected in real time by the camera sensor arranged in the target area, including: S101, real-time monitoring of light intensity in the target area; S102, dynamically adjusting the gain signal value of the camera sensor according to the light intensity in the monitoring target area to obtain a target gain signal value; S103, controlling the camera sensor to adjust the current gain according to the target gain signal value, and obtaining a camera sensor after gain adjustment; S104, controlling the gain-adjusted camera sensors arranged in the target area to collect video data corresponding to the target area in real time.

[0024] The working principle of the above technical solution is as follows: the above technical solution monitors the light intensity in the target area in real time through a light sensor or other light detection device. The light sensor is an electronic device that can sense the intensity of light. Its core component is a photosensitive element, usually a photodiode or a phototransistor. When light shines on the photosensitive element, it will trigger the generation of photocurrent, and the size of the photocurrent is proportional to the light intensity. By measuring the size of the photocurrent, the intensity of the light can be inferred.

[0025] According to the real-time monitored light intensity, the system will dynamically adjust the gain signal value of the camera sensor. Gain is the gradient of this linear response. If the light intensity is weak, the system will increase the gain signal value to improve the sensitivity of the camera sensor, thereby ensuring that clear video data can be collected even in low-light environments. The system controls the camera sensor to make corresponding adjustments based on the calculated target gain signal value. The above technical solution ensures that the gain of the camera sensor matches the current light intensity, so that high-quality video data can be collected. After the gain adjustment of the camera sensor is completed, the system will control it to start collecting video data corresponding to the target area in real time. These video data will be used for subsequent image enhancement processing, pain expression recognition and other steps.

[0026] The effect of the above technical solution is: by dynamically adjusting the gain signal value of the camera sensor, the technical solution can ensure that clear and high-quality video data can be collected under different light intensities. This helps the accuracy of subsequent image enhancement processing and pain expression recognition. The technical solution can automatically adapt to environments with different light intensities and achieve dynamic adjustment of gain without human intervention. This enhances the adaptability and flexibility of the system, enabling it to operate stably in various complex environments. By collecting high-quality video data in real time, the technical solution can provide users with clearer and more accurate pain assessment results. This helps to improve users' trust and satisfaction with the system. Since the system can automatically adapt to changes in light intensity, there is no need to frequently replace camera sensors or perform other maintenance work. This reduces the maintenance cost and use cost of the system.

[0027] In summary, this technical solution achieves the goal of real-time acquisition of high-quality video data under different light intensities by dynamically adjusting the gain signal value of the camera sensor. This improves the adaptability and flexibility of the system, reduces maintenance costs, and provides users with more accurate and reliable pain assessment results.

[0028] In one embodiment of the present invention, dynamically adjusting the gain signal value of the camera sensor according to the light intensity in the monitoring target area to obtain the target gain signal value includes: S1021, extracting the light intensity in the current target area; S1022, comparing the light intensity in the current target area with a preset first light intensity threshold and a second light intensity threshold; S1023, when the light intensity in the current target area is lower than a preset first light intensity threshold, but not lower than a preset second light intensity threshold, obtaining a target gain signal value by using a first gain adjustment strategy; S1024: When the light intensity in the current target area is lower than a preset second light intensity threshold, a second gain adjustment strategy is used to obtain a target gain signal value.

[0029] The working principle of the above technical solution is as follows: In this step, the current light intensity data of the target area is obtained in real time through a light sensor or other light detection device. These data are the basis for subsequent comparison and adjustment. The extracted current light intensity is compared with the preset first light intensity threshold and second light intensity threshold. These two thresholds are pre-set based on factors such as the performance of the camera sensor, the lighting conditions of the target area, and the expected image quality.

[0030] When the current light intensity is lower than the first light intensity threshold but higher than the second light intensity threshold, it means that the light intensity is in a medium to weak range. At this time, the system will calculate an appropriate gain signal value based on the first gain adjustment strategy to improve the sensitivity of the camera sensor, thereby ensuring that clearer video data can be collected even in low-light environments. When the current light intensity is lower than the second light intensity threshold, it means that the light intensity is very weak and may be close to or lower than the minimum operating illumination of the camera sensor. At this time, the system will calculate a higher gain signal value based on the second gain adjustment strategy to further improve the sensitivity of the camera sensor. However, it should be noted that excessive gain may lead to increased image noise, so it is necessary to find a balance between increasing sensitivity and maintaining image quality.

[0031] The effect of the above technical solution is: by dynamically adjusting the gain signal value of the camera sensor, the technical solution can ensure that relatively clear video data can be collected under different light intensities. This helps to improve the accuracy of subsequent image enhancement processing and pain expression recognition. The technical solution can automatically adapt to environments with different light intensities and achieve dynamic adjustment of gain without manual intervention. This enhances the adaptability and flexibility of the system, enabling it to operate stably in various complex environments. By setting different gain adjustment strategies, the technical solution can optimize the resource utilization of the camera sensor while ensuring image quality. For example, when the light intensity is moderate, a lower gain can reduce image noise and power consumption; while when the light is very weak, a higher gain is used to ensure image clarity. Since the system can automatically adapt to changes in light intensity and adjust the gain, users do not need to worry about the impact of light changes on video acquisition quality. This helps to improve users' trust and satisfaction with the system.

[0032] In summary, this technical solution achieves the goal of capturing high-quality video data under different light intensities by dynamically adjusting the gain signal value of the camera sensor. This improves the adaptability and flexibility of the system, optimizes resource utilization, and provides users with a clearer and more accurate video capture experience.

[0033] In one embodiment of the present invention, the first gain adjustment strategy is as follows: Step 1a, extracting the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area; Step 2a, extracting a first theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the first light intensity threshold, and a second theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the second light intensity threshold; Step 3a, comparing the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with the first theoretical signal-to-noise ratio, to obtain a first signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the first theoretical signal-to-noise ratio; Step 4a, comparing the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with the second theoretical signal-to-noise ratio, to obtain a second signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the second theoretical signal-to-noise ratio; Step 5a: Obtain a first gain adjustment coefficient using the first signal-to-noise ratio difference and the second signal-to-noise ratio difference; The first gain adjustment coefficient is obtained by the following formula: Among them, K 01 represents the first gain adjustment coefficient; β0 represents the second enhancement adjustment factor, and the value range of the second enhancement adjustment factor is 1.28-2.81; S c01 represents the first signal-to-noise ratio difference; S c02 represents the second signal-to-noise ratio difference; k represents the light intensity change rate corresponding to the current target area; S b Indicates the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target area; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I b Indicates the standard deviation of light intensity variation in the current target area; f 01 represents a first gain adjustment factor, and the first gain adjustment factor is obtained by the following formula: Among them, f 01 represents the first gain adjustment factor; α0 represents the first enhancement adjustment factor, and the value range of the first enhancement adjustment factor is 0.62-1.19; ISO represents the sensitivity of the camera sensor; I 01 Represents the first light intensity threshold; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I r Indicates the maximum light change amplitude in the current target area; Step 6a, retrieve the gain value of the current camera sensor; Step 7a, using the first gain adjustment coefficient combined with the gain value of the current camera sensor to obtain a target gain signal value; The target gain signal value is obtained by the following formula: Among them, X 01 represents the target gain signal value obtained by the first gain adjustment coefficient; K 01 represents the first gain adjustment coefficient; X d Indicates the gain value of the current camera sensor.

[0034] The working principle of the above technical solution is as follows: first, the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area is extracted. At the same time, the theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the preset first light intensity threshold and the second light intensity threshold is extracted.

[0035] The signal-to-noise ratio of the video data at the current light intensity is compared with the first theoretical signal-to-noise ratio to obtain a first signal-to-noise ratio difference. The signal-to-noise ratio of the video data at the current light intensity is compared with the second theoretical signal-to-noise ratio to obtain a second signal-to-noise ratio difference. The first gain adjustment coefficient is calculated based on the first signal-to-noise ratio difference, the second signal-to-noise ratio difference, the light intensity change rate corresponding to the current target area, the signal-to-noise ratio standard deviation of the image data corresponding to the currently obtained target area, the second light intensity threshold, the light intensity in the current target area, the standard deviation of the light intensity change in the current target area, and the first gain adjustment factor calculated by a complex formula.

[0036] The calculation of the first gain adjustment factor involves the first enhancement adjustment factor, the sensitivity of the camera sensor, the first light intensity threshold, the second light intensity threshold, the light intensity in the current target area, and the maximum light change amplitude in the current target area. The gain value of the current camera sensor is retrieved. The target gain signal value is calculated by the formula using the first gain adjustment coefficient and the gain value of the current camera sensor.

[0037] The effect of the above technical solution is: by dynamically adjusting the gain signal value of the camera sensor, the technical solution can ensure that high-quality video data can be collected under different light intensities. As an important indicator for measuring image quality, the signal-to-noise ratio can significantly improve the clarity and accuracy of the image by optimizing the signal-to-noise ratio difference. The technical solution can automatically adapt to environments with different light intensities and achieve dynamic adjustment of gain without manual intervention. This enhances the adaptability and flexibility of the system, enabling it to operate stably in various complex environments. By accurately calculating the gain adjustment coefficient and the gain adjustment factor, the technical solution can optimize the resource utilization of the camera sensor while ensuring image quality. This helps to reduce power consumption, extend equipment life and reduce maintenance costs. Since the system can automatically adapt to changes in light intensity and adjust the gain, users do not need to worry about the impact of light changes on video acquisition quality. This helps to improve users' trust and satisfaction with the system, thereby enhancing the user experience.

[0038] On the other hand, the technical solution can adaptively adjust the gain of the camera sensor according to the light intensity in the current target area. By extracting the signal-to-noise ratio of the video data frame image under the current light intensity and comparing it with the theoretical signal-to-noise ratio corresponding to the preset light intensity threshold, the image quality under the current light conditions can be accurately evaluated. By calculating the first signal-to-noise ratio difference and the second signal-to-noise ratio difference, and using these differences to obtain the first gain adjustment coefficient, the solution can accurately adjust the gain of the camera sensor to improve the image quality. This helps to maintain the clarity and details of the image in an environment with complex light changes. The technical solution introduces multiple parameters (such as the second enhancement adjustment factor, the first enhancement adjustment factor, the light intensity change rate, etc.) to calculate the first gain adjustment coefficient and the target gain signal value, thereby realizing intelligent gain adjustment. This adjustment method is more accurate and efficient than traditional manual adjustment. The formulas and parameters in the solution have certain flexibility and can be adjusted according to different application scenarios and requirements. For example, the value ranges of the second enhancement adjustment factor and the first enhancement adjustment factor can be set according to actual conditions to adapt to different light conditions and camera sensor performance. By dynamically adjusting the gain of the camera sensor, the technical solution can improve its adaptability under different light conditions. This helps extend the life of the camera sensor and reduces image quality degradation caused by light changes. For application scenarios that rely on cameras for monitoring, shooting, or video calls, this technical solution can significantly optimize the user experience. By improving image quality and stability, users can see the details of the target area more clearly, thereby making more accurate judgments and decisions.

[0039] In summary, this technical solution provides a more accurate, efficient and intelligent solution for adjusting the gain of camera sensors through the advantages of adaptive light intensity adjustment, improved image quality, intelligent adjustment, flexibility, improved adaptability of camera sensors and optimized user experience. At the same time, this technical solution realizes dynamic adjustment of the value of the camera sensor gain signal by comprehensively considering the relationship between light intensity, signal-to-noise ratio and gain adjustment coefficient. This improves image quality, enhances system adaptability, optimizes resource utilization and enhances user experience.

[0040] In one embodiment of the present invention, the second gain adjustment strategy is as follows: Step 1b, extracting the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area; Step 2b, comparing the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with a preset signal-to-noise ratio reference value, to obtain a signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the preset signal-to-noise ratio reference value; Step 3b, obtaining a second gain adjustment coefficient by using a signal-to-noise ratio difference between a signal-to-noise ratio of frame image data of video data acquired by a camera sensor under the light intensity in the current target area and a preset signal-to-noise ratio reference value; The second gain adjustment coefficient is obtained by the following formula: Among them, K 02 represents the second gain adjustment coefficient; β0 represents the second enhancement adjustment factor, and the value range of the second enhancement adjustment factor is 1.28-2.81; S c represents the difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the preset signal-to-noise ratio reference value; k represents the rate of change of the light intensity corresponding to the current target area; S b Indicates the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target area; f 02 represents a second gain adjustment factor, and the second gain adjustment factor is obtained by the following formula: Among them, f 02 represents the second gain adjustment factor; α0 represents the first enhancement adjustment factor, and the value range of the first enhancement adjustment factor is 0.62-1.19; I p Indicates the average light intensity in the target area; ISO indicates the sensitivity of the camera sensor; I 01 Represents the first light intensity threshold; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I r Indicates the maximum light change amplitude in the current target area; Step 4b, retrieve the gain value of the current camera sensor; Step 5b: using the second gain adjustment coefficient in combination with the gain value of the current camera sensor to obtain a target gain signal value; The target gain signal value is obtained by the following formula: Among them, X 02 represents the target gain signal value obtained by the second gain adjustment coefficient; K02 represents the second gain adjustment coefficient; X d Indicates the gain value of the current camera sensor.

[0041] The working principle of the above technical solution is: under the light intensity of the current target area, the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor is extracted. The extracted signal-to-noise ratio is compared with the preset signal-to-noise ratio reference value, and the signal-to-noise ratio difference between the two is calculated. The second gain adjustment coefficient is calculated together using the signal-to-noise ratio difference, the light intensity change rate corresponding to the current target area, the signal-to-noise ratio standard deviation of the image data corresponding to the currently acquired target area, and the second gain adjustment factor calculated by a complex formula. In the process of calculating the second gain adjustment factor, the first enhancement adjustment factor, the average light intensity in the target area, the sensitivity of the camera sensor, the preset first light intensity threshold, the second light intensity threshold, the light intensity in the current target area, and the maximum light change amplitude in the current target area are also involved. The gain value of the current camera sensor is retrieved as the basis for calculating the target gain signal value. The target gain signal value is calculated by the formula using the second gain adjustment coefficient and the gain value of the current camera sensor.

[0042] The effect of the above technical solution is: under extremely low light intensity, by dynamically adjusting the gain signal value of the camera sensor, the signal-to-noise ratio of the video data can be significantly improved, thereby improving the clarity and detail of the image. This technical solution can automatically adapt to environments with different light intensities, especially in extremely low light environments, by accurately calculating the gain adjustment coefficient, ensuring that the camera sensor can work stably and improving the adaptability and robustness of the system. By accurately calculating the gain adjustment coefficient, while ensuring image quality, the resource utilization of the camera sensor can be optimized, power consumption can be reduced, and the service life of the equipment can be extended. In extremely low light environments, users can obtain high-quality images without manually adjusting the camera settings, which improves the user experience and satisfaction.

[0043] At the same time, the technical solution can adaptively adjust the gain of the camera sensor according to the light intensity of the current target area and the signal-to-noise ratio of the video data frame image obtained by the camera sensor. This adaptive adjustment mechanism can ensure that the camera sensor can output high-quality images under different light conditions. By comparing the signal-to-noise ratio of the video data frame image under the current light intensity with the preset signal-to-noise ratio reference value, and calculating the second gain adjustment coefficient according to the signal-to-noise ratio difference, the solution can accurately adjust the gain of the camera sensor to improve the image quality. This helps to reduce noise and blur in the image and improve the clarity and details of the image. The technical solution introduces multiple parameters (such as the second enhancement adjustment factor, the first enhancement adjustment factor, the light intensity change rate, etc.) to calculate the second gain adjustment coefficient and the target gain signal value, thereby realizing intelligent gain adjustment. At the same time, these parameters have a certain degree of flexibility and can be adjusted according to different application scenarios and requirements to adapt to different light conditions and camera sensor performance. By dynamically adjusting the gain of the camera sensor, the technical solution can significantly enhance its adaptability under different light conditions. This helps to extend the service life of the camera sensor and reduce the problem of image quality degradation caused by light changes. For application scenarios that rely on cameras for monitoring, shooting, or video calls, this technical solution can significantly optimize the user experience. By improving image quality and stability, users can see the details of the target area more clearly, thereby making more accurate judgments and decisions. Compared with traditional gain adjustment methods, this technical solution reduces the complexity and debugging difficulty of the system by introducing intelligent gain adjustment strategies and parameterized calculation formulas. This makes the adjustment of camera sensor gain simpler, more efficient, and more reliable.

[0044] In summary, this technical solution provides a more accurate, efficient and intelligent solution for adjusting the gain of camera sensors through the advantages of adaptive gain adjustment, improved image quality, intelligence and flexibility, enhanced adaptability of camera sensors, optimized user experience and reduced system complexity. At the same time, this technical solution dynamically adjusts the gain signal value of the camera sensor by comprehensively considering multiple factors, realizes high-quality image acquisition in extremely low-light environments, improves the adaptability and robustness of the system, optimizes resource utilization, reduces power consumption, and improves user experience.

[0045] In one embodiment of the present invention, performing image enhancement processing on the video data to obtain image data after image enhancement processing includes: S201, performing frame processing on the video data to obtain frame image data corresponding to the video data; S202, extracting the image area occupied by the face of the person in the frame image data; S203, extracting the signal-to-noise ratio value of the frame image data; S204, setting a sliding local window according to the image area occupied by the face and the signal-to-noise ratio value of the frame image data; wherein the size of the sliding local window is obtained by the following formula: Wherein, G represents the size of the sliding local window, and the size of the sliding local window is rounded up; X d Indicates the gain value of the current camera sensor; X indicates the target gain signal value; G b represents the size of the preset basic sliding local window; S represents the signal-to-noise ratio value of the frame image data; A f A represents the image area occupied by the face of the person in the frame image data; s represents the image area of ​​the frame image data; S e Indicates the minimum signal-to-noise ratio value that meets the image quality requirements; I b Indicates the standard deviation of light intensity variation in the current target area; I p Indicates the average light intensity in the target area; S205, controlling the sliding local window to slide in the image area occupied by the human face, and performing local contrast adjustment on the image area occupied by the human face passed by the sliding local window during the sliding process to obtain frame image data after contrast adjustment, wherein the frame image data after contrast adjustment is the image data after image enhancement processing.

[0046] The working principle of the above technical solution is: frame processing is performed on the video data to split it into a series of frame image data. This is the basis of image enhancement processing, because image enhancement is usually performed on a single frame image. In each frame of image data, the image area occupied by the face is extracted. This usually involves a face detection algorithm to determine the position and size of the face in the image. The signal-to-noise ratio (SNR) value of each frame of image data is calculated. The signal-to-noise ratio is an important indicator for measuring image quality, reflecting the ratio of signal to noise in the image.

[0047] The size of the sliding local window is set according to the image area occupied by the face and the signal-to-noise ratio value of the frame image data. This window is used to make local contrast adjustments in the face area. The size of the window is calculated by a complex formula, taking into account the gain value of the camera sensor, the target gain signal value, the preset basic sliding local window size, the signal-to-noise ratio value of the frame image data, the image area occupied by the face, the image area of ​​the frame image data, the minimum signal-to-noise ratio value that meets the image quality requirements, the standard deviation of the light intensity variation in the current target area, and the average light intensity in the target area. The sliding local window is controlled to slide in the image area occupied by the face, and the local contrast adjustment is made to the face area that the window passes through during the sliding process. This usually involves redistributing or adjusting the pixel values ​​within the window to enhance the local contrast of the image and make the face area clearer and more prominent.

[0048] The effect of the above technical solution is: through local contrast adjustment, the clarity of the facial area of ​​the face can be significantly improved, making the facial features more distinct and easier to identify. Taking into account multiple factors such as signal-to-noise ratio and light intensity, the technical solution can automatically adjust the size of the sliding local window and the parameters of the contrast adjustment, so as to obtain high-quality images under different lighting conditions. Through local processing rather than global processing, the technical solution can optimize the utilization of computing resources, reduce processing complexity, and increase processing speed. In application scenarios such as video calls and face recognition, the technical solution can significantly improve the user experience because users can see the facial area of ​​the face more clearly, making it easier to communicate and identify. The technical solution can automatically adapt to different lighting conditions and changes in the size of the facial area of ​​the face, improving the adaptability and robustness of the system.

[0049] In summary, this technical solution realizes local contrast adjustment of the facial area of ​​the face in the video data by comprehensively considering multiple factors, thereby improving the image quality and user experience, and enhancing the adaptability and robustness of the system.

[0050] In one embodiment of the present invention, during the sliding process, local contrast adjustment is performed on the image area occupied by the face of the human face that the sliding local window passes through, including: S2051, during the sliding process of the sliding local window in the image area occupied by the face, collecting the contrast value corresponding to the inner area of ​​the sliding local window in real time; S2052, collecting the signal-to-noise ratio value corresponding to the inner area of ​​the sliding local window in real time; S2053, using the contrast value corresponding to the inner area of ​​the sliding local window and the signal-to-noise ratio value corresponding to the inner area of ​​the sliding local window to obtain a contrast target value corresponding to the inner area of ​​the sliding local window; wherein the contrast target value is obtained by the following formula: Among them, D t represents the contrast target value; D represents the overall image contrast corresponding to the frame image data; n represents the number of sliding local window traversals; S zi represents the signal-to-noise ratio value of the internal area of ​​the sliding local window corresponding to the i-th sliding of the moving local window; S represents the signal-to-noise ratio value of the frame image data; D zi S represents the contrast value of the internal area of ​​the sliding local window corresponding to the i-th sliding of the sliding local window; e Indicates the minimum signal-to-noise ratio value that meets the image quality requirements; D e Indicates the minimum contrast value that meets the image quality requirements; S2054: Adjust the contrast of the inner area of ​​the sliding local window corresponding to the contrast target value until the sliding local window traverses the image area occupied by the face.

[0051] The working principle of the above technical solution is: in the process of sliding the local window to traverse the image area occupied by the face, the contrast and signal-to-noise ratio values ​​of the inner area of ​​the window are collected in real time each time the window is slid. These values ​​reflect the image quality and contrast of the inner area of ​​the window. The contrast target value is calculated by formula using the contrast and signal-to-noise ratio values ​​collected in real time, as well as the overall image contrast, signal-to-noise ratio value, minimum signal-to-noise ratio value that meets the image quality requirements and minimum contrast value of the frame image data. This value is determined based on the image quality of the inner area of ​​the current window and the overall image quality requirements, aiming to achieve the optimal state of the adjusted local contrast. According to the calculated contrast target value, the contrast of the inner area of ​​the window is adjusted each time the window is slid. This process is real-time and continues as the window slides until the entire image area occupied by the face is traversed.

[0052] The effect of the above technical solution is: by collecting contrast and signal-to-noise ratio values ​​in real time, and calculating the contrast target value based on these values ​​for adjustment, the local contrast of the image area occupied by the face of the human face can be significantly improved. This makes the facial features more distinct and enhances the visual effect of the image. Taking into account the impact of signal-to-noise ratio and contrast on image quality, the technical solution can automatically adjust the local contrast so that the image reaches the optimal contrast state while meeting the minimum signal-to-noise ratio requirement. This helps to improve the overall quality of the image, making it clearer and easier to observe. The technical solution can automatically adapt to different lighting conditions and changes in the size of the face area of ​​the human face, and ensure that the image quality is always maintained at a high level by collecting and adjusting the local contrast and signal-to-noise ratio values ​​in real time. This enhances the adaptability and robustness of the system, enabling it to be applied to a wider range of scenarios. In application scenarios such as video calls and face recognition, the technical solution can significantly improve the user experience. By improving the local contrast and overall image quality of the face area of ​​the human face, users can see the facial features of the other party more clearly, making it easier to communicate and identify.

[0053] In summary, this technical solution achieves local contrast optimization of the image area occupied by the face by collecting contrast and signal-to-noise ratio values ​​in real time and using these values ​​to calculate the contrast target value for adjustment. This improves image quality, enhances the adaptability and robustness of the system, and improves user experience.

[0054] In one embodiment of the present invention, a deep learning model that has been trained and tested is retrieved from a database, and the deep learning model is used to perform pain expression recognition on the image data after image enhancement processing to obtain a pain determination result, including: S301, retrieve the deep learning model that has completed training and testing from the database; S302, inputting the image data after the image enhancement processing into the deep learning model that has completed training and testing; S303, the deep learning model performs pain expression recognition on the image area occupied by the face of the image data after image enhancement processing, and obtains the pain level according to the pain expression recognition.

[0055] Among them, the structure of the deep learning model that has completed training and testing is as follows: Input layer: used to input image data after image enhancement processing; Convolutional layers and activation layers: Multiple convolutional layers are used to extract low-level to high-level features in the image, and activation functions such as ReLU are used to help the model learn complex patterns; Pooling layer: used to use the Max Pooling layer to reduce the number of parameters and computation while keeping the important parts of the features; Dense Layers: One or more fully connected layers for high-level reasoning from features extracted by the convolutional layers. Output layer: used to output the pain level and use the softmax activation function to classify pain expressions into different pain levels.

[0056] The working principle of the above technical solution is as follows: a deep learning model that has been trained and tested is retrieved from the database. This model has learned the features of pain expressions and can use these features to identify pain expressions in images. The image data after image enhancement is input into the deep learning model. These image data have been enhanced through the previous steps to improve recognition accuracy. The deep learning model recognizes pain expressions in the image area occupied by the face of the input image data. The model extracts low-level to high-level features in the image through convolutional layers, learns complex patterns using activation functions, and reduces the number of parameters and calculations through pooling layers. Then, the fully connected layer uses these features for high-level reasoning, and the final output layer uses the softmax activation function to classify pain expressions into different pain levels.

[0057] The structure of the deep learning model is as follows: Input layer: receives image data after image enhancement processing.

[0058] Convolutional layers and activation layers: Multiple convolutional layers are used to extract features from the image, and activation functions such as ReLU are used to help the model learn complex patterns.

[0059] Pooling layer: Use the max pooling layer to reduce the number of parameters and computation while keeping the important parts of the features.

[0060] Fully connected layer: Perform high-level reasoning from the features extracted by the convolutional layer to prepare for the final classification task.

[0061] Output layer: Use the softmax activation function to classify pain expressions into different pain levels and output the pain judgment results.

[0062] The effect of the above technical solution is: by using a deep learning model, the characteristics of pain expressions can be automatically learned and recognized with high precision. This greatly improves the accuracy of pain expression recognition and provides strong support for medical diagnosis. After a lot of training and testing, the deep learning model can learn the pain characteristics under different lighting, angles and expression changes, thereby enhancing the generalization ability of the model. This enables the model to maintain stable performance in various practical application scenarios. This technical solution can automatically complete the task of pain expression recognition without human intervention. At the same time, due to the high computational efficiency of the deep learning model, real-time pain determination can be achieved, providing timely feedback for clinical diagnosis and treatment. By obtaining the results of pain determination, doctors can understand the patient's pain more accurately and formulate more reasonable treatment plans. This helps to improve the accuracy and effectiveness of medical decision-making.

[0063] In summary, this technical solution uses a deep learning model to recognize pain expressions on image data after image enhancement processing. It has the advantages of high precision, strong generalization ability, automation and real-time performance, and can provide strong support for medical diagnosis and treatment.

[0064] The present invention provides a pain measurement system based on facial image recognition, such as Figure 2 As shown, the pain measurement system based on facial image recognition includes: A video data acquisition module, which is used to dynamically adjust the gain signal value of the camera sensor, and collect the video data corresponding to the target area in real time through the camera sensor arranged in the target area; wherein the target area includes but is not limited to medical institutions, home environments and clinical research environments, etc.; and the camera sensor includes but is not limited to CMOS and CCD, etc.; An image enhancement processing module is used to perform image enhancement processing on the video data to obtain image data after image enhancement processing; A pain determination module is used to retrieve a deep learning model that has been trained and tested from a database, and use the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result; The data sending module is used to mark the image data with the pain target when the pain determination result indicates that the pain target appears in the target area, and send the image data to the mobile monitoring terminal, wherein the mobile monitoring terminal includes but is not limited to a smart phone, a laptop computer, etc.

[0065] The working principle of the above technical solution is as follows: The above technical solution is intended to ensure that the camera sensor can collect clear and high-quality video data under different lighting conditions. By dynamically adjusting the gain signal value, the camera sensor can adapt to the lighting changes in various target areas such as medical institutions, home environments and clinical research environments, thereby ensuring that the collected video data has sufficient brightness and contrast, providing a good foundation for subsequent image enhancement processing and pain expression recognition. The camera sensors arranged in the target area are used to collect video data containing the patient's face in real time. These camera sensors use high-performance image sensors such as CMOS or CCD, which can ensure that the collected video data has sufficient resolution and clarity. The collected video data is image enhanced to improve the clarity and contrast of the image. The above technical solution helps to eliminate image quality problems caused by factors such as insufficient lighting and noise interference, and provide higher quality input data for subsequent pain expression recognition. The deep learning model that has been trained and tested is retrieved from the database. After a large amount of pain expression image data training and optimization, the model can accurately identify a variety of pain expression features. The model is used to perform pain expression recognition on the image data after image enhancement processing to obtain the pain judgment result. When the pain determination result indicates that a pain target appears in the target area, the image data with the pain target is marked. Subsequently, the marked image data is sent to a mobile monitoring terminal, such as a smart phone, a laptop, etc., so that medical staff can obtain pain information in time and take corresponding intervention measures.

[0066] The effect of the above technical solution is: through the pain measurement method based on facial image recognition, the patient's pain state can be objectively and real-time reflected, avoiding the subjectivity and inconsistency in the traditional pain assessment method. At the same time, the introduction of the deep learning model further improves the accuracy of pain expression recognition, making the pain assessment result more reliable. The above technical solution can dynamically adjust the gain signal value of the camera sensor to adapt to video data acquisition under different lighting conditions. In addition, the deep learning model can also adapt to the recognition of a variety of pain expression characteristics, so that the above technical solution has good adaptability in different environments and application scenarios. Through the mobile monitoring terminal to achieve real-time feedback of pain recognition results, medical staff can respond quickly and take appropriate intervention measures. This helps to relieve the patient's pain in time and improve the efficiency and quality of medical services. The above technical solution is not only applicable to pain assessment in medical institutions, but can also be extended to various application scenarios such as home environment and clinical research environment. This helps to promote the popularization and application of pain assessment technology and provide more patients with timely and accurate pain assessment services.

[0067] In summary, the above technical solution has significant technical effects such as improving the accuracy of pain assessment, strong adaptability, real-time feedback and expanding application scenarios.

[0068] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A pain measurement method based on facial image recognition, characterized in that: The pain measurement method based on facial image recognition comprises: Dynamically adjust the gain signal value of the camera sensor, and collect video data corresponding to the target area in real time through the camera sensor deployed in the target area; Performing image enhancement processing on the video data to obtain image data after the image enhancement processing; Retrieving a deep learning model that has been trained and tested from a database, and using the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result; When the pain determination result indicates that a pain target appears in the target area, the image data with the pain target is marked and the image data is sent to the mobile monitoring terminal.

2. The pain measurement method based on facial image recognition according to claim 1, characterized in that: The gain signal value of the camera sensor is dynamically adjusted, and the video data corresponding to the target area is collected in real time through the camera sensor arranged in the target area, including: Real-time monitoring of light intensity in the target area; Dynamically adjusting the gain signal value of the camera sensor according to the light intensity in the monitoring target area to obtain a target gain signal value; Controlling the camera sensor to adjust the current gain according to the target gain signal value, and obtaining the camera sensor after gain adjustment; The gain-adjusted camera sensors deployed in the target area are controlled to collect video data corresponding to the target area in real time.

3. The method for pain measurement based on facial image recognition according to claim 2, characterized in that: Dynamically adjusting the gain signal value of the camera sensor according to the light intensity in the monitoring target area to obtain the target gain signal value includes: Extract the light intensity in the current target area; Comparing the light intensity in the current target area with a preset first light intensity threshold and a second light intensity threshold; When the light intensity in the current target area is lower than a preset first light intensity threshold, but not lower than a preset second light intensity threshold, a target gain signal value is obtained by using a first gain adjustment strategy; When the light intensity in the current target area is lower than a preset second light intensity threshold, the second gain adjustment strategy is used to obtain a target gain signal value.

4. The method for pain measurement based on facial image recognition according to claim 3, characterized in that: The first gain adjustment strategy is as follows: Extract the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area; Extracting a first theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the first light intensity threshold, and a second theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the second light intensity threshold; Compare the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with the first theoretical signal-to-noise ratio to obtain a first signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the first theoretical signal-to-noise ratio; Compare the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with the second theoretical signal-to-noise ratio to obtain a second signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the second theoretical signal-to-noise ratio; Obtaining a first gain adjustment coefficient using the first signal-to-noise ratio difference and the second signal-to-noise ratio difference; The first gain adjustment coefficient is obtained by the following formula: Among them, K 01 represents the first gain adjustment coefficient; β0 represents the second enhancement adjustment factor, and the value range of the second enhancement adjustment factor is 1.28-2.81; S c01 represents the first signal-to-noise ratio difference; S c02 represents the second signal-to-noise ratio difference; k represents the light intensity change rate corresponding to the current target area; S b Indicates the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target area; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I b Indicates the standard deviation of light intensity variation in the current target area; f 01 represents a first gain adjustment factor, and the first gain adjustment factor is obtained by the following formula: Among them, f 01 represents the first gain adjustment factor; α0 represents the first enhancement adjustment factor, and the value range of the first enhancement adjustment factor is 0.62-1.19; ISO represents the sensitivity of the camera sensor; I 01 Represents the first light intensity threshold; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I r Indicates the maximum light change amplitude in the current target area; Get the gain value of the current camera sensor; Obtaining a target gain signal value by using the first gain adjustment coefficient in combination with a gain value of a current camera sensor; The target gain signal value is obtained by the following formula: Among them, X 01 represents the target gain signal value obtained by the first gain adjustment coefficient; K 01 represents the first gain adjustment coefficient; X d Indicates the gain value of the current camera sensor.

5. The method for pain measurement based on facial image recognition according to claim 3, characterized in that: The second gain adjustment strategy is as follows: Extract the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area; Compare the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area with a preset signal-to-noise ratio reference value to obtain a signal-to-noise ratio difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the preset signal-to-noise ratio reference value; Obtaining a second gain adjustment coefficient using a signal-to-noise ratio difference between a signal-to-noise ratio of frame image data of video data acquired by a camera sensor under the light intensity in the current target area and a preset signal-to-noise ratio reference value; The second gain adjustment coefficient is obtained by the following formula: Among them, K 02 represents the second gain adjustment coefficient; β0 represents the second enhancement adjustment factor, and the value range of the second enhancement adjustment factor is 1.28-2.81; S c represents the difference between the signal-to-noise ratio of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area and the preset signal-to-noise ratio reference value; k represents the rate of change of the light intensity corresponding to the current target area; S b Indicates the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target area; f 02 represents a second gain adjustment factor, and the second gain adjustment factor is obtained by the following formula: Among them, f 02 represents the second gain adjustment factor; α0 represents the first enhancement adjustment factor, and the value range of the first enhancement adjustment factor is 0.62-1.19; I p Indicates the average light intensity in the target area; ISO indicates the sensitivity of the camera sensor; I 01 Represents the first light intensity threshold; I 02 represents the second light intensity threshold; I represents the light intensity in the current target area; I r Indicates the maximum light change amplitude in the current target area; Get the gain value of the current camera sensor; Obtaining a target gain signal value by using the second gain adjustment coefficient in combination with a gain value of a current camera sensor; The target gain signal value is obtained by the following formula: Among them, X 02 represents the target gain signal value obtained by the second gain adjustment coefficient; K 02 represents the second gain adjustment coefficient; X d Indicates the gain value of the current camera sensor.

6. The method for pain measurement based on facial image recognition according to claim 1, characterized in that: Performing image enhancement processing on the video data to obtain image data after the image enhancement processing includes: Performing frame processing on the video data to obtain frame image data corresponding to the video data; Extracting the image area occupied by the face of a person in the frame image data; Extracting a signal-to-noise ratio value of the frame image data; The sliding local window is set according to the image area occupied by the face and the signal-to-noise ratio value of the frame image data; wherein the size of the sliding local window is obtained by the following formula: Wherein, G represents the size of the sliding local window, and the size of the sliding local window is rounded up; X d Indicates the gain value of the current camera sensor; X indicates the target gain signal value; G b represents the size of the preset basic sliding local window; S represents the signal-to-noise ratio value of the frame image data; A f A represents the image area occupied by the face of the person in the frame image data; s represents the image area of ​​the frame image data; S e Indicates the minimum signal-to-noise ratio value that meets the image quality requirements; I b Indicates the standard deviation of light intensity variation in the current target area; I p Indicates the average light intensity in the target area; The sliding local window is controlled to slide in the image area occupied by the human face, and during the sliding process, local contrast adjustment is performed on the image area occupied by the human face passed by the sliding local window to obtain frame image data after contrast adjustment, wherein the frame image data after contrast adjustment is the image data after image enhancement processing.

7. The method for pain measurement based on facial image recognition according to claim 6, characterized in that: During the sliding process, the local contrast of the image area occupied by the face of the human face that the sliding local window passes through is adjusted, including: During the sliding process of the sliding local window in the image area occupied by the face, the contrast value corresponding to the inner area of ​​the sliding local window is collected in real time; Real-time acquisition of the signal-to-noise ratio value corresponding to the inner area of ​​the sliding local window; The contrast target value corresponding to the inner area of ​​the sliding local window is obtained by using the contrast value corresponding to the inner area of ​​the sliding local window and the signal-to-noise ratio value corresponding to the inner area of ​​the sliding local window; wherein the contrast target value is obtained by the following formula: Among them, D t represents the contrast target value; D represents the overall image contrast corresponding to the frame image data; n represents the number of sliding local window traversals; S zi represents the signal-to-noise ratio value of the internal area of ​​the sliding local window corresponding to the i-th sliding of the moving local window; S represents the signal-to-noise ratio value of the frame image data; D zi S represents the contrast value of the internal area of ​​the sliding local window corresponding to the i-th sliding of the sliding local window; e Indicates the minimum signal-to-noise ratio value that meets the image quality requirements; D e Indicates the minimum contrast value that meets the image quality requirements; According to the contrast target value, the contrast of the inner area of ​​the corresponding sliding local window is adjusted until the sliding local window traverses the image area occupied by the face.

8. The method for pain measurement based on facial image recognition according to claim 1, characterized in that: Retrieving a deep learning model that has been trained and tested from a database, and using the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result, including: Retrieve the trained and tested deep learning model from the database; Inputting the image data after the image enhancement processing into the deep learning model that has completed training and testing; The deep learning model performs pain expression recognition on the image area occupied by the face of the image data after image enhancement processing, and obtains the pain level based on the pain expression recognition.

9. The method for pain measurement based on facial image recognition according to claim 8, characterized in that: The structure of the deep learning model that has been trained and tested is as follows: Input layer: used to input image data after image enhancement processing; Convolutional layers and activation layers: Multiple convolutional layers are used to extract low-level to high-level features in the image, and activation functions such as ReLU are used to help the model learn complex patterns; Pooling layer: used to use the maximum pooling layer to reduce the number of parameters and computation while keeping the important parts of the features; Fully connected layers: One or more fully connected layers for high-level reasoning from features extracted by the convolutional layers; Output layer: used to output the pain level and use the softmax activation function to classify pain expressions into different pain levels.

10. A pain measurement system based on facial image recognition, characterized in that: The pain measurement system based on facial image recognition comprises: A video data acquisition module is used to dynamically adjust the gain signal value of the camera sensor, and collect the video data corresponding to the target area in real time through the camera sensor arranged in the target area; An image enhancement processing module is used to perform image enhancement processing on the video data to obtain image data after image enhancement processing; A pain determination module is used to retrieve a deep learning model that has been trained and tested from a database, and use the deep learning model to perform pain expression recognition on the image data after the image enhancement process to obtain a pain determination result; The data sending module is used to mark the image data with the pain target when the pain determination result shows that the pain target appears in the target area, and send the image data to the mobile monitoring terminal.

Citation Information

Patent Citations

  • Illumination processing method and apparatus for human face identification, computer device and storage medium

    CN108197546A

  • Method and system for adaptively improving face image acquisition and storage medium

    CN110738142A

  • Pain recognition method and device based on facial expression, equipment and storage medium

    CN116434305A

  • Exposure parameter adjusting method and electronic equipment

    CN117651212A

  • Display apparatus and method of manufacturing the same

    KR1020210138843A