A Pain Measurement Method and System Based on Facial Image Recognition

By dynamically adjusting the camera sensor gain and image enhancement processing, combined with a deep learning model, the problems of image acquisition and expression recognition in different environments for facial image recognition pain measurement methods have been solved, achieving accurate pain assessment and real-time feedback.

CN119632506BActive Publication Date: 2025-12-02HEALTH HOPE (BEIJING) TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing pain measurement methods based on facial image recognition suffer from image acquisition quality issues due to varying lighting conditions and facial feature diversity in different environments. Furthermore, deep learning models are difficult to train and optimize, making it challenging to achieve real-time, efficient pain expression recognition and accurate feedback.

Method used

By dynamically adjusting the gain signal value of the camera sensor, video data is collected in real time and image enhancement processing is performed. Combined with a trained deep learning model, pain expression recognition is performed, and real-time feedback is achieved through a mobile monitoring terminal.

Benefits of technology

It improves the accuracy and reliability of pain assessment, can adapt to various pain expression characteristics in different environments, and realizes objective, real-time reflection and timely intervention of pain status.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119632506B_ABST
    Figure CN119632506B_ABST
Patent Text Reader

Abstract

This invention proposes a pain measurement method and system based on facial image recognition. The pain measurement method includes: dynamically adjusting the gain signal value of a camera sensor; acquiring video data corresponding to the target area in real time using camera sensors deployed in the target area; performing image enhancement processing on the video data to obtain enhanced image data; retrieving a trained and tested deep learning model from a database and using the deep learning model to perform pain expression recognition on the enhanced image data to obtain a pain determination result; when the pain determination result indicates the presence of a pain target within the target area, marking the image data containing the pain target and sending the image data to a mobile monitoring terminal. The system includes modules corresponding to the steps of the method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] Pain, as a subjective experience, is crucial for accurate assessment in medical diagnosis, treatment planning, and patient care. Traditional pain assessment methods rely primarily on patients' subjective descriptions and healthcare professionals' clinical observations, but these methods have several limitations. For example, patients may be unable to accurately express their pain due to language barriers, impaired consciousness, or limited cognitive abilities; and healthcare professionals may be influenced by personal experience, distraction, and other factors during pain assessments, leading to subjectivity and inconsistency in the results.

[0003] With the rapid development of computer vision and artificial intelligence technologies, pain measurement methods based on facial image recognition are gradually demonstrating their enormous potential in the field of pain assessment. These methods, by analyzing patients' facial expression features, can objectively and in real-time reflect their pain status, thereby improving the accuracy and reliability of pain assessment.

[0004] However, existing pain measurement methods based on facial image recognition still face several challenges. First, varying lighting conditions, camera performance, and the diversity of patient facial features can all affect image acquisition quality and facial recognition accuracy. Second, the complexity of pain expressions makes training and optimizing deep learning models particularly difficult, requiring large amounts of labeled data and meticulous model tuning. Furthermore, how to process and analyze image data in real-time and efficiently, and how to promptly communicate the recognition results to relevant personnel, are also pressing issues that current technology needs to address.

[0005] To address the aforementioned challenges, this invention proposes a pain measurement method based on facial image recognition. This method dynamically adjusts the gain signal value of the camera sensor to adapt to different lighting conditions, thereby improving the quality of image acquisition. Simultaneously, image enhancement processing techniques are used to preprocess the acquired video data, further improving image clarity and contrast, providing high-quality input data for subsequent pain expression recognition. Furthermore, this invention employs a well-trained and tested deep learning model for pain expression recognition. This model can accurately identify various pain expression features, thus improving the accuracy of pain assessment. Finally, this invention provides real-time feedback of pain recognition results through a mobile monitoring terminal, enabling medical personnel to respond quickly and take appropriate intervention measures. Summary of the Invention

[0006] This invention provides a pain measurement method and system based on facial image recognition to address the problems in the prior art:

[0007] A pain measurement method based on facial image recognition, the method comprising:

[0008] The gain signal value of the camera sensor is dynamically adjusted, and video data corresponding to the target area is collected in real time by the camera sensors deployed in the target area.

[0009] The video data is subjected to image enhancement processing to obtain image data after image enhancement processing;

[0010] Retrieve a trained and tested deep learning model from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement to obtain pain determination results;

[0011] When the pain assessment result indicates that a pain target exists within the target area, the image data containing the pain target is marked and sent to the mobile monitoring terminal.

[0012] Furthermore, the gain signal value of the camera sensor is dynamically adjusted, and video data corresponding to the target area is acquired in real time through camera sensors deployed in the target area, including:

[0013] Real-time monitoring of light intensity in the target area;

[0014] The gain signal value of the camera sensor is dynamically adjusted according to the light intensity in the monitored target area to obtain the target gain signal value;

[0015] The camera sensor is controlled to adjust the current gain according to the target gain signal value, and the camera sensor after gain adjustment is obtained;

[0016] The gain-adjusted camera sensors deployed in the target area collect video data corresponding to the target area in real time.

[0017] Furthermore, the gain signal value of the camera sensor is dynamically adjusted based on the light intensity in the monitored target area to obtain the target gain signal value, including:

[0018] Extract the light intensity in the current target area;

[0019] The light intensity in the current target area is compared with a preset first light intensity threshold and a second light intensity threshold;

[0020] 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, the target gain signal value is obtained using the first gain adjustment strategy.

[0021] When the light intensity in the current target area is lower than the preset second light intensity threshold, the target gain signal value is obtained using the second gain adjustment strategy.

[0022] Furthermore, the first gain adjustment strategy is as follows:

[0023] 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;

[0024] Extract the first theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the first light intensity threshold, and the second theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the second light intensity threshold;

[0025] 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 compared with the first theoretical signal-to-noise ratio to obtain the 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.

[0026] 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 compared with the second theoretical signal-to-noise ratio to obtain the 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.

[0027] The first gain adjustment coefficient is obtained using the first signal-to-noise ratio difference and the second signal-to-noise ratio difference;

[0028] The first gain adjustment coefficient is obtained by the following formula:

[0029]

[0030] Among them, K 01 β0 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 Indicates the first signal-to-noise ratio difference; S c02 The second signal-to-noise ratio difference is represented; k represents the rate of change of light intensity corresponding to the current target area; S b I represents the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target region; 02I represents the second light intensity threshold; I represents the light intensity in the current target area; I b f represents the standard deviation of light intensity variation in the current target area; 01 Let represent the first gain adjustment factor, and the first gain adjustment factor is obtained by the following formula:

[0031]

[0032] 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 photosensitivity of the camera sensor; I 01 Indicates the first light intensity threshold; I 02 I represents the second light intensity threshold; I represents the light intensity in the current target area; I r This indicates the maximum variation in light intensity occurring in the current target area;

