A method and system for optimizing light therapy parameters for patients with depression
By screening and analyzing the edge changes of facial images, a time window is constructed to accurately identify the real keyframes of patients with depression, the problem of inaccurate adjustment of phototherapy parameters is solved and the phototherapy effect is improved.
Patent Information
- Application Number
- CN202510740703.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2045-06-05
AI Technical Summary
In the process of adjusting phototherapy parameters, the keyframes of facial mood changes in patients with depression cannot be accurately identified, resulting in inaccurate setting of phototherapy parameters.
By collecting facial images in real time, filtering out suspected keyframes, analyzing the edge changes of facial images, building a time window to be analyzed, combining the overall emotional expression degree and comprehensive emotional expression, judging the real keyframes and adjusting the phototherapy parameters.
Accurately identify the changes in the patient's facial mood, realize effective adjustment of phototherapy parameters, and improve the effect of phototherapy.
Smart Images

Figure CN120260836B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image feature analysis, and in particular to a method and system for optimizing light therapy parameters for patients with depression. Background Art
[0002] Light therapy for depression is a treatment method that simulates natural light exposure to improve depressive symptoms, particularly for patients with seasonal affective disorder (SAD) and some non-seasonal depression. With changes in modern lifestyles, especially in winter with insufficient sunlight or in high-latitude areas, more and more people are affected by insufficient light exposure, leading to symptoms such as low mood, fatigue, and depression. In this case, light therapy helps regulate the biological clock by providing light of sufficient intensity and specific wavelengths, improving melatonin and serotonin levels, thereby alleviating depressive symptoms. As a non-drug treatment, light therapy has gradually become an effective supplementary method for treating depression, especially when drug treatment is ineffective or has significant side effects.
[0003] The parameters of light therapy are usually set manually during or before treatment through fixed parameters. However, some patients are highly sensitive to light and will experience discomfort reactions to inappropriate light therapy parameters. If timely and effective adjustments are not made, the treatment will fail. Therefore, the existing technology can detect the patient's facial expressions in real time and judge the patient's facial emotional fluctuations to control the light therapy parameters. However, in the actual light therapy process, the changes in the patient's facial movements are more complicated due to the impact of the disease and light therapy parameters. During the emotion recognition process, it is impossible to accurately determine which frame image is the emotional key frame, and thus it is impossible to accurately determine the emotional fluctuations, and the setting of the light therapy parameters is inaccurate. Summary of the Invention
[0004] In order to solve the technical problem of inaccurate key frame recognition of patient facial emotion changes during the adjustment of light therapy parameters in the prior art, the purpose of the present invention is to provide a method and system for optimizing light therapy parameters for patients with depression. The technical solutions adopted are as follows:
[0005] The present invention proposes a method for optimizing light therapy parameters for patients with depression, the method comprising:
[0006] Real-time acquisition of facial images of patients undergoing phototherapy treatment for depression; screening of suspected key frames based on the image differences between adjacent frames;
[0007] In the facial image, edges with strong emotional expression are screened out based on the degree of similarity between the edges; the emotional expression degree of each edge with strong emotional expression in the suspected key frame is obtained based on the degree of difference between the same edge with strong emotional expression in the facial image of the suspected key frame and the previous frame; the emotional expression degrees of all edges with strong emotional expression in the suspected key frame are counted to obtain the overall emotional expression degree of the suspected key frame;
[0008] Selecting a time window to be analyzed after the suspected key frame according to the overall emotional expression level, and obtaining the comprehensive emotional expressivity of the suspected key frame according to the change and magnitude of the overall emotional expression level of each facial image in the time window to be analyzed;
[0009] Determine whether the suspected key frame is a real key frame based on the comprehensive emotional expressiveness and the overall emotional expression level; identify emotional tags for the real key frame and adjust the phototherapy parameters based on the emotional tags.
[0010] Furthermore, the method for screening out suspected key frames includes:
[0011] For each facial image, the information entropy difference between the facial image and the previous facial image is used as a discrimination index; if the discrimination index is greater than a preset discrimination threshold, the facial image is regarded as a suspected key frame; otherwise, it is regarded as a non-suspected key frame.
[0012] Furthermore, after determining that the key frame is not a suspected key frame, the following steps are also included:
[0013] Determine whether the register reaches the cache clearing time at the moment corresponding to the non-suspected key frame. If not, directly store the non-suspected key frame; if so, clear all facial image data in the register and then store the non-suspected key frame.
[0014] Furthermore, the method for screening the edge of strong emotional expression includes:
[0015] Take any edge in the facial image as the first target edge, and obtain the cosine similarity, length difference and centroid distance between the first target edge and other edges in a preset neighborhood; obtain the edge difference degree according to the length difference and centroid distance; obtain the edge uniformity between the first target edge and each other edge in the preset neighborhood according to the edge difference degree and the cosine similarity; accumulate the edge uniformity between the first target edge and all other edges in the preset neighborhood to obtain the emotional expression ability; if the emotional expression ability of the first target edge is greater than the preset expression ability threshold, then take the first target edge as the strong emotional expression edge; traverse all edges in the facial image to obtain all strong emotional expression edges.
[0016] Furthermore, the method for obtaining the degree of emotional expression includes:
[0017] Any strong emotion expression edge of the suspected key frame is used as the second target edge, and the strong emotion expression edge in the facial image of the previous frame is used as the comparison edge; the edge difference degree between the second target edge and all the comparison edges is obtained, and the comparison edge with the smallest edge difference degree is selected as the same strong emotion expression edge of the second target edge in the facial image of the previous frame; the emotion expression degree of the second target edge is obtained according to the cosine distance and length difference between the second target edge and the comparison edge with the smallest edge difference degree.
[0018] Furthermore, the method for obtaining the overall emotional expression level includes:
[0019] The average emotional expression degree of all strong emotional expression edges in the suspected key frame is obtained, the ratio of the emotional expression degree of each strong emotional expression edge to the average emotional expression degree is used as the data weight, the emotional expression degree of each strong emotional expression edge is weighted according to the data weight to obtain the weighted emotional expression degree; the average weighted emotional expression degree of all strong emotional expression edges is used as the overall emotional expression degree.
[0020] Furthermore, the method for selecting the time window to be analyzed includes:
[0021] The overall emotional expression degree of the suspected key frame is negatively mapped and normalized to obtain a time length weight, the time length weight is multiplied by the preset maximum time length, and the product is rounded down to obtain the window length of the time window to be analyzed. The moment corresponding to the suspected key frame is taken as the starting point, and the time window to be analyzed is selected according to the window length.
[0022] Furthermore, the method for obtaining the comprehensive emotional expressiveness includes:
[0023] Obtain the ratio of the overall emotional expression degree between the facial image at each moment in the time window to be analyzed and the suspected key frame; obtain the degree of intense emotional change at the corresponding moment based on the overall emotional expression degree ratio; use the degree of intense emotional change as a weight to perform weighted summation on the overall emotional expression degree at the corresponding moment to obtain the comprehensive emotional expressiveness.
[0024] Furthermore, judging whether the suspected key frame is a real key frame according to the comprehensive emotional expressiveness and the overall emotional expression degree includes:
[0025] The criticality of the suspected key frame is obtained according to the comprehensive emotional expressiveness and the overall emotional expression degree. If the criticality is greater than a preset criticality threshold, the suspected key frame is used as the real key frame.
[0026] The present invention also proposes a light therapy parameter optimization system for patients with depression, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, the system implements any one of the steps of the light therapy parameter optimization method for patients with depression.
[0027] The present invention has the following beneficial effects:
[0028] The embodiment of the present invention takes into account that emotional changes will cause changes in human facial expressions, and therefore, suspected key frames can be screened out based on the differences in facial images between adjacent frames. Further taking into account that the image changes in the suspected key frames may not be caused by emotional changes, the overall emotional expression level of the suspected key frames can be accurately evaluated by screening out the edges of strong emotional expression and analyzing their changes. Further, a time window to be analyzed is constructed based on the suspected key frames, and the comprehensive emotional expressiveness of the suspected key frames can be determined according to the changes in the overall emotional expression level within the time window to be analyzed. Further, combined with the overall emotional expression level, it can be accurately determined whether the suspected key frames are real key frames. After the real key frames are determined, accurate emotion label recognition can be performed and phototherapy parameters can be adjusted. The present invention accurately determines the facial emotional change characteristics of patients under phototherapy by analyzing the features of facial images and extracting feature changes in images, and then screens out accurate real key frames for effective phototherapy parameter adjustment. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art descriptions. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0030] Figure 1 This is a flow chart of a method for optimizing light therapy parameters for patients with depression provided by one embodiment of the present invention. DETAILED DESCRIPTION
[0031] To further illustrate the technical means and efficacy of the present invention to achieve its intended purpose, the following, in conjunction with the accompanying drawings and preferred embodiments, describes in detail a method and system for optimizing light therapy parameters for patients with depression, including its specific implementation, structure, features, and efficacy. In the following description, references to different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics of one or more embodiments may be combined in any suitable manner.
[0032] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.
[0033] The following describes in detail a method and system for optimizing light therapy parameters for patients with depression provided by the present invention with reference to the accompanying drawings.
[0034] See also Figure 1 , which shows a flow chart of a method for optimizing light therapy parameters for patients with depression provided by one embodiment of the present invention, the method comprising:
[0035] Step S1: real-time acquisition of facial images of patients during treatment of depression by light therapy equipment; screening out suspected key frames based on image differences of facial images between adjacent frames.
[0036] In an embodiment of the present invention, phototherapy parameters must be initially set and the acquisition device installed before the patient is treated with phototherapy. In this embodiment, the light intensity of the phototherapy device is selected to be between [2500 lux, 10000 lux]; the wavelength of the light source is set to be between [400, 700]; the total duration of the phototherapy is set to be between 20 and 30 minutes; the patient faces 40 centimeters from the phototherapy device, and the high-definition sensor camera is activated simultaneously with the phototherapy device to collect the patient's facial data. The collected video is then decomposed into frames using a video decomposition algorithm and stored in a register as independent frames.
[0037] If a patient's emotions change during phototherapy, it will definitely be reflected in their facial expressions. Therefore, by comparing the image differences of facial images between adjacent frames, suspected key frames can be screened out. That is, suspected key frames are frame images with more obvious facial image changes.
[0038] Because patients are emotionally sensitive, their tolerance for changes in the external environment is lower than that of normal people. Therefore, improper phototherapy parameters can cause fluctuations in the patient's performance. For example, excessive light intensity can cause discomfort and a painful expression on the face. Appropriate parameters can result in a relaxed and soothing expression. However, normal facial changes can also occur, such as blinking and pursing the lips. Therefore, a change in a patient's facial expression does not necessarily indicate a change in emotion. Therefore, it is not possible to directly use suspected keyframes for emotion recognition and control of phototherapy parameters. Further analysis is required in subsequent steps.
[0039] Preferably, in one embodiment of the present invention, because the suspected keyframe represents the changes in the patient's facial expression, for each frame of facial image, the difference in information entropy between the facial image and the previous frame of facial image is used as a discrimination index. Information entropy can characterize the distribution of information in an image. If at a certain moment the patient's expression changes significantly due to discomfort with the phototherapy parameters, a drastic expression such as a frown will appear, which will show more texture features in the image, thereby causing the information entropy to change. Therefore, the larger the discrimination index, the greater the expression changes between the two facial image frames. Therefore, if the discrimination index is greater than the preset discrimination threshold, the facial image is regarded as a suspected keyframe; otherwise, it is not a suspected keyframe.
[0040] In the embodiment of the present invention, the information entropy difference is the absolute value of the difference between the two information entropies. The discrimination threshold can be set according to the specific facial image quality, which is not limited or elaborated here.
[0041] Furthermore, in the embodiments of the present invention, the facial images of the patient collected are stored in a register, which has a fixed storage capacity. To ensure that the image processing process can proceed smoothly, the register is set to a regular clearing cycle. Therefore, after screening out non-suspected key frames, the embodiment of the present invention determines whether the register has reached the cache clearing time at the time corresponding to the non-suspected key frame. If not, the non-suspected key frame is directly stored; if so, all facial image data in the register is cleared and the non-suspected key frame is stored. By setting the storage space of the register through this method, it is possible to ensure that subsequent frame images have a data foundation for analysis while ensuring that the register has sufficient storage space.
[0042] Step S2: In the facial image, the edges with strong emotional expression are screened out based on the similarity between the edges; the emotional expression degree of each strong emotional expression edge in the suspected key frame is obtained based on the difference between the same strong emotional expression edge in the facial image of the suspected key frame and the previous frame; the emotional expression degrees of all strong emotional expression edges in the suspected key frame are counted to obtain the overall emotional expression degree of the suspected key frame.
[0043] Facial images contain multiple edge information formed by facial features and facial muscles. These edge information have the ability to express different emotions. For facial expressions with intense emotions, some edges between adjacent frames have more obvious changes. These edges that can strongly express emotions can serve as the basis for analyzing the degree of emotional expression of suspected key frames.
[0044] Typically, facial expressions often change from specific locations on the face, such as the corners of the eyes, mouth, and eyebrows, where facial muscles are densely packed. These areas are densely packed with facial muscles, so multiple muscles are required to coordinate and achieve a change in expression. This results in a high degree of consistency between the edges of these areas and other edges within the same area. Therefore, in facial images, embodiments of the present invention first filter out edges that strongly express emotion based on the degree of similarity between these edges.
[0045] Preferably, in an embodiment of the present invention, the method for screening edges of strong emotional expression includes:
[0046] Taking any edge in the facial image as the first target edge, the cosine similarity, length difference, and centroid distance between the first target edge and other edges in a preset neighborhood are obtained. A greater cosine similarity indicates a greater similarity between the two edges; a greater length difference and centroid distance indicate a greater morphological difference between the two edges. It should be noted that the determination of cosine similarity, length, and centroid distance are well-known techniques to those skilled in the art and will not be elaborated upon here.
[0047] The edge difference degree is obtained based on the length difference and centroid distance. Based on the edge difference degree and cosine similarity, the edge uniformity between the first target edge and each other edge in the preset neighborhood is obtained. That is, the greater the cosine similarity and the smaller the edge difference degree, the greater the edge uniformity between the two edges.
[0048] In one embodiment of the present invention, edge uniformity is expressed as:
[0049] ;in is the nth edge The first Other edges The edge uniformity between them, cos() is the cosine similarity calculation function, for length, for length, is the centroid distance between two edges.
[0050] The edge uniformity between the first target edge and all other edges in the preset neighborhood is accumulated to obtain the emotional expression ability; if the emotional expression ability of the first target edge is greater than the preset expression ability threshold, the first target edge is regarded as the strong emotional expression edge; all edges in the facial image are traversed to obtain all strong emotional expression edges.
[0051] In this embodiment of the present invention, with each edge as the center, a preset number of edges closest to the central edge constitute the neighborhood of the central edge. In this embodiment of the present invention, the preset number is set to 10. This means that there are a total of 10 other edges in the preset neighborhood. In this embodiment of the present invention, the emotional expressiveness of each edge is normalized and then the expressiveness threshold is set to 0.6.
[0052] It should be noted that edge extraction in facial images is a well-known technique for those skilled in the art. Each edge can be obtained by gray-scaling the facial image and then performing edge extraction. The specific algorithm is not described in detail here. The normalization method used in the embodiments of the present invention can be implemented using various normalization methods, such as range normalization and hyperbolic function mapping, and is not limited to or detailed in the embodiments of the present invention.
[0053] It should be noted that, because the embodiment of the present invention subsequently needs to compare the degree of difference between the suspected key frame and the same strong emotional expression edge in the previous frame of the facial image, only these two images can be analyzed to determine their strong emotional expression edges, without the need to analyze each frame of the facial image.
[0054] For a suspected keyframe, the greater the difference between the same strong emotional expression edge in the facial image of the previous frame, the greater the emotional expression level of that strong emotional expression edge in the suspected keyframe. Therefore, by calculating the emotional expression level of each strong emotional expression edge in the suspected keyframe, the overall emotional expression level of the suspected keyframe can be obtained.
[0055] Preferably, in an embodiment of the present invention, the method for obtaining the degree of emotional expression includes:
[0056] Any strong emotion expression edge of the suspected key frame is taken as the second target edge, and the strong emotion expression edge in the facial image of the previous frame is taken as the comparison edge; the edge difference degree between the second target edge and all the comparison edges is obtained, and the comparison edge with the smallest edge difference degree is selected as the same strong emotion expression edge of the second target edge in the facial image of the previous frame.
[0057] The emotional expression degree of the second target edge is obtained based on the cosine distance and length difference between the second target edge and the contrast edge with the smallest edge difference. In an embodiment of the present invention, the product of the cosine distance and the length difference is used as the emotional expression degree of the second target edge, that is, the greater the difference, the greater the emotional expression degree of the second target edge. By traversing each strong emotional expression edge of the suspected key frame, the emotional expression degree of each strong emotional expression edge can be obtained. It should be noted that the method for obtaining the cosine distance and length difference is a technical means well known to those skilled in the art and will not be elaborated here.
[0058] Preferably, in an embodiment of the present invention, in order to further improve the characteristics of the strong emotional expression edge with a larger emotional expression degree, the method for obtaining the overall emotional expression degree includes:
[0059] The average emotional expression level of all edges with strong emotional expression in the suspected keyframe is obtained. The ratio of the emotional expression level of each strong emotional expression edge to the average emotional expression level is used as the data weight. The emotional expression level of each strong emotional expression edge is weighted according to the data weight to obtain the weighted emotional expression level. That is, the weighted emotional expression level is the product of the data weight and the emotional expression level. In other words, through weighting, the data difference between strong emotional expression edges with greater emotional expression levels and other strong emotional expression edges is amplified. The more strong emotional expression edges with greater emotional expression levels in a suspected keyframe, the more likely it is to be a frame image expressing strong emotion. Therefore, the average weighted emotional expression level of all strong emotional expression edges is used as the overall emotional expression level.
[0060] Step S3: Select a time window to be analyzed after the suspected key frame according to the overall emotional expression level, and obtain the comprehensive emotional expressiveness of the suspected key frame according to the change and size of the overall emotional expression level of each facial image in the time window to be analyzed.
[0061] If the suspected keyframe is a true keyframe, because of the patient's strong emotional changes at this time, the overall emotional expression level is relatively high, and the overall emotional expression level will be higher and increased in the subsequent frame images. Therefore, it is necessary to continue analyzing the facial images after the suspected keyframe. If the overall emotional expression level of the suspected keyframe is relatively high, it means that the patient is more sensitive at this time, and analyzing the facial images after a relatively recent time period can determine whether it is a true keyframe; otherwise, it means that a longer time period is required to analyze whether the suspected keyframe is a true keyframe. Therefore, the embodiment of the present invention first selects the time window to be analyzed after the suspected keyframe based on the overall emotional expression level.
[0062] The greater the overall emotional expression of all facial images within the time window to be analyzed, and the closer the change is to an incremental one, the more likely the suspected keyframe is the one where the emotion begins to change, and thus its comprehensive emotional expressivity is high. Therefore, this embodiment of the present invention derives the comprehensive emotional expressivity of a suspected keyframe based on the change and magnitude of the overall emotional expression of each facial image within the time window to be analyzed.
[0063] Preferably, in an embodiment of the present invention, the method for selecting the time window to be analyzed includes:
[0064] The overall emotional expression level of the suspected key frame is negatively correlated and normalized to obtain a time length weight. The time length weight is multiplied by the preset maximum time length, and the product is rounded down to obtain the window length of the time window to be analyzed. The time corresponding to the suspected key frame is used as the starting point, and the time window to be analyzed is selected according to the window length. In an embodiment of the present invention, the method of negative correlation mapping and normalization is: the opposite of the overall emotional expression level is used as the power of an exponential function with a natural constant as the base, and the mapping result of the exponential function is the result of negative correlation mapping and normalization. In this embodiment of the present invention, the preset maximum time length is set to 10 frames.
[0065] Preferably, in an embodiment of the present invention, the method for obtaining comprehensive emotional expressiveness includes:
[0066] The ratio of the overall emotional expression level between the facial image and the suspected key frame at each moment in the time window to be analyzed is obtained. The larger the ratio is, the greater it is, indicating that each facial image frame after the suspected key frame is in an increasing state relative to the suspected key frame. Therefore, the degree of intense emotional change at the corresponding moment is obtained based on the overall emotional expression level ratio. That is, the more obvious the increasing state of the overall emotional expression level in the time window to be analyzed, the greater the degree of intense emotional change. In this embodiment of the present invention, the positive integer 1 is subtracted from the overall emotional expression level ratio to obtain the degree of intense emotional change.
[0067] The intensity of emotional change is used as a weight to sum the overall emotional expression at the corresponding moment to obtain the comprehensive emotional expressivity. That is, for each moment in the time window to be analyzed, the greater the overall emotional expression, and the greater the overall emotional expression relative to the suspected keyframe, the greater the comprehensive emotional expressivity of the suspected keyframe.
[0068] In one embodiment of the present invention, the comprehensive emotional expressiveness is expressed as follows:
[0069] ;in is the comprehensive emotional expressiveness of the suspected key frame t, is the number of facial images in the time window to be analyzed of the suspected key frame t, is the first key frame in the time window to be analyzed The overall emotional expression of a facial image, is the overall emotional expression level of the suspected key frame t.
[0070] Step S4: judging whether the suspected key frame is a real key frame based on the comprehensive emotional expressiveness and the overall emotional expression degree; identifying the emotional label of the real key frame and adjusting the light therapy parameters according to the emotional label.
[0071] For a suspected keyframe, the greater its comprehensive emotional expressivity and overall emotional expression, the more likely it is to be a true keyframe capable of emotion recognition and light therapy parameter adjustment. Therefore, the suspected keyframe is judged as a true keyframe based on its comprehensive emotional expressivity and overall emotional expression.
[0072] Preferably, in an embodiment of the present invention, the criticality of a suspected keyframe is obtained based on the comprehensive emotional expressiveness and the overall emotional expression level. If the criticality is greater than a preset criticality threshold, the suspected keyframe is treated as a true keyframe. In an embodiment of the present invention, after normalizing the comprehensive emotional expressiveness and the overall emotional expression level in their respective dimensions through range normalization, the two normalized results are multiplied to obtain the criticality. Because the criticality is also data with a value range between 0 and 1, the criticality threshold is set to 0.8.
[0073] After determining the real keyframes, the emotion labels can be identified for the real keyframes and the light therapy parameters can be adjusted according to the emotion labels. In the embodiments of the present invention, this process uses the recognition model in the prior art for recognition. The specific process is a technical means well known to those skilled in the art. Here, only a brief description of the process in the embodiments of the present invention is given:
[0074] (1) Identify the key points in the real key frame.
[0075] (2) Compare the identified key points with the facial emotion database and output the emotion label of the facial image based on the key point comparison result.
[0076] (3) Inputting the emotion label into the training model of the emotion-phototherapy device parameter optimization model. The emotion-phototherapy device parameter optimization model is a model pre-trained using a machine learning algorithm, and specifically, an optimization algorithm such as an ant colony algorithm can be used.
[0077] (4) Output the optimized parameters of the light therapy device under the current emotion label, and use the optimized parameters of the light therapy device under the previous emotion label to improve the parameters of the light therapy device, and continue to perform light therapy for patients with depression. In addition, during the continuous light therapy process, continue to collect real key frames and adjust the light therapy parameters.
[0078] In summary, the embodiment of the present invention screens out suspected key frames based on the differences in facial images between adjacent frames, and can accurately evaluate the overall emotional expression level of the suspected key frames by screening out the edges of strong emotional expression and analyzing their changes. A time window to be analyzed is constructed based on the suspected key frames, and the comprehensive emotional expressiveness of the suspected key frames can be determined according to the changes in the overall emotional expression level within the time window to be analyzed. Combined with the overall emotional expression level, it can be accurately determined whether the suspected key frames are real key frames, and emotional labels can be identified and phototherapy parameters can be adjusted based on the real key frames. The present invention extracts feature changes in images, accurately determines the facial emotional change characteristics of patients under phototherapy, and then screens out accurate real key frames for effective phototherapy parameter adjustment.
[0079] Based on the same inventive concept, a system for optimizing light therapy parameters for patients with depression includes a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements any one of the steps of the method for optimizing light therapy parameters for patients with depression.
[0080] It should be noted that the order in which the embodiments of the present invention are described above is for illustrative purposes only and does not necessarily represent the superiority or inferiority of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or sequential order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0081] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.
Claims
1. A light therapy parameter optimization system for patients with depression, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, a method for optimizing light therapy parameters for patients with depression is implemented, the method comprising: Real-time acquisition of facial images of patients undergoing phototherapy treatment for depression; screening of suspected key frames based on the image differences between adjacent frames; In the facial image, edges with strong emotional expression are screened out based on the degree of similarity between the edges; the emotional expression degree of each edge with strong emotional expression in the suspected key frame is obtained based on the degree of difference between the same edge with strong emotional expression in the facial image of the suspected key frame and the previous frame; the emotional expression degrees of all edges with strong emotional expression in the suspected key frame are counted to obtain the overall emotional expression degree of the suspected key frame; According to the overall emotional expression level, a time window to be analyzed is selected after the suspected key frame, and the comprehensive emotional expressivity of the suspected key frame is obtained according to the change and size of the overall emotional expression level of each facial image in the time window to be analyzed; Determining whether the suspected key frame is a real key frame based on the comprehensive emotional expressiveness and the overall emotional expression degree; identifying an emotional label for the real key frame and adjusting the light therapy parameters based on the emotional label; The method for screening the edge of strong emotional expression includes: Take any edge in the facial image as the first target edge, and obtain the cosine similarity, length difference and centroid distance between the first target edge and other edges in a preset neighborhood; obtain the edge difference degree according to the length difference and centroid distance; obtain the edge uniformity between the first target edge and each other edge in the preset neighborhood according to the edge difference degree and the cosine similarity; accumulate the edge uniformity between the first target edge and all other edges in the preset neighborhood to obtain the emotional expression ability; if the emotional expression ability of the first target edge is greater than the preset expression ability threshold, then take the first target edge as the strong emotional expression edge; traverse all edges in the facial image to obtain all strong emotional expression edges.
2. The light therapy parameter optimization system for depression patients according to claim 1, characterized in that: The method for screening out suspected key frames includes: For each facial image, the information entropy difference between the facial image and the previous facial image is used as a discrimination index; if the discrimination index is greater than a preset discrimination threshold, the facial image is regarded as a suspected key frame; otherwise, it is regarded as a non-suspected key frame.
3. The light therapy parameter optimization system for depression patients according to claim 2, characterized in that: After determining that a non-suspected key frame is present, the following steps are also performed: Determine whether the register reaches the cache clearing time at the moment corresponding to the non-suspected key frame. If not, directly store the non-suspected key frame; if so, clear all facial image data in the register and then store the non-suspected key frame.
4. The light therapy parameter optimization system for depression patients according to claim 1, characterized in that: The method for obtaining the degree of emotional expression includes: Any strong emotion expression edge of the suspected key frame is used as the second target edge, and the strong emotion expression edge in the facial image of the previous frame is used as the comparison edge; the edge difference degree between the second target edge and all the comparison edges is obtained, and the comparison edge with the smallest edge difference degree is selected as the same strong emotion expression edge of the second target edge in the facial image of the previous frame; the emotion expression degree of the second target edge is obtained according to the cosine distance and length difference between the second target edge and the comparison edge with the smallest edge difference degree.
5. The light therapy parameter optimization system for depression patients according to claim 1, characterized in that: The method for obtaining the overall emotional expression level includes: The average emotional expression degree of all strong emotional expression edges in the suspected key frame is obtained, the ratio of the emotional expression degree of each strong emotional expression edge to the average emotional expression degree is used as the data weight, the emotional expression degree of each strong emotional expression edge is weighted according to the data weight to obtain the weighted emotional expression degree; the average weighted emotional expression degree of all strong emotional expression edges is used as the overall emotional expression degree.
6. The light therapy parameter optimization system for depression patients according to claim 1, characterized in that: The method for selecting the time window to be analyzed includes: The overall emotional expression degree of the suspected key frame is negatively mapped and normalized to obtain a time length weight, the time length weight is multiplied by the preset maximum time length, and the product is rounded down to obtain the window length of the time window to be analyzed. The moment corresponding to the suspected key frame is taken as the starting point, and the time window to be analyzed is selected according to the window length.
7. The light therapy parameter optimization system for depression patients according to claim 1, characterized in that: The method for obtaining the comprehensive emotional expressiveness includes: Obtain the ratio of the overall emotional expression degree between the facial image at each moment in the time window to be analyzed and the suspected key frame; obtain the degree of intense emotional change at the corresponding moment based on the overall emotional expression degree ratio; use the degree of intense emotional change as a weight to perform weighted summation on the overall emotional expression degree at the corresponding moment to obtain the comprehensive emotional expressiveness.
8. The light therapy parameter optimization system for depression patients according to claim 1, characterized in that: The determining whether the suspected key frame is a real key frame according to the comprehensive emotional expressiveness and the overall emotional expression degree includes: The criticality of the suspected key frame is obtained according to the comprehensive emotional expressiveness and the overall emotional expression degree. If the criticality is greater than a preset criticality threshold, the suspected key frame is used as the real key frame.
Citation Information
Patent Citations
Mental disease patient auxiliary analysis method and device based on facial expression recognition
CN119132581A
Emotion evaluation method and system
CN119625803A