Face video physiological parameter-based irritable emotion classification method and system

The irritable emotion classification method based on facial video physiological parameters, using rPPG signal and extreme gradient boosting algorithm, solves the problem of difficulty in early identification of irritable emotions in the existing technology, achieves accurate prediction and classification of irritable emotions, and supports individuals mental health management.

CN118749974APending Publication Date: 2024-10-11吾征智能技术(北京)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410715511.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing technology is difficult to early identify and accurately predict irritable emotional states, which affects individual mental health management.

Method used

An irritable emotion classification method based on facial video physiological parameters is adopted. By collecting facial video data, extracting rPPG signals, using adaptive singular spectrum analysis algorithm for noise reduction processing, and combining with extreme gradient boosting (XGBoost) classification algorithm to build an irritable emotion classification model. Realize the prediction and classification of irritable emotions.

Benefits of technology

It achieves accurate prediction and classification of irritable emotions, provides the convenience of remote data collection and efficient irritability symptom assessment, and supports early intervention and mental health management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118749974A_ABST
    Figure CN118749974A_ABST
Patent Text Reader

Abstract

The invention discloses an irritable emotion classification method and system based on facial video physiological parameters. The method comprises the steps of collecting facial video data; extracting an rPPG signal from the face video data; performing noise reduction processing on the rPPG signal by using an adaptive singular spectrum analysis algorithm, and extracting a plurality of features used for describing heart rate related indexes from the rPPG signal; using a psychological irritability assessment tool to assess the psychological irritability level of the subject and mark the irritability state category; according to the multiple features, the psychological irritability level and the irritability state category data, an extreme gradient boost (XGBoost) classification algorithm is used for training, and an irritability emotion classification model is constructed; and deploying the irritability emotion classification model to an application system and maintaining the model. Algorithm model training can be carried out on the irritability symptom levels and multiple features of multiple interviewees at the same time, and after an irritability emotion classification model is remotely deployed, accurate prediction and classification of the irritability emotion symptoms of the subjects are carried out through face videos collected remotely.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of detection and classification of abnormal psychological emotions, and in particular, to a method and system for classifying irritable emotions based on physiological parameters of facial videos. Background Art

[0002] At present, irritability is a common mental health problem, which refers to an emotional reaction that is too strong and uncontrollable, also known as emotional disorder. Irritability and emotional instability will affect people's daily life, and may also have an adverse effect on interpersonal relationships, work and study. This situation may make people feel anxious, depressed, lonely, and even affect their physical health. There are many reasons for emotional instability, some of which may be genetic or due to external factors. Genetic factors may make people more prone to excitement, anxiety or depression, while external factors may be due to problems in the individual or family, such as stress, sadness, anger, etc. Identifying irritable tendencies is of great significance to improving emotional instability and taking effective treatment methods. By recognizing one's own irritability tendencies and taking appropriate coping measures, individuals can better manage their emotions and improve their quality of life and work efficiency.

[0003] How to identify, discover and accurately predict irritable emotional states as early as possible has become an important measure to effectively solve the problem. In recent years, the research on heart rate variability analysis methods in the field of mental illness diagnosis has developed rapidly. When in an irritable state, the autonomic nervous system is different from that of normal people. More and more studies have shown that heart rate variability analysis can help determine the probability of irritability, thereby playing a role in early detection and early intervention to restore mental health. Therefore, how to diagnose relevant symptoms of subjects based on heart rate variability characteristic data has a very positive research and development prospect. Summary of the invention

[0004] The main purpose of this application is to provide a method and system for classifying irritability based on physiological parameters of facial videos, so as to achieve the classification and prediction of irritability of subjects.

[0005] In order to achieve the above-mentioned purpose, the present application provides: a method for classifying irritability based on physiological parameters of facial videos, the method comprising:

[0006] Collect facial video data;

[0007] Extract rPPG signals from facial video data;

[0008] The rPPG signal is subjected to noise reduction using an adaptive singular spectrum analysis algorithm, and multiple features used to describe heart rate-related indicators are extracted from it;

[0009] The psychological irritability assessment tool was used to assess the subjects' psychological irritability levels and to label the irritability status categories;

[0010] Based on the plurality of the features, the psychological irritability level and the irritability state category data, an extreme gradient boosting (XGBoost) classification algorithm is used to train and construct an irritability emotion classification model;

[0011] Deploy and maintain the irritability classification model into the application system.

[0012] Further, the method for extracting rPPG signals from facial video data specifically includes:

[0013] Detecting each video frame of the facial video to obtain a facial rectangle and segment a facial interest region;

[0014] Identify color variations in the skin in each facial region of interest;

[0015] The color model is applied to calculate the color channels of the varying skin color pixels, and the rPPG signal is constructed by the average value of the color channels.

[0016] The method of further using an adaptive singular spectrum analysis algorithm to perform noise reduction on the rPPG signal and extracting multiple features for describing heart rate related indicators includes:

[0017] Constructing the trajectory matrix: Assume that the total length of the time series x(t) is N, the window length of constructing the trajectory matrix is ​​L, and define K = N-L+1. Then the trajectory matrix can be expressed as:

[0018] X=[[x1,x2,…,x k ],[x2,x3,…,x k+1 ],…,[x L ,x L+1 ,…,x N ]];