[0033] Retrieve the current gain value of the camera sensor;

[0034] The target gain signal value is obtained by combining the first gain adjustment coefficient with the current gain value of the camera sensor;

[0035] The target gain signal value is obtained using the following formula:

[0036]

[0037] Among them, X 01 K represents the target gain signal value obtained from the first gain adjustment coefficient. 01 X represents the first gain adjustment coefficient; d This indicates the current gain value of the camera sensor.

[0038] Furthermore, the second gain adjustment strategy is as follows:

[0039] 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;

[0040] The signal-to-noise ratio (SNR) of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area is compared with a preset SNR reference value to obtain the SNR difference between 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 SNR reference value.

[0041] The second gain adjustment coefficient is obtained by using the signal-to-noise ratio difference between 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;

[0042] The second gain adjustment coefficient is obtained by the following formula:

[0043]

[0044] Among them, K 02 β0 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 S represents the signal-to-noise ratio (SNR) difference between the frame image data of the video data acquired by the camera sensor under the current light intensity in the target area and the preset SNR reference value; k represents the rate of change of light intensity corresponding to the current target area; S b f represents the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target region; 02 Let represent the second gain adjustment factor, and the second gain adjustment factor is obtained by the following formula:

[0045]

[0046] 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 ISO represents the average light intensity in the target area; I represents the sensitivity of the camera sensor; 01 Indicates the first light intensity threshold; I 02 I represents the second light intensity threshold; I represents the light intensity in the current target area; I r This indicates the maximum variation in light intensity occurring in the current target area;

[0047] Retrieve the current gain value of the camera sensor;

[0048] The target gain signal value is obtained by combining the second gain adjustment coefficient with the current gain value of the camera sensor;

[0049] The target gain signal value is obtained using the following formula:

[0050]

[0051] Among them, X 02 K represents the target gain signal value obtained by the second gain adjustment coefficient. 02 X represents the second gain adjustment coefficient;d This indicates the current gain value of the camera sensor.

[0052] Further, image enhancement processing is performed on the video data to obtain image data after image enhancement processing, including:

[0053] Perform frame processing on the video data to obtain the frame image data corresponding to the video data;

[0054] Extract the area of ​​the face region in the frame image data;

[0055] Extract the signal-to-noise ratio value of the frame image data;

[0056] A sliding local window is set based on the area of ​​the image region occupied by the human face and the signal-to-noise ratio of the frame image data; wherein, the size of the sliding local window is obtained by the following formula:

[0057]

[0058] Where G represents the size of the sliding local window, and the size of the sliding local window is rounded up; X d Indicates the current gain value of the camera sensor; X represents the target gain signal value; G b S 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 area of ​​the image region occupied by the human face in the frame image data; s S represents the image area of ​​the frame image data; e This represents the minimum signal-to-noise ratio value required to meet image quality requirements; I b Indicates the standard deviation of light intensity variation in the current target area; I p This represents the average light intensity in the target area;

[0059] The sliding local window is controlled to slide in the image area occupied by the face, and the local contrast of the image area occupied by the face traversed by the sliding local window is adjusted during the sliding process to obtain contrast-adjusted frame image data, wherein the contrast-adjusted frame image data is the image data after image enhancement processing.

[0060] Furthermore, during the sliding process, local contrast adjustment is performed on the image area occupied by the face traversed by the sliding local window, including:

[0061] During the sliding of the local window over the image area occupied by the face, the contrast value of the area inside the sliding local window is collected in real time.

[0062] Real-time acquisition of the signal-to-noise ratio value corresponding to the internal region of the sliding local window;

[0063] The target contrast value for the inner region of the sliding local window is obtained using the contrast value and the signal-to-noise ratio value corresponding to the inner region of the sliding local window; wherein, the target contrast value is obtained by the following formula:

[0064]

[0065] Among them, D t D represents the target contrast value; n represents the overall image contrast corresponding to the frame image data; n represents the number of times the sliding local window is traversed; S represents the target contrast value. zi S represents the signal-to-noise ratio (SNR) value of the region inside the sliding local window corresponding to the i-th sliding of the sliding local window; D represents the SNR value of the frame image data; zi S represents the contrast value of the area inside the sliding local window corresponding to the i-th sliding motion of the local window; e D represents the minimum signal-to-noise ratio value required to meet image quality requirements. e This represents the minimum contrast value required to meet image quality requirements.

[0066] The contrast of the corresponding sliding local window is adjusted according to the target contrast value until the sliding local window traverses the image area occupied by the face.

[0067] Furthermore, a deep learning model that has been trained and tested is retrieved from the database, and the deep learning model is used to perform pain expression recognition on the image data after image enhancement processing to obtain pain determination results, including:

[0068] Retrieve the trained and tested deep learning model from the database;

[0069] The image data after image enhancement is input into a deep learning model that has been trained and tested.

[0070] The deep learning model performs pain expression recognition on the facial area of ​​the image data after image enhancement, and obtains the pain level based on the pain expression recognition.

[0071] Furthermore, the structure of the deep learning model that has completed training and testing is as follows:

[0072] Input layer: Used to input image data after image enhancement processing;

[0073] Convolutional and activation layers: Multiple convolutional layers are used to extract low- to high-level features from the image, and activation functions such as ReLU are used to help the model learn complex patterns;

[0074] Pooling layers: Used to reduce the number of parameters and computational cost while preserving important parts of the features;

[0075] Fully connected layer: One or more fully connected layers are used for advanced inference from features extracted from convolutional layers;

[0076] Output layer: Used to output pain levels, using the softmax activation function to classify pain expressions into different pain levels.

[0077] A pain measurement system based on facial image recognition, the system comprising:

[0078] The video data acquisition module is used to dynamically adjust the gain signal value of the camera sensor, and to collect video data corresponding to the target area in real time through the camera sensors deployed in the target area.

[0079] An image enhancement processing module is used to perform image enhancement processing on the video data to obtain image data after image enhancement processing;

[0080] The pain determination module is used to retrieve a deep learning model that has been trained and tested from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement processing to obtain the pain determination result.

[0081] The data transmission module is used to mark the image data containing the pain target when the pain determination result indicates that a pain target exists in the target area, and then send the image data to the mobile monitoring terminal.

[0082] Beneficial effects of this invention:

[0083] This invention proposes a pain measurement method and system based on facial image recognition. This method objectively and in real-time reflects a patient's pain state, avoiding the subjectivity and inconsistency of traditional pain assessment methods. Furthermore, the introduction of a deep learning model further improves the accuracy of pain expression recognition, making the pain assessment results 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 various pain expression features, making the above technical solution highly adaptable to different environments and application scenarios. Real-time feedback of pain recognition results is achieved through a mobile monitoring terminal, allowing medical staff to respond quickly and take appropriate intervention measures. This helps to alleviate patients' pain in a timely manner 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, providing more patients with timely and accurate pain assessment services. Attached Figure Description