[0019] Singular value decomposition: The singular value decomposition of the trajectory matrix X is: Where d = rank(X) ≤ min(L,K), d is the number of non-zero singular values ​​of X, λ1 is the maximum singular value, and U i and V i are the left and right singular vectors of X respectively;

[0020] Adaptive component selection: The enhanced Lagrange multiplier algorithm (EALM) is used to select the first r larger singular values ​​of the trajectory matrix X;

[0021] Signal reconstruction: Signal reconstruction uses the reconstruction matrix RCA = U(1,2,…,r)*(V T*[1,2,…,r]) and obtain the denoised rPPG signal, where the reconstruction matrix is ​​defined as the first r columns of U and V T The product of the first r rows of ;

[0022] Extracting at least time domain features, frequency domain features and time-frequency domain features from the denoised rPPG signal;

[0023] A plurality of parameters related to heart rate variability are extracted from the time domain features, the frequency domain features and the time-frequency domain features as the plurality of the features.

[0024] Furthermore, the method of using the psychological irritability assessment tool to assess the psychological irritability level of the subject and labeling the irritability state category specifically includes:

[0025] Data on the subjects’ psychological irritability levels were collected using a psychological irritability assessment tool;

[0026] Processing missing values ​​and outliers on the psychological irritability level data;

[0027] According to the content design of the psychological irritability assessment tool and routine practice combined with the processed irritability level data, the subjects' irritability symptom levels and irritability state categories were divided.

[0028] Furthermore, the method uses the extreme gradient boosting (XGBoost) classification algorithm to train and construct an irritability emotion classification model based on the multiple features, psychological irritability level and irritability state category data, specifically including:

[0029] Dividing the plurality of features, irritability symptom levels, and irritability state category data into a training set, a test set, and a validation set;

[0030] The extreme gradient boosting (XGBoost) classification algorithm is used to train the training set data and output the irritability emotion classification model;

[0031] Use the test set and validation set data to evaluate the performance and optimize the parameters of the irritability classification model;

[0032] Output the fine-tuned irritability classification model.

[0033] Furthermore, the method of selecting the extreme gradient boosting (XGBoost) classification algorithm to train the training set data and output the irritability classification model specifically includes:

[0034] The training set data is normalized: the normalization transformation formula is X i , =X i -Xminmax min , where X i , X i, respectively represent the value of the i-th learning sample and its corresponding normalized value, X min and X max Respectively represent the minimum and maximum values ​​of each indicator;

[0035] Extreme Gradient Boosting (XGBoost) classification algorithm parameter selection: select one of the grid search algorithm, genetic algorithm, and particle swarm algorithm to obtain the optimal solution of the parameters;

[0036] The training set data is input into a preset model of an extreme gradient boosting (XGBoost) classification algorithm for training, and an irritability classification model is output.

[0037] Furthermore, the method for deploying and maintaining the irritability emotion classification model in the application system specifically includes:

[0038] Create an API service to load the model and receive requests and return model recognition results;

[0039] Deploy API services to application systems;

[0040] Monitor the running status of the API service and update the model regularly.

[0041] This embodiment further discloses an irritability emotion classification system based on facial video physiological parameters, including:

[0042] A data acquisition module, used for collecting facial video data;

[0043] An rPPG signal extraction module, used to extract rPPG signals from facial video data;

[0044] A feature extraction module is used to perform noise reduction processing on the rPPG signal using an adaptive singular spectrum analysis algorithm, and extract multiple features for describing heart rate related indicators;

[0045] A data annotation module, used to evaluate the psychological irritability level of the subject using a psychological irritability assessment tool and annotate the irritability state category;

[0046] A model training and evaluation module, for training and building an irritability emotion classification model using an extreme gradient boosting (XGBoost) classification algorithm based on the plurality of features, psychological irritability levels, and irritability state category data;

[0047] The model deployment module is used to deploy and maintain the irritability emotion classification model into the application system.

[0048] This embodiment further discloses a computer-readable storage medium, wherein the storage medium stores a computer program, and the computer program implements the above method when executed by a processor.

[0049] This embodiment further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the above-described method when executing the program.

[0050] Compared with the prior art, the method and system for classifying irritability based on facial video physiological parameters provided by the present invention have the following beneficial effects: using facial video data as basic data for irritability classification can meet the needs of remote basic data collection, and data collection is more convenient and quick. At the same time, by training an extreme gradient boosting classification algorithm model based on the irritability symptom levels of multiple respondents and the corresponding multiple features collected, after the irritability classification model is remotely deployed, accurate prediction and classification of irritability symptoms of subjects can be achieved through remotely collected facial video signals. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The drawings constituting a part of this application are used to provide a further understanding of this application, so that other features, purposes and advantages of this application become more obvious. The schematic embodiment drawings and their descriptions of this application are used to explain this application and do not constitute an improper limitation on this application. In the drawings:

[0052] Figure 1 Schematic diagram of the flow of the method for classifying irritability based on physiological parameters of facial videos in this embodiment;

[0053] Figure 2 Schematic diagram of the system structure for irritability classification based on physiological parameters of facial video in this embodiment;

[0054] Figure 3 Schematic diagram of the test results of the irritability emotion classification model for each irritability symptom level in this embodiment;