[0084] Figure 1 This is a flowchart of the method described in this invention;

[0085] Figure 2 This is a system block diagram of the system described in this invention. Detailed Implementation

[0086] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0087] This 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:

[0088] S1. 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; 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.

[0089] S2. Perform image enhancement processing on the video data to obtain image data after image enhancement processing;

[0090] S3. Retrieve the deep learning model that has been trained and tested from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement processing to obtain pain determination results.

[0091] S4. When the pain determination result indicates that a pain target appears in the target area, the image data containing the pain target is marked and the image data is sent to the mobile monitoring terminal, wherein the mobile monitoring terminal includes, but is not limited to, smartphones, laptops, etc.

[0092] The working principle of the above technical solution is as follows: This solution aims to ensure that the camera sensor can acquire clear, high-quality video data under different lighting conditions. By dynamically adjusting the gain signal value, the camera sensor can adapt to lighting changes in various target areas, such as medical institutions, home environments, and clinical research environments, thereby ensuring that the acquired video data has sufficient brightness and contrast, providing a good foundation for subsequent image enhancement processing and pain expression recognition. Using camera sensors deployed in the target area, video data containing the patient's face is acquired in real time. These camera sensors use high-performance image sensors such as CMOS or CCD, ensuring that the acquired video data has sufficient resolution and clarity. Image enhancement processing is performed on the acquired video data to improve image clarity and contrast. This technical solution helps eliminate image quality problems caused by insufficient lighting, noise interference, etc., providing higher-quality input data for subsequent pain expression recognition. A deep learning model that has been trained and tested is retrieved from the database. This model has been trained and optimized with a large amount of pain expression image data and can accurately identify various pain expression features. The model is then used to perform pain expression recognition on the image data after image enhancement processing to obtain pain assessment results. When pain assessment results indicate the presence of a pain target within the target area, the image data containing the pain target is marked. These marked image data are then sent to mobile monitoring terminals, such as smartphones and laptops, so that medical staff can promptly obtain pain information and take appropriate intervention measures.

[0093] The above technical solution offers the following advantages: By employing a pain measurement method based on facial image recognition, it can objectively and in real-time reflect the patient's pain state, avoiding the subjectivity and inconsistency inherent in traditional pain assessment methods. Furthermore, the introduction of deep learning models further improves the accuracy of pain expression recognition, making the pain assessment results more reliable. This 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 various pain expression features, making the above technical solution highly adaptable to different environments and application scenarios. Real-time feedback of pain recognition results via mobile monitoring terminals allows medical staff to respond quickly and take appropriate intervention measures. This helps to alleviate patients' pain promptly and improve the efficiency and quality of medical services. This 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 will help promote the popularization and application of pain assessment technology, providing more patients with timely and accurate pain assessment services.

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

[0095] In one embodiment of the present invention, the gain signal value of the camera sensor is dynamically adjusted, and video data corresponding to the target area is acquired in real time by camera sensors deployed in the target area, including:

[0096] S101. Real-time monitoring of light intensity in the target area;

[0097] S102. Dynamically adjust the gain signal value of the camera sensor according to the light intensity in the monitored target area to obtain the target gain signal value;

[0098] S103. Control the camera sensor to adjust the current gain according to the target gain signal value, and obtain the camera sensor after gain adjustment;

[0099] S104. Control the camera sensors with adjusted gain deployed in the target area to collect video data corresponding to the target area in real time.

[0100] The working principle of the above technical solution is as follows: The solution uses a light intensity sensor or other light detection device to monitor the light intensity in a target area in real time. A light intensity sensor is an electronic device that senses the strength of light; its core component is a photosensitive element, typically a photodiode or phototransistor. When light shines on the photosensitive element, it triggers the generation of a photocurrent, the magnitude of which is directly proportional to the light intensity. By measuring the magnitude of the photocurrent, the light intensity can be calculated.

[0101] Based on the real-time monitored light intensity, the system dynamically adjusts the gain signal value of the camera sensor. Gain is the gradient of this linear response. If the light intensity is weak, the system increases the gain signal value to improve the sensitivity of the camera sensor, ensuring clear video data can be acquired even in low-light environments. The system controls the camera sensor to make corresponding adjustments based on the calculated target gain signal value. This technical solution ensures that the camera sensor gain matches the current light intensity, thereby enabling the acquisition of high-quality video data. After the camera sensor gain adjustment is complete, the system controls it to begin real-time acquisition of video data corresponding to the target area. This video data will be used in subsequent steps such as image enhancement processing and pain expression recognition.

[0102] The advantages of the above technical solution are as follows: By dynamically adjusting the gain signal value of the camera sensor, this solution ensures the acquisition of clear, high-quality video data under varying light intensities. This contributes to the accuracy of subsequent image enhancement processing and pain expression recognition. The solution automatically adapts to environments with different light intensities, achieving dynamic gain adjustment without manual intervention. This enhances the system's adaptability and flexibility, enabling stable operation in various complex environments. By acquiring high-quality video data in real time, this solution provides users with clearer and more accurate pain assessment results. This helps increase user trust and satisfaction with the system. Because the system automatically adapts to changes in light intensity, frequent replacement of the camera sensor or other maintenance is unnecessary. This reduces system maintenance and operating costs.

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

[0104] In one embodiment of the present invention, dynamically adjusting the gain signal value of a camera sensor based on the light intensity in the monitored target area to obtain a target gain signal value includes:

[0105] S1021. Extract the light intensity in the current target area;

[0106] S1022. Compare the light intensity in the current target area with a preset first light intensity threshold and a preset second light intensity threshold;

[0107] 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, the target gain signal value is obtained using the first gain adjustment strategy.

[0108] S1024. When the light intensity in the current target area is lower than the preset second light intensity threshold, the target gain signal value is obtained by using the second gain adjustment strategy.

[0109] The working principle of the above technical solution is as follows: This step acquires the current light intensity data of the target area in real time through a light sensor or other light detection device. This data forms the basis for subsequent comparisons and adjustments. The extracted current light intensity is compared with a preset first light intensity threshold and a second light intensity threshold. These two thresholds are preset based on factors such as the performance of the camera sensor, the lighting conditions of the target area, and the expected image quality.

[0110] When the current light intensity is below the first light intensity threshold but above the second light intensity threshold, the light intensity is considered to be in the moderately weak range. In this case, the system calculates an appropriate gain signal value based on the first gain adjustment strategy to improve the sensitivity of the camera sensor, thereby ensuring relatively clear video data can be acquired even in low-light environments. When the current light intensity is below the second light intensity threshold, the light intensity is considered to be very weak, possibly close to or below the minimum operating illuminance of the camera sensor. In this case, the system calculates 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 excessively high gain may lead to increased image noise; therefore, a balance needs to be found between improving sensitivity and maintaining image quality.

[0111] The above technical solution achieves the following results: By dynamically adjusting the gain signal value of the camera sensor, this solution ensures the acquisition of relatively clear video data under varying light intensities. This helps improve the accuracy of subsequent image enhancement processing and pain expression recognition. The solution automatically adapts to environments with different light intensities, achieving dynamic gain adjustment without manual intervention. This enhances the system's adaptability and flexibility, enabling stable operation in various complex environments. By setting different gain adjustment strategies, this solution optimizes the resource utilization of the camera sensor while maintaining image quality. For example, in moderate light conditions, a lower gain reduces image noise and power consumption; while in very low light conditions, a higher gain ensures image clarity. Because the system automatically adapts to changes in light intensity and adjusts the gain, users do not need to worry about the impact of light variations on video acquisition quality. This helps increase user trust and satisfaction with the system.

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

[0113] In one embodiment of the present invention, the first gain adjustment strategy is as follows:

[0114] Step 1a: 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;

[0115] Step 2a: Extract the first theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the first light intensity threshold, and the second theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the second light intensity threshold;

[0116] Step 3a: Compare the signal-to-noise ratio (SNR) 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 SNR to obtain the first SNR difference between the SNR 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 SNR.

[0117] Step 4a: Compare the signal-to-noise ratio (SNR) 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 SNR to obtain the second SNR difference between the SNR 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 SNR.

[0118] Step 5a: Obtain the first gain adjustment coefficient using the first signal-to-noise ratio difference and the second signal-to-noise ratio difference;

[0119] The first gain adjustment coefficient is obtained by the following formula:

[0120]

[0121] Among them, K 01 β0 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 Indicates the first signal-to-noise ratio difference; S c02 The second signal-to-noise ratio difference is represented; k represents the rate of change of light intensity corresponding to the current target area; S b I represents the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target region; 02I represents the second light intensity threshold; I represents the light intensity in the current target area; I b f represents the standard deviation of light intensity variation in the current target area; 01 Let represent the first gain adjustment factor, and the first gain adjustment factor is obtained by the following formula:

[0122]

[0123] 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 photosensitivity of the camera sensor; I 01 Indicates the first light intensity threshold; I 02 I represents the second light intensity threshold; I represents the light intensity in the current target area; I r This indicates the maximum variation in light intensity occurring in the current target area;

[0124] Step 6a: Retrieve the current gain value of the camera sensor;

[0125] Step 7a: Obtain the target gain signal value by combining the first gain adjustment coefficient with the current gain value of the camera sensor;

[0126] The target gain signal value is obtained using the following formula:

[0127]

[0128] Among them, X 01 K represents the target gain signal value obtained from the first gain adjustment coefficient. 01 X represents the first gain adjustment coefficient; d This indicates the current gain value of the camera sensor.

[0129] The working principle of the above technical solution is as follows: First, extract the signal-to-noise ratio (SNR) of the frame image data of the video data acquired by the camera sensor under the current light intensity in the target area. Simultaneously, extract the theoretical SNR of the frame image data of the video data corresponding to the preset first light intensity threshold and second light intensity threshold.

[0130] The signal-to-noise ratio (SNR) of the video data under the current light intensity is compared with the first theoretical SNR to obtain the first SNR difference. The SNR of the video data under the current light intensity is then compared with the second theoretical SNR to obtain the second SNR difference. Based on the first SNR difference, the second SNR difference, the rate of change of light intensity corresponding to the current target region, the standard deviation of the SNR of the image data corresponding to the currently obtained target region, the second light intensity threshold, the light intensity in the current target region, the standard deviation of the light intensity change in the current target region, and the first gain adjustment factor calculated through a complex formula, a first gain adjustment coefficient is calculated.

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

[0132] The above technical solution achieves the following results: By dynamically adjusting the gain signal value of the camera sensor, this solution ensures high-quality video data acquisition under varying light intensities. Signal-to-noise ratio (SNR), a crucial indicator of image quality, can significantly improve image clarity and accuracy by optimizing the SNR difference. This solution automatically adapts to environments with different light intensities, achieving dynamic gain adjustment without manual intervention. This enhances the system's adaptability and flexibility, enabling stable operation in various complex environments. By precisely calculating the gain adjustment coefficient and gain adjustment factor, this solution optimizes camera sensor resource utilization while maintaining image quality. This helps reduce power consumption, extend device lifespan, and decrease maintenance costs. Because the system automatically adapts to changes in light intensity and adjusts the gain, users do not need to worry about the impact of lighting variations on video acquisition quality. This helps increase user trust and satisfaction with the system, thereby enhancing the user experience.

[0133] On the other hand, this technical solution can adaptively adjust the gain of the camera sensor based on the light intensity in the current target area. By extracting the signal-to-noise ratio (SNR) of the video data frame image under the current light intensity and comparing it with the theoretical SNR corresponding to a preset light intensity threshold, the image quality under the current lighting conditions can be accurately evaluated. By calculating the first SNR difference and the second SNR difference, and using these differences to obtain the first gain adjustment coefficient, this solution can accurately adjust the gain of the camera sensor to improve image quality. This helps maintain image clarity and detail in environments with complex lighting changes. This technical solution introduces multiple parameters (such as the second enhancement adjustment factor, the first enhancement adjustment factor, and the rate of change of light intensity) to calculate the first gain adjustment coefficient and the target gain signal value, achieving intelligent gain adjustment. This adjustment method is more accurate and efficient than traditional manual adjustment. The formulas and parameters in this solution have a certain degree of flexibility and can be adjusted according to different application scenarios and needs. 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 lighting conditions and camera sensor performance. By dynamically adjusting the gain of the camera sensor, this technical solution can improve its adaptability under different lighting conditions. This helps extend the lifespan of camera sensors and reduces image quality degradation caused by changes in lighting. For applications that rely on cameras for surveillance, photography, or video calls, this technology significantly optimizes the user experience. By improving image quality and stability, users can see details in target areas more clearly, enabling them to make more accurate judgments and decisions.

[0134] In summary, this technical solution offers a more precise, efficient, and intelligent solution for adjusting camera sensor gain by leveraging advantages such as adaptive light intensity adjustment, improved image quality, intelligent adjustment, flexibility, enhanced camera sensor adaptability, and optimized user experience. Furthermore, by comprehensively considering the relationship between light intensity, signal-to-noise ratio, and gain adjustment coefficients, this solution achieves dynamic adjustment of the camera sensor gain signal value. This improves image quality, enhances system adaptability, optimizes resource utilization, and improves the user experience.