[0055] Figure 4 Schematic diagram of working characteristics of subjects in multiple different models in this embodiment. DETAILED DESCRIPTION

[0056] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0057] It should be noted that the terms "first", "second", etc. in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0058] In the present application, the terms "upper", "lower", "left", "right", "front", "back", "top", "bottom", "inner", "outer", "middle", "vertical", "horizontal", "lateral", "longitudinal" and the like indicate positions or positional relationships based on the positions or positional relationships shown in the drawings. These terms are mainly used to better describe the present application and its embodiments, and are not used to limit the indicated devices, elements or components to have a specific orientation, or to be constructed and operated in a specific orientation.

[0059] In addition, some of the above terms may be used to express other meanings in addition to indicating orientation or positional relationship. For example, the term "on" may also be used to express a certain dependency or connection relationship in some cases. For those of ordinary skill in the art, the specific meanings of these terms in this application can be understood according to specific circumstances.

[0060] In addition, the term "plurality" shall mean two or more.

[0061] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0062] Irritability is a common mental health problem, which refers to an emotional reaction that is too strong and uncontrollable, also known as emotional disorder. How to identify and accurately quantify the level of irritability symptoms as early as possible has become an important prerequisite for effectively solving the above problems. In recent years, the research on heart rate variability analysis methods in the field of diagnosis of irritability-related diseases has developed rapidly. When in an irritable state, the autonomic nervous system is different from that of ordinary people. More and more studies have shown that heart rate variability analysis can help determine the probability of an irritable state. Therefore, based on the heart rate variability feature data, a method and system for irritability classification based on facial video physiological parameters is proposed.

[0063] Specifically, this method uses video analysis, signal extraction and other technologies, combined with the subject's own irritability emotional state category information and heart rate variability feature data, to build a machine learning prediction model, train and evaluate it, and deploy it to the terminal device or cloud platform.

[0064] refer to Figure 1 This embodiment discloses a method for classifying irritability based on physiological parameters of facial videos, the method comprising:

[0065] S100: Collect facial video data.

[0066] The facial video data is the facial video of the subjects who have the basic knowledge of color recognition. The facial video is collected by camera, specifically RGB facial video. To ensure the availability of the video, when shooting the facial video, the light in the collection environment must be uniform and bright enough to ensure the good quality of light reflected from the skin surface. At the same time, the pixel resolution of the camera must be as high as possible to ensure that a clear facial image is obtained. The collection position and angle of the camera must be at an appropriate distance from the subject's face and kept perpendicular to the face. The subject must maintain a relatively static posture to improve the stability of video collection. In addition, the length of the collected video should preferably be more than 15 seconds to obtain sufficient data for subsequent signal processing and analysis.

[0067] S200: extracting rPPG signals from facial video data.

[0068] The rPPG signal refers to remote photoelectric pulse wave recording, which reflects the changes in blood volume in tiny blood vessels on the surface of the skin during the heartbeat. It is extracted by analyzing facial video data and obtaining color changes of the facial skin.

[0069] For the extraction of rPPG signals, face detection and tracking in facial video data are crucial, while head motion and background noise can significantly affect the performance of rPPG signal pulse waves. Therefore, a face detector is used to assist in extraction.

[0070] Specific:

[0071] S210: Detect the video frame of each facial video to obtain a facial rectangle and segment the facial interest region;

[0072] S220: Identify skin color changes in each facial region of interest.

[0073] In this embodiment, the OpenCV Viola-Jones face detector is used to detect the face rectangle of each video frame and segment the facial interest region. Exemplarily, the interest region may be the forehead region, the nose region, the cheek region, etc., and then the skin color change of each interest region is identified.

[0074] S230: Apply the color model to calculate the color channels of the changed skin color pixels, and construct the rPPG signal through the average value of the color channels.

[0075] After obtaining the skin color change, the extraction of the rPPG signal pulse wave is mainly achieved by applying the color model. Commonly used color models include RGB, HSI, YCbCr, etc. For the HSI model, only the H channel can be used for signal pulse extraction, and the YCbCr model consists of brightness (Y) and two chrominance components (Cb, Cr). YCbCr produces better results in detecting heart rate than the motion-restricted HSI, and the color channel of the RGB color model can give the strongest signal-to-noise ratio SNR. Therefore, the RGB color model is selected in this embodiment, and the rPPG signal is constructed by calculating the average value of the color channel of the pixels in the detected facial interest area rectangle.

[0076] S300: Perform noise reduction processing on the rPPG signal using an adaptive singular spectrum analysis algorithm, and extract multiple features for describing heart rate related indicators.

[0077] When constructing the rPPG signal, even if the facial area is accurately tracked, motion artifacts may be generated due to subtle changes in the subject's facial expression or movement during the acquisition process. The average intensity in the facial area may suddenly drop or rise, resulting in a lot of noise in the RPPG signal pulse wave. Therefore, the adaptive singular spectrum analysis algorithm is used for noise reduction. This algorithm is a new algorithm that combines singular spectrum analysis with adaptive functions to remove irregular noise and extract clean pulse waves while retaining useful details, ultimately optimizing and adjusting the original RPPG signal. The algorithm is mainly based on the global analysis method of phase space reconstruction, which decomposes the original signal into multiple variable components and automatically selects appropriate components to reconstruct the pulse wave. The process is mainly divided into trajectory matrix construction, singular value decomposition, adaptive component selection and signal reconstruction. Through the adaptive singular spectrum analysis algorithm, the main periodic components in the original signal can be extracted to reconstruct the pulse wave. Specifically:

[0078] S310: Constructing a trajectory matrix: Assuming that the total length of the time series x(t) is N, the window length for constructing the trajectory matrix is ​​L, and defining K=N-L+1. Then the trajectory matrix can be expressed as:

[0079] X=[[x1,x2,…,x k ],[x2,x3,…,x k+1 ],…,[x L ,x L+1 ,…,x N ]],

[0080] For the selection of window length L, when L takes the median value of N, the corresponding singular value is the maximum value, so L takes the median value of N;

[0081] S320: Singular value decomposition: The singular value decomposition of the trajectory matrix X is: Where d = rank(X) ≤ min(L,K), d is the number of non-zero singular values ​​of X, λ1 is the maximum singular value, and U i and V i are the left and right singular vectors of X respectively;

[0082] S330: Adaptive component selection: The enhanced Lagrange multiplier algorithm (EALM) is used to select the first r larger singular values ​​of the trajectory matrix X. Specifically,

[0083] Use the low-rank matrix S to approximate the trajectory matrix X, assuming that X is contaminated by slight Gaussian noise E and sparse large noise W, and ‖E‖ F ≤δ, where ‖E‖ F represents the nuclear norm of E, then the matrix denoising problem can be described by the following optimization problem:

[0084]

[0085] st‖XSW‖≤δ,

[0086] Where m and n represent the number of rows and columns of the matrix X, respectively, and ‖W‖0 represents the zero norm of the matrix W;

[0087] Define the Lagrangian function:

[0088]

[0089] Among them, μ is the penalty coefficient, and the initial value of the Lagrange multiplier Y can be expressed as:

[0090] Y0=sgn(X) / max(‖sgn(X)‖2,γ -1 ‖sgn(X)‖ ∞ ),

[0091] Where sgn is the sign function, ‖X‖ ∞ represents the infinite norm of X, ‖X‖2 represents the 2-norm of X. It can be seen that when the function H(X) is continuously differentiable, the Lagrange multiplier Y can ensure that the above solution process converges linearly. When convergence occurs, the output matrix S K It is the best low-rank matrix to approximate the source matrix X, so the first-order singular values ​​are used to reconstruct the rPPG signal pulse wave.

[0092] S340: Signal reconstruction: Signal reconstruction uses reconstruction matrix RCA = U (1, 2, ..., r) * (VT *[1,2,…,r]) and obtain the denoised rPPG signal, where the reconstruction matrix is ​​defined as the first r columns of U and V T The product of the first r rows of , the reconstruction matrix dimension is L × K, further define L * =min(L,K),K * =max(L,K),y i,j Represents the value of the i-th row and j-th column of the reconstruction matrix, then the reconstructed signal y singal_c It can be obtained by:

[0093]

[0094]

[0095]

[0096] After the above processing, the denoised rPPG signal pulse wave is obtained. In this embodiment, the total length of the actual parameter pulse wave signal is 160, the window length L is set to 80, and the number of singular values ​​used to reconstruct the rPPG signal pulse wave is 8 (r=8).

[0097] S350: extracting at least time domain features, frequency domain features, and time-frequency domain features from the denoised rPPG signal;

[0098] Among them, time domain features are features extracted directly from the time series of the signal, which can describe the basic statistical characteristics and morphological characteristics of the signal, including the mean, variance, standard deviation, kurtosis, skewness, etc. of the signal. Frequency domain features are features obtained by performing spectrum analysis methods such as Fourier transform or wavelet transform on the signal, which can describe the frequency components and spectrum distribution characteristics of the signal, including the spectrum energy, spectrum mean, spectrum peak, etc. of the signal. Time-frequency domain features are features obtained by comprehensively considering the time domain and frequency domain information of the signal. For example, methods such as short-time Fourier transform (STFT) and wavelet transform can obtain time-frequency domain features, including time-spectrum spectrum, instantaneous frequency, etc.

[0099] S360: extracting a plurality of parameters related to heart rate variability from the time domain features, the frequency domain features, and the time-frequency domain features as a plurality of the features,

[0100] In this embodiment, 25 parameter features related to heart rate variability are finally extracted.

[0101] Specific:

[0102] SDNN: standard deviation of RR interval, standard deviation of heartbeat interval;

[0103] RMSSD: the root mean square of the sum of squares of the differences between adjacent normal heart beat intervals;

[0104] LF: The amplitude of a normal heartbeat interval in the low frequency range (0.04-0.15 Hz);

[0105] HF: The amplitude of normal heartbeat intervals in the high frequency range (0.15-40 Hz);

[0106] LF / HF: low-high frequency power ratio; sdsd: standard deviation of adjacent RR differences;

[0107] hf_nu: normalized high frequency power; lf_nu: normalized low frequency power;

[0108] nn: normal heartbeat interval, RR interval;

[0109] cvnni: coefficient of variation, standard deviation of the series data of heart beat-to-beat variability;