[0135] In one embodiment of the present invention, the second gain adjustment strategy is as follows:

[0136] Step 1b: 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;

[0137] Step 2b: Compare the signal-to-noise ratio (SNR) 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 SNR reference value to obtain the SNR difference between the SNR 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 SNR reference value.

[0138] Step 3b: Obtain the second gain adjustment coefficient by using the signal-to-noise ratio difference between 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;

[0139] The second gain adjustment coefficient is obtained by the following formula:

[0140]

[0141] Among them, K 02 β0 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 S represents the signal-to-noise ratio (SNR) difference between the frame image data of the video data acquired by the camera sensor under the current light intensity in the target area and the preset SNR reference value; k represents the rate of change of light intensity corresponding to the current target area; S b f represents the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target region; 02 Let represent the second gain adjustment factor, and the second gain adjustment factor is obtained by the following formula:

[0142]

[0143] 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 ISO represents the average light intensity in the target area; I represents the sensitivity of the camera sensor; 01 Indicates the first light intensity threshold; I 02 I represents the second light intensity threshold; I represents the light intensity in the current target area; I r This indicates the maximum variation in light intensity occurring in the current target area;

[0144] Step 4b: Retrieve the current gain value of the camera sensor;

[0145] Step 5b: Obtain the target gain signal value by combining the second gain adjustment coefficient with the current gain value of the camera sensor;

[0146] The target gain signal value is obtained using the following formula:

[0147]

[0148] Among them, X 02 K represents the target gain signal value obtained by the second gain adjustment coefficient. 02 X represents the second gain adjustment coefficient; d This indicates the current gain value of the camera sensor.

[0149] The working principle of the above technical solution is as follows: Under the light intensity of the current target area, the signal-to-noise ratio (SNR) of the frame image data of the video data acquired by the camera sensor is extracted. The extracted SNR is compared with a preset SNR reference value, and the SNR difference between the two is calculated. Using the SNR difference, the rate of change of light intensity corresponding to the current target area, the standard deviation of the SNR of the image data corresponding to the currently acquired target area, and a second gain adjustment factor calculated by a complex formula, a second gain adjustment coefficient is calculated. The calculation of the second gain adjustment factor also involves factors such as a first enhancement adjustment factor, the average light intensity in the target area, the photosensitivity of the camera sensor, a preset first light intensity threshold, a 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 as the basis for calculating the target gain signal value. Using the second gain adjustment coefficient and the gain value of the current camera sensor, the target gain signal value is calculated using a formula.

[0150] The above technical solution achieves the following results: In extremely low light intensity, by dynamically adjusting the gain signal value of the camera sensor, the signal-to-noise ratio of video data can be significantly improved, thereby enhancing image clarity and detail. This solution can automatically adapt to environments with varying light intensities. Especially in extremely low light conditions, by precisely calculating the gain adjustment coefficient, it ensures stable operation of the camera sensor, improving the system's adaptability and robustness. Precisely calculating the gain adjustment coefficient optimizes camera sensor resource utilization, reduces power consumption, and extends device lifespan while maintaining image quality. In extremely low light environments, users can obtain high-quality images without manually adjusting camera settings, enhancing user experience and satisfaction.

[0151] Simultaneously, this technical solution can adaptively adjust the gain of the camera sensor based on the light intensity of the current target area and the signal-to-noise ratio (SNR) of the video data frame image acquired by the camera sensor. This adaptive adjustment mechanism ensures that the camera sensor can output high-quality images under different lighting conditions. By comparing the SNR of the video data frame image under the current light intensity with a preset SNR reference value, and calculating a second gain adjustment coefficient based on the SNR difference, this solution can precisely adjust the gain of the camera sensor, thereby improving image quality. This helps reduce noise and blur in the image, and improve image clarity and detail. This technical solution introduces multiple parameters (such as a second enhancement adjustment factor, a first enhancement adjustment factor, and the rate of change of light intensity) to calculate the second gain adjustment coefficient and the target gain signal value, realizing intelligent gain adjustment. Furthermore, these parameters have a certain degree of flexibility and can be adjusted according to different application scenarios and needs to adapt to different lighting conditions and camera sensor performance. By dynamically adjusting the gain of the camera sensor, this technical solution can significantly enhance its adaptability under different lighting conditions. This helps extend the lifespan of the camera sensor and reduce image quality degradation caused by changes in light. For applications relying on cameras for monitoring, shooting, or video calls, this technical solution significantly optimizes the user experience. By improving image quality and stability, users can see details of the target area more clearly, enabling them to make more accurate judgments and decisions. Compared to traditional gain adjustment methods, this solution reduces system complexity and debugging difficulty by introducing intelligent gain adjustment strategies and parameterized calculation formulas. This makes adjusting the camera sensor gain simpler, more efficient, and more reliable.

[0152] In summary, this technical solution offers a more precise, efficient, and intelligent solution for adjusting camera sensor gain through its advantages in adaptive gain adjustment, improved image quality, intelligence and flexibility, enhanced camera sensor adaptability, optimized user experience, and reduced system complexity. Furthermore, by comprehensively considering multiple factors and dynamically adjusting the camera sensor's gain signal value, this solution achieves high-quality image acquisition in extremely low-light environments, improving system adaptability and robustness, optimizing resource utilization, reducing power consumption, and enhancing the user experience.

[0153] In one embodiment of the present invention, image enhancement processing is performed on the video data to obtain image data after image enhancement processing, including:

[0154] S201. Perform frame processing on the video data to obtain the frame image data corresponding to the video data;

[0155] S202. Extract the area of ​​the image region occupied by the human face in the frame image data;

[0156] S203. Extract the signal-to-noise ratio value of the frame image data;

[0157] S204. A sliding local window is set based on the area of ​​the image region occupied by the human face and the signal-to-noise ratio of the frame image data; wherein, the size of the sliding local window is obtained by the following formula:

[0158]

[0159] Where G represents the size of the sliding local window, and the size of the sliding local window is rounded up; X d Indicates the current gain value of the camera sensor; X represents the target gain signal value; G b S 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 area of ​​the image region occupied by the human face in the frame image data; s S represents the image area of ​​the frame image data; e This represents the minimum signal-to-noise ratio value required to meet image quality requirements; I b Indicates the standard deviation of light intensity variation in the current target area; I p This represents the average light intensity in the target area;

[0160] S205. Control the sliding local window to slide in the image area occupied by the face, and adjust the local contrast of the image area occupied by the face through which the sliding local window passes during the sliding process to obtain the contrast-adjusted frame image data, wherein the contrast-adjusted frame image data is the image data after image enhancement processing.