[0110] nn20: the number of adjacent RR interval differences > 20 ms;

[0111] nn50: the number of adjacent RR interval differences > 50 ms;

[0112] pnn20: the percentage of NN20 in the total heart rate;

[0113] pnn50: the percentage of NN50 in the total heart rate;

[0114] cvcd: coefficient of variation of consecutive differences;

[0115] sd1: standard deviation of the projection of the Poincare map onto the line perpendicular to the line of equation;

[0116] sd2: standard deviation of the Poincare projection;

[0117] SDNNindex: the average of the standard deviations of all RR intervals;

[0118] Hrvindex: the total number of RR intervals divided by the height of the RR interval;

[0119] Max_min: the difference between the maximum and minimum values ​​of all RR intervals;

[0120] MEAN: mean value of RR interval;

[0121] totalpower: total power spectral density;

[0122] VLF: Very low frequency power, range 0.04~0.15Hz;

[0123] HFn: normalization of high frequency capability;

[0124] LFn: The proportion of low-frequency power in the total power spectrum.

[0125] S400: Use the psychological irritability assessment tool to assess the psychological irritability level of the subjects and label the irritability state category.

[0126] S410: Collect data on the psychological irritability level of the subject using a psychological irritability assessment tool.

[0127] Exemplarily, using a standard psychological irritability assessment tool, the Pittsburgh Irritability Affect Scale PAS, Hamilton Anger Rating Scale HAM-A, Minnesota Multidimensional Depression Inventory MMPI, Beck Violence Risk Rating Scale BARRT, etc. can be selected to assess the psychological irritability level of the subject and mark the irritability state category. The Irritability Symptom Self-Assessment Scale is a psychological assessment tool used to assess whether an individual has irritability symptoms and the severity of the symptoms. Data annotation is the process of marking the subject's self-assessment scale score as the corresponding psychological irritability level. First, collect the irritability symptom self-assessment scale data filled in by the subject. Usually includes the subject's personal information (such as age, gender, place of residence, occupation, income level, etc.) and the score of each question.

[0128] S420: Processing missing values ​​and outliers on the psychological irritability level data.

[0129] In the process of labeling irritability states, missing values, outliers, etc. can be handled by filling missing values, removing outliers, etc. to ensure the quality of the data.

[0130] S430: Based on the content design of the psychological irritability assessment tool and routine practice combined with the processed psychological irritability level data, the subjects' irritability symptom levels and irritability state categories are divided.

[0131] After obtaining the symptom self-rating scale data, according to the design of the self-rating scale and routine practice, determine the scores to be divided into different levels of psychological irritability, for example, subjects with a total score of 0-4 points are divided into no irritability, mild irritability, moderate irritability and severe irritability. Finally, the data of the self-rating scale are annotated. Finally, the score of each subject is marked as the corresponding psychological irritability level, no irritability (0 points), mild irritability (5-9 points), moderate irritability (10-14 points), severe irritability (15 points and above).

[0132] S500: Based on the plurality of features, the psychological irritability level and the irritability state category data, an extreme gradient boosting (XGBoost) classification algorithm is used to train and construct an irritability emotion classification model.

[0133] The Extreme Gradient Boosting (XGBoost) classification algorithm is an ensemble learning algorithm that uses the gradient boosting framework to train decision tree models. The Extreme Gradient Boosting (XGBoost) classification algorithm gradually improves the accuracy of predictions by training decision tree models in series. In each iteration, a new decision tree model is first trained, and then the target value is adjusted based on the difference between the previous model's prediction and the true value (i.e., the residual), and then the next decision tree model is trained. By iteratively training multiple decision tree models and adding their predictions, the Extreme Gradient Boosting classification algorithm can gradually improve the prediction ability of the overall model.

[0134] Specific:

[0135] S510: Divide the plurality of features, irritability symptom levels, and irritability state category data into a training set, a test set, and a validation set.

[0136] Among them, the proportions of training set, test set and validation set are 70%, 20% and 10% respectively. The training set, test set and validation set data include the multiple rPPG features extracted in step S360, the irritability symptom level and irritability state category in step S430, and the sklearn algorithm package train_test_split method is used to divide the above data into training set, test set and validation set, and the test_size value is 0.2.

[0137] S520: Selecting an extreme gradient boosting (XGBoost) classification algorithm to train the training set data and output an irritability emotion classification model;

[0138] S530: Using the test set and validation set data to perform performance evaluation and parameter tuning on the irritability emotion classification model;

[0139] S540: Output the tuned irritability classification model.

[0140] In this embodiment, the extreme gradient boosting (XGBoost) classification algorithm is used to train the training set data samples and output the irritability classification model. The core of the extreme gradient boosting (XGBoost) classification algorithm is as follows:

[0141] Given a training sample set S = {(x i ,y i )}, where |S| = n is the total number of sample data sets, x i ∈R m , the i-th sample has m features, y i ∈R is the sample x i Corresponding to the level of irritability symptoms, R is a real number set, i∈[1,n]. The algorithm generates a set of regression trees, i.e., the decision tree space is represented as F={f(x)=W q(x)}(q:R m →T,ω∈R T ), where q represents the sample x with m features. i Mapped to the values ​​of T leaf nodes, the weights corresponding to the values ​​of T leaf nodes are based on the vector ω∈R T Assume that f(x) represents the mapping method of the regression tree, that is, the functional relationship from sample x to f(x), W q (x) represents the determination method of a single tree, i.e., a leaf node, and the prediction function is expressed as where y i ′ Represents sample x i The prediction result, φ(x i ) represents the mapping feature vector x i The predicted value obtained, f k represents the mapping relationship of the kth tree, f k (x i ) represents the kth regression tree for the feature vector x i Map the resulting regression values.

[0142] Furthermore, the extreme gradient boosting (XGBoost) classification algorithm is used to train the training set data and output the irritability emotion classification model, which specifically includes:

[0143] S521: Normalize the training set data:

[0144] The normalized transformation formula is: i , =X i -Xminmax min , where X i , X i , respectively represent the value of the i-th learning sample and its corresponding normalized value, X min and X max Respectively represent the minimum and maximum values ​​of each indicator;

[0145] S522: extreme gradient boosting (XGBoost) classification algorithm parameter selection: select one of a grid search algorithm, a genetic algorithm, and a particle swarm algorithm to obtain the optimal solution of the parameters;

[0146] S523: Input the training set data into a preset model of an extreme gradient boosting (XGBoost) classification algorithm for training, and output an irritability classification model.

[0147] refer to Figure 3For the evaluation of the irritability classification model, the confusion matrix is ​​used to display the prediction effect of the model for different categories. Furthermore, 200 test set data samples are randomly selected, and the confusion matrix result diagram of the classification category and the actual category is generated using the sklearn.metrics module. The classification level status (no irritability "0", mild irritability "1", moderate irritability "2", severe irritability "3") corresponds to the confusion matrix. The confusion matrix can clearly show the prediction effect of the model for different categories, which helps to better understand the weaknesses and strengths of the model. The row represents the actual test data volume of the label of this class, and the corresponding value of each column of the row is the test data volume predicted to the label class of this column. It can be seen that the prediction accuracy of no irritability, mild irritability, moderate irritability, and severe irritability categories is 0.931 (41 / 44), 0.947 (54 / 57), 0.895 (43 / 48), and 0.921 (47 / 51), respectively, and the overall prediction accuracy of the model is 0.925 (185 / 200).

[0148] Through statistical analysis and correlation measurement of the above test data, it was found that when the irritable state occurred, the heart rate variability index was reflected in the decrease of SDNN and RMSSD, indicating that the overall level of heart rate variability decreased. LF increased, while HF, SDSD, and HF_nu decreased. Most of the index values ​​of SDNNindex, HRVindex, NN, CVNNi, NN20, NN50, pNN20, and pNN50 decreased.

[0149] refer to Figure 4 , is a schematic diagram of the working characteristics of the subjects when multiple different models are used in this embodiment. To further illustrate the rationality of the selection of the algorithm model, the extreme gradient boosting classification algorithm model (XGBoost), random forest model (Random Forest), Gaussian process algorithm model (Gaussian Process), and decision tree algorithm model (DecisionTree) are selected for experiments. For multi-category classification problems, the one-vs-Rest strategy is used to calculate the multi-category AUC (Area Under the Curve), and the value range is [0,1]. The closer the value is to 1, the better the model's ability to distinguish different categories, the closer the value is to 0.5, the closer the model's classification performance is to random, and the closer the value is to 0, the poorer the model's classification performance is. The details of the initial setting of the model parameters are as follows:

[0150] XGBoost(n_estimators=80, learning_rate=1.0, algorithm='SAMME');

[0151] Random Forest(n_estimators=100, criterion='log_loss', min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0, max_features='sqrt', min_impurity_decrease=0.0, bootstrap=True,, warm_start=False, ccp_alpha=0.0);

[0152] Gaussian Process(optimizer='fmin_l_bfgs_b',n_restarts_optimizer=2,

[0153] max_iter_predict=100, warm_start=False, copy_X_train=True, n_jobs=None);

[0154] Decision Tree (criterion='entropy', splitter='best', max_depth=None, min_samples_split=2, min_samples_leaf=1, min_weight_fraction_leaf=0.0).

[0155] Figure 4 In the example, the true positive rate (TPR) is shown on the Y axis and the false positive rate (FPR) is shown on the X axis. Therefore, the larger the area under the curve (AUC), the better. The ideal state is to maximize TPR while minimizing FPR. It can be seen that the extreme gradient boosting classification algorithm model (XGBoost) selected in this embodiment has better performance.

[0156] S600: Deploy the irritability emotion classification model to the application system and maintain it.

[0157] Model deployment refers to embedding the trained model into an actual application system, such as a smartphone application or an online platform, for real-time monitoring and identification of the user's irritability level, and persistently storing the irritability emotion classification model in step S500 to a disk. For example, the model file is angry_model.pkl. In addition, data security and privacy protection are considered during the deployment process to ensure that sensitive information is not leaked. Specifically:

[0158] S610: Create an API service for loading a model, receiving requests, and returning model recognition results.

[0159] For example, taking the online access platform scenario as an example, use a web framework such as Flask or FastAPI to create an API service to receive requests and return model prediction results. The following is a simple example using Flask (Python code):

[0160] from flask import Flask,request,jsonify