[0161] The working principle of the above technical solution is as follows: Video data is processed frame by frame, breaking it down into a series of frame image data. This is the foundation of image enhancement processing, as image enhancement is typically performed on a single frame. Within each frame, the area occupied by the face is extracted. This usually involves face detection algorithms to determine the position and size of the face in the image. The signal-to-noise ratio (SNR) of each frame is then calculated. SNR is an important indicator of image quality, reflecting the ratio of signal to noise in the image.

[0162] The size of the sliding local window is set based on the area of ​​the face in the image and the signal-to-noise ratio (SNR) of the frame image data. This window is used for local contrast adjustment in the face area. The window size is calculated using a complex formula, taking into account multiple factors such as the camera sensor gain, the target gain signal value, the preset base sliding local window size, the SNR of the frame image data, the area of ​​the face in the image, the image area of ​​the frame image data, the minimum SNR required to meet image quality requirements, the standard deviation of 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 across the image area occupied by the face, and local contrast adjustment is performed on the face area traversed by the window during the sliding process. This typically involves the redistribution or adjustment of pixel values ​​within the window to enhance the local contrast of the image, making the face area clearer and more prominent.

[0163] The effects of the above technical solution are as follows: By adjusting local contrast, the clarity of facial regions can be significantly improved, making facial features more distinct and easier to recognize. Considering multiple factors such as signal-to-noise ratio and light intensity, this technical solution can automatically adjust the size of the sliding local window and the parameters of contrast adjustment, thus obtaining high-quality images under different lighting conditions. By using local processing rather than global processing, this technical solution can optimize the utilization of computing resources, reduce processing complexity, and improve processing speed. In application scenarios such as video calls and facial recognition, this technical solution can significantly improve the user experience because users can see facial regions more clearly, making communication and recognition easier. This technical solution can automatically adapt to different lighting conditions and changes in the size of facial regions, improving the system's adaptability and robustness.

[0164] In summary, this technical solution, by comprehensively considering multiple factors, achieves local contrast adjustment of the facial region in video data, thereby improving image quality and user experience, and enhancing the system's adaptability and robustness.

[0165] In one embodiment of the present invention, local contrast adjustment is performed on the image area occupied by the face traversed by the sliding local window during the sliding process, including:

[0166] S2051. During the sliding of the local window over the image area occupied by the face, the contrast value of the area inside the sliding local window is collected in real time.

[0167] S2052. Real-time acquisition of the signal-to-noise ratio value corresponding to the internal region of the sliding local window;

[0168] S2053. Obtain the target contrast value corresponding to the inner region of the sliding local window using the contrast value and the signal-to-noise ratio value corresponding to the inner region of the sliding local window; wherein, the target contrast value is obtained by the following formula:

[0169]

[0170] Among them, D t D represents the target contrast value; n represents the overall image contrast corresponding to the frame image data; n represents the number of times the sliding local window is traversed; S represents the target contrast value. zi S represents the signal-to-noise ratio (SNR) value of the region inside the sliding local window corresponding to the i-th sliding of the sliding local window; D represents the SNR value of the frame image data; zi S represents the contrast value of the area inside the sliding local window corresponding to the i-th sliding motion of the local window; e D represents the minimum signal-to-noise ratio value required to meet image quality requirements. e This represents the minimum contrast value required to meet image quality requirements.

[0171] S2054. Adjust the contrast of the corresponding sliding local window area according to the contrast target value until the sliding local window traverses the image area occupied by the face.

[0172] The working principle of the above technical solution is as follows: During the process of sliding a local window to traverse the image area occupied by the face, the contrast and signal-to-noise ratio (SNR) values ​​of the area within the window are collected in real time for each slide. These values ​​reflect the image quality and contrast of the area within the window. Using the real-time collected contrast and SNR values, as well as parameters such as the overall image contrast and SNR values ​​of the frame image data, the minimum SNR value required to meet image quality requirements, and the minimum contrast value, a target contrast value is calculated using a formula. This value is determined based on the image quality of the current area within the window and the overall image quality requirements, aiming to achieve the optimal local contrast after adjustment. The contrast of the area within the window is adjusted according to the calculated target contrast value for each slide. This process is real-time and continues as the window slides until the entire image area occupied by the face has been traversed.

[0173] The above technical solution achieves the following effects: By acquiring contrast and signal-to-noise ratio (SNR) values ​​in real time and calculating and adjusting the target contrast value based on these values, the local contrast of the image area occupied by the face can be significantly improved. This makes facial features more distinct and enhances the visual effect of the image. Considering the impact of SNR and contrast on image quality, this technical solution can automatically adjust the local contrast to achieve the optimal contrast state while meeting the minimum SNR requirement. This helps improve the overall image quality, making it clearer and easier to observe. The technical solution can automatically adapt to different lighting conditions and changes in the size of the facial area, ensuring that image quality remains at a high level by acquiring and adjusting local contrast and SNR values ​​in real time. This enhances the system's adaptability and robustness, enabling its application in a wider range of scenarios. In applications such as video calls and facial recognition, this technical solution can significantly improve the user experience. By improving the local contrast of the facial area and the overall image quality, users can see the other person's facial features more clearly, making communication and recognition easier.

[0174] In summary, this technical solution optimizes the local contrast of the image region occupied by the human face by acquiring contrast and signal-to-noise ratio values ​​in real time and using these values ​​to calculate and adjust the target contrast value. This improves image quality, enhances the system's adaptability and robustness, and improves the user experience.

[0175] 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:

[0176] S301. Retrieve the trained and tested deep learning model from the database;

[0177] S302. Input the image data after image enhancement processing into the deep learning model that has been trained and tested;

[0178] S303. The deep learning model performs pain expression recognition on the image region occupied by the human face in the image data after image enhancement processing, and obtains the pain level based on the pain expression recognition.

[0179] The structure of the deep learning model that has completed training and testing is as follows:

[0180] Input layer: Used to input image data after image enhancement processing;

[0181] Convolutional layers and activation layers: Multiple convolutional layers are used to extract low- to high-level features from an image, and activation functions such as ReLU are used to help the model learn complex patterns;

[0182] Pooling layer: Used to reduce the number of parameters and computational cost by using max pooling layers, while preserving important parts of the features;

[0183] Fully connected layers (Dense Layers): One or more fully connected layers used for advanced inference from features extracted from convolutional layers;

[0184] Output layer: Used to output pain levels, using the softmax activation function to classify pain expressions into different pain levels.

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

[0186] The structure of a deep learning model is as follows:

[0187] Input layer: Receives image data after image enhancement processing.