[0161] import joblib app=Flask(__name__)

[0162] # Load the model

[0163] model=joblib.load('angry_model.pkl')

[0164] @app.route(' / predict',methods=['POST'])

[0165] def predict():

[0166] data=request.json

[0167] prediction=model.predict([data['features']])

[0168] return jsonify({'prediction':prediction.tolist()})

[0169] if __name__ == '__main__':

[0170] app.run(debug=True).

[0171] S620: Deploy the API service to the application system.

[0172] To deploy API services to a production environment, you can use a cloud platform (such as Baidu Cloud, Tencent Cloud, Alibaba Cloud, and other cloud services) or build your own server.

[0173] S630: Monitor the running status of the API service and update the model regularly.

[0174] In addition, during the deployment of the irritability classification model, encryption and decryption processing is required to ensure the security and privacy of patient data.

[0175] The specific manner of executing the operation of each unit in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated here.

[0176] refer to Figure 2 This embodiment further discloses an irritability emotion classification system based on facial video physiological parameters, which specifically includes:

[0177] A data acquisition module 21, used for acquiring facial video data;

[0178] The rPPG signal extraction module 22 is used to extract the rPPG signal from the facial video data; and is also used to:

[0179] Detecting each video frame of the facial video to obtain a facial rectangle and segment a facial interest region;

[0180] Identify color variations in the skin in each facial region of interest;

[0181] The color model is applied to calculate the color channels of the varying skin color pixels, and the rPPG signal is constructed by the average value of the color channels.

[0182] The feature extraction module 23 is used to perform noise reduction processing on the rPPG signal using an adaptive singular spectrum analysis algorithm, and extract multiple features for describing heart rate related indicators; it is also used to construct a trajectory matrix: assuming that the total length of the time series x(t) is N, the window length for constructing the trajectory matrix is ​​L, and K=N-L+1 is defined. Then the trajectory matrix can be expressed as:

[0183] X=[[x1,x2,…,x k ],[x2,x3,…,x k+1 ],…,[x L ,x L+1 ,…,x N ]];

[0184] Singular value decomposition: The singular value decomposition of the trajectory matrix X is: Where d = rank(X) ≤ min(L,K), d is the number of non-zero singular values ​​of X, λ1 is the maximum singular value, and U i and V i are the left and right singular vectors of X respectively;

[0185] Adaptive component selection: The enhanced Lagrange multiplier algorithm (EALM) is used to select the first r larger singular values ​​of the trajectory matrix X;

[0186] Signal reconstruction: Signal reconstruction uses the reconstruction matrix RCA = U(1,2,…,r)*(V T*[1,2,…,r]) and obtain the denoised rPPG signal, where the reconstruction matrix is ​​defined as the first r columns of U and V T The product of the first r rows of ;

[0187] Extracting at least time domain features, frequency domain features and time-frequency domain features from the denoised rPPG signal;

[0188] A plurality of parameters related to heart rate variability are extracted from the time domain features, the frequency domain features and the time-frequency domain features as the plurality of the features.

[0189] The data annotation module 24 is used to use the psychological irritability assessment tool to assess the psychological irritability level of the subject and to annotate the irritability state category; and is also used to:

[0190] Data on the subjects’ psychological irritability levels were collected using a psychological irritability assessment tool;

[0191] Processing missing values ​​and outliers on the psychological irritability level data;

[0192] According to the content design of the psychological irritability assessment tool and routine practice combined with the processed irritability level data, the subjects' irritability symptom levels and irritability state categories were divided.

[0193] The model training and evaluation module 25 is used to train and construct an irritability emotion classification model using an extreme gradient boosting (XGBoost) classification algorithm based on the plurality of features, psychological irritability levels and irritability state category data; and is also used to,

[0194] Dividing the plurality of characteristics, irritability symptom levels, and irritability state category data into a training set and a test set;

[0195] The extreme gradient boosting (XGBoost) classification algorithm is used to train the training set data and output the irritability emotion classification model;

[0196] Using the test set data to perform performance evaluation and parameter tuning on the irritability classification model;

[0197] Output the fine-tuned irritability classification model.

[0198] The model deployment module 26 is used to deploy and maintain the irritability emotion classification method model into the application system; and is also used to:

[0199] Create an API service to load the model and receive requests and return model recognition results;

[0200] Deploy API services to application systems;

[0201] Monitor the running status of the API service and update the model regularly.

[0202] This embodiment further provides an electronic device, the electronic device comprising: a processor, a memory, and a bus;

[0203] The processor and the memory communicate with each other via a bus; the processor is used to call program instructions in the memory to execute the methods provided by the above-mentioned method embodiments.

[0204] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable a computer to execute the methods provided by the above method embodiments.

[0205] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various storage media that can store program codes.

[0206] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Those of ordinary skill in the art may understand and implement it without creative effort.

[0207] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods of each embodiment or some parts of the embodiment.

[0208] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for classifying irritability based on physiological parameters of facial videos, characterized in that: The method comprises: Collect facial video data; Extract rPPG signals from facial video data; The rPPG signal is subjected to noise reduction using an adaptive singular spectrum analysis algorithm, and multiple features used to describe heart rate-related indicators are extracted from it; The psychological irritability assessment tool was used to assess the subjects' psychological irritability levels and to label the irritability status categories; Based on the plurality of the features, the psychological irritability level and the irritability state category data, an extreme gradient boosting (XGBoost) classification algorithm is used to train and construct an irritability emotion classification model; Deploy and maintain the irritability classification model into the application system.

2. The method for classifying irritability based on physiological parameters of facial videos as claimed in claim 1, characterized in that: The method for extracting rPPG signals from facial video data specifically includes: Detecting each video frame of the facial video to obtain a facial rectangle and segment a facial region of interest; Identify color variations in the skin in each facial region of interest; The color model is applied to calculate the color channels of the varying skin color pixels, and the rPPG signal is constructed by the average value of the color channels.

3. The method for classifying irritability based on physiological parameters of facial video according to claim 2, characterized in that: The method of using an adaptive singular spectrum analysis algorithm to perform noise reduction processing on the rPPG signal and extracting multiple features for describing heart rate related indicators specifically includes: Constructing the trajectory matrix: Assume that the total length of the time series x(t) is N, the window length of constructing the trajectory matrix is ​​L, and define K = N-L+1. Then the trajectory matrix can be expressed as: X=[[x1,x2,…,x k ],[x2,x3,…,x k+1 ],…,[x L ,x L+1 ,…,x N ]]; Singular value decomposition: The singular value decomposition of the trajectory matrix X is: Where d = rank(X) ≤ min(L,K), d is the number of non-zero singular values ​​of X, λ1 is the maximum singular value, and U i and V i are the left and right singular vectors of X respectively; Adaptive component selection: The enhanced Lagrange multiplier algorithm (EALM) is used to select the first r larger singular values ​​of the trajectory matrix X; Signal reconstruction: Signal reconstruction uses the reconstruction matrix RCA = U(1,2,…,r)*(V T *[1,2,…,r]) and obtain the denoised rPPG signal, where the reconstruction matrix is ​​defined as the first r columns of U and V T The product of the first r rows of ; Extracting at least time domain features, frequency domain features and time-frequency domain features from the denoised rPPG signal; A plurality of parameters related to heart rate variability are extracted from the time domain features, the frequency domain features and the time-frequency domain features as the plurality of the features.

4. The method for classifying irritability based on physiological parameters of facial videos as claimed in claim 1, characterized in that: The method of using the psychological irritability assessment tool to assess the psychological irritability level of the subject and mark the irritability state category specifically includes: Data on the subjects’ psychological irritability levels were collected using a psychological irritability assessment tool; Processing missing values ​​and outliers on the psychological irritability level data; According to the content design of the psychological irritability assessment tool and routine practice combined with the processed irritability level data, the subjects' irritability symptom levels and irritability state categories were divided.

5. The method for classifying irritability based on physiological parameters of facial video according to claim 1, characterized in that: The method uses the extreme gradient boosting (XGBoost) classification algorithm to train and construct an irritability emotion classification model based on the multiple features, psychological irritability level and irritability state category data, specifically including: Dividing the plurality of features, irritability symptom levels, and irritability state category data into a training set, a test set, and a validation set; The extreme gradient boosting (XGBoost) classification algorithm is used to train the training set data and output the irritability emotion classification model; Use the test set and validation set data to evaluate the performance and optimize the parameters of the irritability classification model; Output the fine-tuned irritability classification model.

6. The method for classifying irritability based on physiological parameters of facial video according to claim 5, characterized in that: The method of selecting the extreme gradient boosting (XGBoost) classification algorithm to train the training set data and output the irritability classification model specifically includes: The training set data is normalized: the normalization transformation formula is X i , =X i -Xminmax min , where X i , X i , respectively represent the value of the i-th learning sample and its corresponding normalized value, X min and X max Respectively represent the minimum and maximum values ​​of each indicator; Extreme Gradient Boosting (XGBoost) classification algorithm parameter selection: select one of the grid search algorithm, genetic algorithm, and particle swarm algorithm to obtain the optimal solution of the parameters; The training set data is input into a preset model of an extreme gradient boosting (XGBoost) classification algorithm for training, and an irritability classification model is output.

7. The method for classifying irritability based on physiological parameters of facial videos as claimed in claim 1, characterized in that: The method for deploying and maintaining the irritability emotion classification model in the application system specifically includes: Create an API service to load the model and receive requests and return model recognition results; Deploy API services to application systems; Monitor the running status of the API service and update the model regularly.

8. An irritability classification system based on physiological parameters of facial videos, characterized in that: include: A data acquisition module, used for collecting facial video data; An rPPG signal extraction module, used to extract rPPG signals from facial video data; A feature extraction module is used to perform noise reduction processing on the rPPG signal using an adaptive singular spectrum analysis algorithm, and extract multiple features for describing heart rate related indicators; A data annotation module, used to evaluate the psychological irritability level of the subject using a psychological irritability assessment tool and annotate the irritability state category; A model training and evaluation module, for training and building an irritability emotion classification model using an extreme gradient boosting (XGBoost) classification algorithm based on the plurality of features, psychological irritability levels, and irritability state category data; The model deployment module is used to deploy and maintain the irritability emotion classification model into the application system.

9. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method according to any one of claims 1 to 7 is implemented.