[0188] Convolutional layers and activation layers: Features in an image are extracted through multiple convolutional layers, and activation functions such as ReLU are used to help the model learn complex patterns.

[0189] Pooling layer: Use max pooling layer to reduce the number of parameters and computational cost while preserving important parts of the features.

[0190] Fully connected layers: Perform advanced inference from features extracted from convolutional layers, preparing for the final classification task.

[0191] Output layer: The softmax activation function is used to classify pain expressions into different pain levels and output the pain determination results.

[0192] The above technical solution achieves the following results: by using a deep learning model, it can automatically learn the features of pain expressions and perform high-precision recognition. This significantly improves the accuracy of pain expression recognition, providing strong support for medical diagnosis. Through extensive training and testing, the deep learning model can learn pain characteristics under different lighting, angles, and facial expression changes, thereby enhancing the model's generalization ability. This allows the model to maintain stable performance in various practical application scenarios. This technical solution can automatically complete the pain expression recognition task without human intervention. Simultaneously, due to the high computational efficiency of deep learning models, real-time pain assessment can be achieved, providing timely feedback for clinical diagnosis and treatment. By obtaining pain assessment results, doctors can more accurately understand the patient's pain condition, thereby developing more appropriate treatment plans. This helps improve the accuracy and effectiveness of medical decisions.

[0193] In summary, this technical solution utilizes a deep learning model to recognize pain expressions from image data after image enhancement, offering advantages such as high accuracy, strong generalization ability, automation, and real-time performance, thus providing strong support for medical diagnosis and treatment.

[0194] This invention proposes 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:

[0195] The video data acquisition module is used to dynamically adjust the gain signal value of the camera sensor, and to collect video data corresponding to the target area in real time through camera sensors deployed in the target area; wherein, the target area includes, but is not limited to, medical institutions, home environments, and clinical research environments; and, the camera sensor includes, but is not limited to, CMOS and CCD.

[0196] An image enhancement processing module is used to perform image enhancement processing on the video data to obtain image data after image enhancement processing;

[0197] The pain determination module is used to retrieve a deep learning model that has been trained and tested from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement processing to obtain the pain determination result.

[0198] The data transmission module is used to mark the image data containing the pain target when the pain determination result indicates that a pain target exists in the target area, and to send the image data to the mobile monitoring terminal, wherein the mobile monitoring terminal includes, but is not limited to, smartphones, laptops, etc.

[0199] The working principle of the above technical solution is as follows: This solution aims to ensure that the camera sensor can acquire clear, high-quality video data under different lighting conditions. By dynamically adjusting the gain signal value, the camera sensor can adapt to lighting changes in various target areas, such as medical institutions, home environments, and clinical research environments, thereby ensuring that the acquired video data has sufficient brightness and contrast, providing a good foundation for subsequent image enhancement processing and pain expression recognition. Using camera sensors deployed in the target area, video data containing the patient's face is acquired in real time. These camera sensors use high-performance image sensors such as CMOS or CCD, ensuring that the acquired video data has sufficient resolution and clarity. Image enhancement processing is performed on the acquired video data to improve image clarity and contrast. This technical solution helps eliminate image quality problems caused by insufficient lighting, noise interference, etc., providing higher-quality input data for subsequent pain expression recognition. A deep learning model that has been trained and tested is retrieved from the database. This model has been trained and optimized with a large amount of pain expression image data and can accurately identify various pain expression features. The model is then used to perform pain expression recognition on the image data after image enhancement processing to obtain pain assessment results. When pain assessment results indicate the presence of a pain target within the target area, the image data containing the pain target is marked. These marked image data are then sent to mobile monitoring terminals, such as smartphones and laptops, so that medical staff can promptly obtain pain information and take appropriate intervention measures.

[0200] The above technical solution offers the following advantages: By employing a pain measurement method based on facial image recognition, it can objectively and in real-time reflect the patient's pain state, avoiding the subjectivity and inconsistency inherent in traditional pain assessment methods. Furthermore, the introduction of deep learning models further improves the accuracy of pain expression recognition, making the pain assessment results more reliable. This 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 various pain expression features, making the above technical solution highly adaptable to different environments and application scenarios. Real-time feedback of pain recognition results via mobile monitoring terminals allows medical staff to respond quickly and take appropriate intervention measures. This helps to alleviate patients' pain promptly and improve the efficiency and quality of medical services. This 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 will help promote the popularization and application of pain assessment technology, providing more patients with timely and accurate pain assessment services.

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

[0202] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends 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 includes: The gain signal value of the camera sensor is dynamically adjusted, and video data corresponding to the target area is collected in real time through the camera sensors deployed in the target area. The video data is subjected to image enhancement processing to obtain image data after image enhancement processing; Retrieve a trained and tested deep learning model from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement to obtain pain determination results; When the pain determination result indicates that a pain target has appeared in the target area, the image data containing the pain target is marked and the image data is sent to the mobile monitoring terminal; Perform image enhancement processing on the video data to obtain image data after image enhancement processing, including: Perform frame processing on the video data to obtain the frame image data corresponding to the video data; Extract the area of ​​the face region in the frame image data; Extract the signal-to-noise ratio value of the frame image data; A sliding local window is set based on the area of ​​the image region occupied by the human face and the signal-to-noise ratio of the frame image data; wherein, the size of the sliding local window is obtained by the following formula: in, G This represents the size of the sliding local window, and the size of the sliding local window is rounded up. X d This indicates the current gain value of the camera sensor; X Indicates the value of the target gain signal; G b This indicates the size of the preset base sliding local window; S This represents the signal-to-noise ratio value of the frame image data; A f This represents the area of ​​the image region occupied by the human face in the frame image data; A s The image area represents the frame image data; S e This represents the minimum signal-to-noise ratio value required to meet image quality requirements. I b This represents the standard deviation of light intensity variation in the current target area; I p This represents 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 of the image area occupied by the face traversed by the sliding local window is adjusted during the sliding process to obtain contrast-adjusted frame image data, wherein the contrast-adjusted frame image data is the image data after image enhancement processing.

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 video data corresponding to the target area is acquired in real time through camera sensors deployed in the target area, including: Real-time monitoring of light intensity in the target area; The gain signal value of the camera sensor is dynamically adjusted according to the light intensity in the monitored target area to obtain the target gain signal value; The camera sensor is controlled to adjust the current gain according to the target gain signal value, and the camera sensor after gain adjustment is obtained; The gain-adjusted camera sensors deployed in the target area collect video data corresponding to the target area in real time.

3. The pain measurement method based on facial image recognition according to claim 2, characterized in that, The gain signal value of the camera sensor is dynamically adjusted based on the light intensity in the monitored target area to obtain the target gain signal value, including: Extract the light intensity in the current target area; The light intensity in the current target area is compared 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, the target gain signal value is obtained using the first gain adjustment strategy. When the light intensity in the current target area is lower than the preset second light intensity threshold, the target gain signal value is obtained using the second gain adjustment strategy.

4. The pain measurement method 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; Extract the first theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the first light intensity threshold, and the second theoretical signal-to-noise ratio of the frame image data of the video data corresponding to the second light intensity threshold; 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 compared with the first theoretical signal-to-noise ratio to obtain the 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. 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 compared with the second theoretical signal-to-noise ratio to obtain the 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. The first gain adjustment coefficient is obtained 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: in, K 01 This represents the first gain adjustment coefficient; β 0 represents the second enhancement regulation factor, and the value range of the second enhancement regulation factor is 1.28-2.81; S c01 This represents the first signal-to-noise ratio difference; S c02 This represents the second signal-to-noise ratio difference; k This represents the rate of change of light intensity in the current target area; S b This represents the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target region; I 02 Indicates the second light intensity threshold; I This indicates the light intensity in the current target area; I b This represents the standard deviation of light intensity variation in the current target area; f 01 Let represent the first gain adjustment factor, and the first gain adjustment factor is obtained by the following formula: in, f 01 This represents the first gain adjustment factor; α 0 represents the first enhancement regulation factor, and the value range of the first enhancement regulation factor is 0.62-1.19; ISO Indicates the light sensitivity of the camera sensor; I 01 Indicates the first light intensity threshold; I 02 Indicates the second light intensity threshold; I This indicates the light intensity in the current target area; I r This indicates the maximum variation in light intensity occurring in the current target area; Retrieve the current gain value of the camera sensor; The target gain signal value is obtained by combining the first gain adjustment coefficient with the current gain value of the camera sensor; The target gain signal value is obtained using the following formula: in, X 01 This represents the target gain signal value obtained from the first gain adjustment coefficient; K 01 This represents the first gain adjustment coefficient; X d This indicates the current gain value of the camera sensor.

5. The pain measurement method 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; The signal-to-noise ratio (SNR) of the frame image data of the video data acquired by the camera sensor under the light intensity in the current target area is compared with a preset SNR reference value to obtain the SNR difference between 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 SNR reference value. The second gain adjustment coefficient is obtained by using the signal-to-noise ratio difference between 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; The second gain adjustment coefficient is obtained by the following formula: in, K 02 This represents the second gain adjustment coefficient; β 0 represents the second enhancement regulation factor, and the value range of the second enhancement regulation factor is 1.28-2.81; S c This represents the signal-to-noise ratio difference between the frame image data of the video data acquired by the camera sensor under the current light intensity in the target area and the preset signal-to-noise ratio reference value. k This represents the rate of change of light intensity in the current target area; S b This represents the standard deviation of the signal-to-noise ratio of the image data corresponding to the currently acquired target region; f 02 Let represent the second gain adjustment factor, and the second gain adjustment factor is obtained by the following formula: in, f 02 This represents the second gain adjustment factor; α 0 represents the first enhancement regulation factor, and the value range of the first enhancement regulation factor is 0.62-1.19; I p This represents the average light intensity in the target area; ISO Indicates the light sensitivity of the camera sensor; I 01 Indicates the first light intensity threshold; I 02 Indicates the second light intensity threshold; I This indicates the light intensity in the current target area; I r This indicates the maximum variation in light intensity occurring in the current target area; Retrieve the current gain value of the camera sensor; The target gain signal value is obtained by combining the second gain adjustment coefficient with the current gain value of the camera sensor; The target gain signal value is obtained using the following formula: in, X 02 This represents the target gain signal value obtained from the second gain adjustment coefficient; K 02 This represents the second gain adjustment coefficient; X d This indicates the current gain value of the camera sensor.

6. The pain measurement method based on facial image recognition according to claim 1, characterized in that, During the sliding process, local contrast adjustment is performed on the image area occupied by the face traversed by the sliding local window, including: During the sliding of the local window over the image area occupied by the face, the contrast value of the area inside the sliding local window is collected in real time. Real-time acquisition of the signal-to-noise ratio value corresponding to the internal region of the sliding local window; The target contrast value for the inner region of the sliding local window is obtained using the contrast value and the signal-to-noise ratio value corresponding to the inner region of the sliding local window; wherein, the target contrast value is obtained by the following formula: in, D t Indicates the target contrast value; D This represents the overall image contrast corresponding to the frame image data; n Indicates the number of times the local window is traversed; S zi Indicates the sliding local window's first... i The signal-to-noise ratio value corresponding to the internal area of ​​the sliding local window for each slide; S This represents the signal-to-noise ratio value of the frame image data; D zi Indicates the sliding local window's first... i The contrast value corresponding to the inner area of ​​the sliding window for each slide; S e This represents the minimum signal-to-noise ratio value required to meet image quality requirements. D e This represents the minimum contrast value required to meet image quality requirements. The contrast of the corresponding sliding local window is adjusted according to the target contrast value until the sliding local window traverses the image area occupied by the face.

7. The pain measurement method based on facial image recognition according to claim 1, characterized in that, Retrieve a pre-trained and tested deep learning model from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement, obtaining pain determination results, including: Retrieve the trained and tested deep learning model from the database; The image data after image enhancement is input into a deep learning model that has been trained and tested. The deep learning model performs pain expression recognition on the facial area of ​​the image data after image enhancement, and obtains the pain level based on the pain expression recognition.

8. The pain measurement method based on facial image recognition according to claim 7, characterized in that, The structure of a deep learning model that has completed training and testing is as follows: Input layer: Used to input image data after image enhancement processing; Convolutional and activation layers: Multiple convolutional layers are used to extract low- to high-level features from the image, and the ReLU activation function is used to help the model learn complex patterns; Pooling layers: Used to reduce the number of parameters and computational cost while preserving important parts of the features; Fully connected layer: One or more fully connected layers are used for advanced inference from features extracted from convolutional layers; Output layer: Used to output pain levels, using the softmax activation function to classify pain expressions into different pain levels.

9. A system for implementing the pain measurement method based on facial image recognition as described in claim 1, characterized in that, The pain measurement system based on facial image recognition includes: The video data acquisition module is used to dynamically adjust the gain signal value of the camera sensor, and to collect video data corresponding to the target area in real time through the camera sensors deployed 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; The pain determination module is used to retrieve a deep learning model that has been trained and tested from the database, and use the deep learning model to perform pain expression recognition on the image data after image enhancement processing to obtain the pain determination result. The data transmission module is used to mark the image data containing the pain target when the pain determination result indicates that a pain target exists in the target area, and then 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

  • Exposure parameter adjusting method and electronic equipment

    CN117651212A