A method for grading evaluation of personnel psychological stress based on breath VOCs
By constructing a dataset of original exhaled VOCs samples and performing Gram's angle field imaging processing, combined with the deep learning model of the CBAM attention module, the problem of insufficient accuracy in the existing technology of psychological stress grading evaluation based on exhaled VOCs is solved, and a high-precision psychological stress grading evaluation is achieved.
Patent Information
- Application Number
- CN202411030529.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2044-07-30
AI Technical Summary
Existing technologies lack a psychological stress grading evaluation method based on exhaled VOCs, and are unable to effectively utilize the fingerprint characteristics of exhaled VOCs to quantify psychological stress. In addition, existing research is highly subjective and lacks accuracy.
A dataset of original exhaled VOCs samples was constructed, and a graded evaluation of psychological stress was achieved through Gram's angular field imaging processing combined with a deep learning model of the CBAM attention module.
The accuracy and efficiency of psychological stress grading evaluation are improved, and the exhaled breath VOCs information is fully utilized to achieve high-precision psychological stress grading evaluation.
Smart Images

Figure CN119073988B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of gas detection, and particularly relates to a breath VOCs psychological stress evaluation technology. BACKGROUND
[0002] The changes in the types and levels of volatile organic compounds (VOCs) in human exhaled breath are related to human health. For example, heptanone and pentanone have been proven to be significantly associated with various chronic respiratory diseases, interferon gamma (IFN-γ) is related to the promotion of inflammation, and the concentration of IFN-γ reflects the level of psychological stress. Therefore, VOCs can be used as markers for breath detection. A large amount of evidence shows that breath VOCs signaling molecules are related to the physiological state of the human body, and breath VOCs are expected to decode precise diagnosis of diseases and health.
[0003] VOCs fingerprint features provide non-invasive, safe and direct observation of various biochemical processes occurring in the human body. VOCs come from the metabolism of various organs in the body and can be used as biomarkers for assessing physical health and diseases. After 50 years of development of related research on breath detection, the correlation between breath VOCs and diseases has become clearer and more explicit. The Human Breathomics Database of Oxford Academic has collected data from at least 2000 research papers and identified the correlation between nearly 60 diseases and VOCs disease signaling molecules in breath. These correlations are supported by hundreds of thousands of clinical samples.
[0004] In the prior art, CN202010053285.0 discloses a psychological stress evaluation method based on the fusion of electrocardiogram signals and electromyogram signals. The method extracts the recognition features of electrocardiogram physiological parameters and electromyogram physiological parameters, uses a stress recognition model for classification and recognition, and completes psychological stress rating. CN202211173892.6 discloses a psychological stress state evaluation method and system based on skin electricity signals. The method captures changes in skin electricity signals from multiple directions and analyzes the changes through joint analysis of multi-domain features to more accurately evaluate the psychological stress state. CN202210889339.6 discloses a psychological test evaluation method based on an adaptive algorithm. The method extracts and analyzes the features of electroencephalogram, electrocardiogram, pulse and skin electricity physiological parameters, combines single physiological parameter psychological stress evaluation with psychological stress evaluation of other three physiological parameters, realizes fusion classification based on multiple physiological parameters, and completes psychological state evaluation. CN202111641148.X discloses an athlete psychological stress evaluation method and system based on convolution and recurrent neural networks. The method establishes a psychological stress dataset based on the changes in the heart rate of athletes, extracts electrocardiogram signal features using convolutional neural networks and recurrent neural networks, constructs and trains a psychological stress monitoring model, and predicts the psychological stress level of athletes.
[0005] In summary, most of the existing technologies are based on physiological parameter characteristics such as electrocardiogram, electrodermal conduction, electromyography or electroencephalogram to evaluate the psychological stress state, and there is no mature psychological stress grading evaluation technology based on exhaled VOCs. The impact of exhaled VOCs information on psychological stress is very important. Although there are some studies on the correlation between psychological stress and respiratory signals, such studies focus on studying the correlation between psychological stress and respiratory frequency and amplitude, and do not use exhaled VOCs fingerprint feature data to quantify psychological stress. In addition, the existing research is too subjective, the theoretical basis is relatively simple, and its accuracy cannot be verified. Therefore, this patent proposes a method for grading and evaluating personnel psychological stress based on exhaled VOCs. Summary of the Invention
[0006] 1. Technical problems to be solved:
[0007] A grading evaluation method for personnel psychological stress based on exhaled VOCs is proposed.
[0008] 2. Technical solution:
[0009] In order to solve the above problems, the present invention provides a method for evaluating the psychological stress of personnel based on exhaled VOCs, which is characterized by comprising the following steps:
[0010] Step 1: Construct an exhaled breath VOCs raw sample dataset.
[0011] Step 2: Perform image processing on the exhaled VOCs sample data in the original sample data set based on the Gram angle field.
[0012] Step 3: Establish a psychological stress evaluation algorithm model framework.
[0013] Step 4: Train the psychological stress evaluation algorithm model to obtain a trained model framework.
[0014] Step 5: Read the test dataset and input it into the model framework trained in step 4 for classification, calculate the output category, and calculate the psychological stress assessment index.
[0015] Furthermore, the step 1 specifically includes the following steps:
[0016] Step 1.1: For the same subjects with different psychological states, psychological stress is induced through stress experiments. The original sample data of exhaled VOCs under different psychological stress states are collected using the electronic nose hardware platform to construct the original sample dataset X. The original sample dataset X is shown in the following formula;
[0017]
[0018] where xk represents the kth exhaled VOCs sample data, Represents the response data of the vth channel sensor in the kth exhaled VOCs sample data, m is the total number of samples, k∈m, v∈[1,12].
[0019] Step 1.2: After collecting the exhaled breath VOCs sample data, the subjects filled out the State Anxiety Questionnaire (STAI-Y1). Based on the STAI-Y1 questionnaire scores, the psychological stress category labels were divided. The psychological stress category labels were specifically divided into mild stress (20-40 points), moderate stress (40-60 points), and high stress (60-80 points) based on the STAI-Y1 questionnaire scores.
[0020] Furthermore, in step 1.1, the stress experiment is a rhythmic auditory sequence addition test. The implementation process of the PASAT test includes playing a recording of a digital sequence in a closed and quiet environment, requiring the subject to report the numbers heard one by one and add them to the previous number, and immediately report the answer. If the answer is wrong, there will be an extremely piercing alarm. The interval between the presentation of numbers is 4.5 seconds, which is reduced by 0.5 seconds every 2 minutes. The test lasts for 10 minutes. At the same time, a piercing alarm will sound every 10 trials regardless of the correctness of the answer.
[0021] Furthermore, in step 1.1, the electronic nose hardware acquisition platform is developed and produced by Anhui Six-Dimensional Sensing Technology Co., Ltd., and is used to collect human VOCs characteristic data. The sampling period of the electronic nose hardware platform is 500s and the sampling frequency is 10hz.
[0022] Furthermore, the step 2 specifically includes the following steps:
[0023] Step 2.1: Define the response data of the vth channel sensor in the kth exhaled VOCs sample data collected by the electronic nose hardware platform as The response data Normalized to the range of [-1,1], the specific formula is shown in formula (1):
[0024]
[0025] Where n is the total number of time points, i is the i-th time point, i∈[1,n], x i Represents the response value of the response data of the i-th sampling point; max and min represent the maximum and minimum response values in a set of response data; Indicates the normalized response value.
[0026] Step 2.2: Convert the normalized response data into the polar coordinate system, where the time and value of the response data are represented by the radius and angle in the polar coordinate system respectively. The specific calculation formula is shown in formula (2):
[0027]
[0028] in, is the angle value of the i-th data point after reconstruction; t i is the timestamp corresponding to the i-th data point; r i It represents the radius of the reconstructed data point i. In the form of polar coordinates, the data size and time relationship are preserved, and the independent variable and the dependent variable are one-to-one corresponding to each other in accordance with the mathematical bijective relationship.
[0029] Step 2.3: Calculate the angles between different points to characterize the temporal correlation of different data points, as shown in formula (3), where: Indicates the angle values of different data points,
[0030]
[0031] Among them, the numerical value of GASF is mapped into a pseudo-color image to obtain a single-channel pseudo-color image of the original exhaled breath VOCs data, realizing the transformation of one-dimensional time series signal to two-dimensional image.
[0032] Step 2.4: Repeat steps 2.1 to 2.3 to generate GASF images of the 12 channel sensor responses in the k-th exhaled VOCs sample data. Divide the 12 GASF images into four rows from top to bottom and three columns from left to right. Arrange them from the upper left corner to the lower right corner in order of channel number, and splice them into a complete sample image.
[0033] Step 2.5: For the original sample data set X = [x 1 ,...,x k ,...,x m ] perform the processing operations from step 2.1 to step 2.4 for each sample in the image to obtain an image sample dataset Z;
[0034] Step 2.6: Randomly extract 60% of the exhaled VOCs sample data from the image sample dataset Z as the training dataset, 20% as the validation dataset, and 20% as the test dataset. The data in the training dataset, validation dataset, and test dataset are not repeated.
[0035] Furthermore, the step three specifically includes the following steps:
[0036] Step 3.1: Build a deep algorithm model framework for psychological stress evaluation based on the enhanced attention mechanism. The structural order of the evaluation algorithm model framework is input layer, convolution layer, enhanced attention module, pooling layer and output layer. The input layer is responsible for preprocessing the input image after Gram angular field conversion; the convolution layer is used to extract local features in the input feature map and map these features to the next layer through convolution operation; the enhanced attention module introduces channel attention and spatial attention mechanisms; enhances the convolutional neural network's attention to important features and improves feature representation capabilities; the pooling layer reduces the feature map size and number of parameters by downsampling the feature map; the output layer flattens the multi-dimensional feature map output by the pooling layer into a one-dimensional feature vector through improved softmax classifier activation function calculation, performs feature fusion and integration, captures the nonlinear relationship of the input features, and outputs the final psychological stress grading evaluation category.
[0037] Step 3.2: At the input layer, first, data augmentation is performed on the input sample image; second, the dataset is expanded using random geometric transformations, including random horizontal flipping and random cropping operations, and Gaussian noise is randomly added to the image; finally, the image is normalized. The function of normalization is to scale the numerical range of the input data to a smaller interval so that the model training converges smoothly. The normalization uses the Min-Max normalization operation. The normalization formula is shown in Equation (4):
[0038]
[0039] Among them, norm represents the normalized pixel value, x i Represents the original image pixel value, min(x) and max(x) represent the minimum and maximum values of the original image pixels respectively.
[0040] Step 3.3: In the convolution layer, the sample images processed by the input layer are respectively subjected to feature extraction using a 3×3 Sobel operator convolution kernel, and a nonlinear ReLu activation function is added. The ReLu activation function is shown in formula (5):
[0041] ReLU(x)=max(0,x) (5),
[0042] The calculation process of the Sobel operator convolution kernel can be expressed by formula (6):
[0043]
[0044] Among them, G is the gradient image obtained by convolution of the Sobel operator, that is, the gradient size of each pixel point of the original sample image; G x is the approximate value of the horizontal gradient of each pixel of the original sample image; G yis the approximation of the vertical gradient of each pixel of the original sample image; normGAF is the normalized image matrix.
[0045] Step 3.4: In the attention enhancement module, an attention module is adopted, including a channel attention module and a spatial attention module, and the attention module is composed of the channel attention module and the spatial attention module in series. In the channel attention module, the feature map G i input into the module has a size of HxWxC, and first, a global maximum pooling and a global average pooling operation are used to compress the spatial size of the input feature and aggregate spatial information to obtain a feature representing global information, obtaining two feature maps G a and G m with a size of 1x1xC. Then, the obtained two channel feature maps are input into a shared multi-layer perceptron (MLP), and the weights W0 and W1 of the shared multi-layer perceptron are shared by the two inputs. In order to regulate the number of parameters, the number of neurons in the first layer is set to C / n, where n is the attenuation rate, that is, the original channel feature number is reduced to C / n. Then, the number of neurons in the last layer is set to C, and the compressed channel number is restored to obtain two feature maps G a1 and G m1 with a size of 1x1xC. Then, the two are summed one by one to obtain a feature vector and an Sigmoid function is used for activation operation to obtain a channel attention feature map. The specific formula is shown in formula (7),
[0046]
[0047] where δ represents the Sigmoid activation function; G represents the input feature map; MLP is a multi-layer perceptron; W0∈R C / n×C ,W1∈R C×C / n .
[0048] The spatial attention module is a supplement to the channel attention mechanism to obtain information. In the spatial attention module, first, the input original feature map is subjected to a maximum pooling and an average pooling operation in the channel direction to compress the channel number of the input feature, obtaining two feature maps Ma and Mm with a size of HxWx1. Then, the obtained two feature maps are spliced along the channel axis direction to obtain a feature map with a size of HxWx2. Then, a convolution kernel with a specific size is used to calculate to obtain a spatial attention map Mam. Finally, a Sigmoid function is used to normalize Mam to obtain a final spatial feature weight map M s (G). The specific formula is shown in formula (8),
[0049]
[0050] where σ represents the sigmoid activation function; f 7×7Represents a convolution operation with a convolution kernel size of 7×7.
[0051] The channel attention module and the spatial attention module are connected in series to obtain the attention module. The specific formula is shown in formula (9):
[0052]
[0053] Among them, G′ is the final output feature; G is the original input feature, Mc represents the channel attention unit, and Ms represents the spatial attention unit.
[0054] Step 3.5: In the pooling layer, select the maximum pooling process. The maximum value in the pooling window will be selected as the value of the corresponding position in the output feature map. Maximum pooling helps to retain the main features of the input feature map while suppressing the secondary features. The specific process includes: dividing the input feature map into multiple non-overlapping pooling windows, performing the maximum pooling operation in each pooling window, and using the operation result of each pooling window as the value of the corresponding position in the output feature map. According to the size, step size and filling strategy of the pooling window, the spatial dimension of the output feature map is adjusted. The maximum pooling operation is shown in formula (10).
[0055]
[0056] in Represents the value of the output feature map at position (i, j); Represents the value of the input feature map within the pooling window; max represents the selected maximum pooling operation.
[0057] Step 3.6: After the convolution, pooling and enhanced attention modules, the feature image samples are input to the Softmax classifier. The classifier converts the original output value into a value that can be interpreted as a probability, and finally outputs the results of different categories. The classification process of the Softmax classifier includes clarifying variables and sets, weighted combination of sample features and softmax function prediction classification. The Softmax function is shown in formula (11).
[0058]
[0059] Among them, softmax(z k ) is the predicted probability of each sample belonging to each category; z represents the output obtained by linearly weighted combination of the features of sample x, z = (z1, z2, ..., z K );z k Indicates that the weight vector of the sample feature is w k The scalar value obtained after the linear transformation of ; k represents the total category, k = 3.
[0060] The specific steps to clarify variables and sets in the Softmax classifier are as follows. Assume that the sample set contains N samples, and let the sample set be X, then X={x 1 , x 2 , x 3 ..., x N Any sample contains M features. Let any sample be x, then x=(x1,x2,x3,...,x M ), then the j-th feature of the i-th sample is expressed as The sample set is divided into K categories, and the class set is C, then C={c1,c2,...,c K}; the label set corresponding to the sample set is Y, each sample corresponds to a y, then Y={y1,y2,y3,...,y N}, where y i The value is an integer from 0 to K-1, and there are 3 label categories. If the sample x i Belongs to category 2, then: y i =(0,1,0).
[0061] The specific steps of weighted combination of sample features in Softmax classifier are as follows. Assume that any sample x = (x1, x2, x3, ..., x M ), x i represents the i-th feature of the sample, and performs a weighted combination of the features of sample x, as shown in formula (12),
[0062]
[0063] Where z represents the output obtained by linearly weighted combination of the features of sample x, z = (z1, z2, ..., z K );z k Indicates that the weight vector of the sample feature is w k The scalar value obtained after the linear transformation of w k represents the kth weight vector, with the same dimension as x; k represents the total number of categories, k=3.
[0064] Furthermore, the step 4 specifically includes the following steps:
[0065] Step 4.1: Establish a psychological stress assessment algorithm model framework and set training parameters, including weights and biases at each level.
[0066] Step 4.2: Randomly input a certain number of image samples from the training dataset without duplication, use the evaluation algorithm model framework to calculate the classification results, and use the validation dataset to calculate the loss function value. The input parameters include the number of input image channels and image size.
[0067] The loss function adopts the cross entropy loss function, which evaluates the classification model by measuring the amount of information, as shown in the following formula (13):
[0068]
[0069] in, Represents the predicted value of a single training sample label, y represents the true value of a single training sample label, y=(y1,...,y k );y k Indicates the true value of a single training sample belonging to the kth class, which takes the value 0 or 1; a k Indicates the predicted value that a single training sample belongs to the kth class, which is a probability value.
[0070] Step 4.3: Based on the loss function value, update the parameters using the set optimization algorithm. The parameters updated by the optimization algorithm include the weights and biases of each layer. The optimization algorithm adopts the gradient descent algorithm. The gradient descent algorithm updates the parameters in the direction where the loss function decreases fastest until it approaches the optimal solution. The gradient descent algorithm first initializes the unknown parameters of the model W = (w1, .., w K ), where each w K is a vector with the same dimension as the sample x, and the value of K is the same as the number of categories; finally, repeat equation (14) until convergence.
[0071]
[0072] Among them, α is the hyperparameter learning rate; J represents the cost function, which is the average of all sample errors defined in the entire training set, that is, the average of the loss function.
[0073] The weights and biases are updated and optimized by the gradient descent method. The updated weights and biases are shown in formula (15).
[0074]
[0075] Among them, w k and b k Represents the weight and bias of a single sample.
[0076] Step 4.4: Repeat steps 4.2 and 4.3 above, each time randomly reading a certain number of images from the training dataset without duplication, calculating the prediction results and loss function values, and optimizing the model parameters until all images in the training dataset have been trained at least once.
[0077] Furthermore, in step 5, the evaluation indicators include accuracy, precision and recall. Accuracy is the ratio of all correctly predicted observations to the total observations; precision is the ratio of true positive examples to all predicted positive observations; recall is the ratio of all actually positive observations to those correctly predicted positive. The specific formulas for accuracy, precision and recall are shown in formula (16).
[0078]
[0079] Among them, accuracy is the accuracy rate; precision is the precision rate; recall is the recall rate; TP means that the true category is positive and the category predicted by the model is also positive; FP means that the prediction is positive, but the true category is negative, and the true category and the predicted category are inconsistent; FN means that the prediction is negative, but the true category is positive, and the true category and the predicted category are inconsistent; TN means that the true category is negative and the category predicted by the model is also negative.
[0080] 3.Beneficial effects:
[0081] The present invention provides a method for grading and evaluating psychological stress based on exhaled VOCs. This method uses the Gram angle field to image exhaled VOC sample data and, combined with the CBAM attention module, fully extracts local and global information to achieve online, on-site psychological stress grading evaluation. Compared with traditional psychological stress classification methods based on physiological parameters, the method provided by the present invention utilizes exhaled VOCs information, converts exhaled VOCs sample time series data into two-dimensional image data, improves feature extraction capabilities, and fully utilizes the advantages of deep learning and computer vision in psychological stress grading evaluation, thereby achieving high-precision and efficient psychological stress grading evaluation. BRIEF DESCRIPTION OF THE DRAWINGS
[0082] Figure 1 This is a flow chart of the method for grading and evaluating human psychological stress based on exhaled VOCs provided by the present invention.
[0083] Figure 2 This is the structural diagram of the psychological stress evaluation algorithm model.
[0084] Figure 3 This is the structural diagram of the CBAM attention module.
[0085] Figure 4 This is a comparison chart of exhaled breath VOCs sample data and graphical sample data.
[0086] Figure 5It is the loss curve and accuracy curve of the algorithm model.
[0087] Figure 6 Comparison chart of confusion matrices of different models. DETAILED DESCRIPTION
[0088] The technical solution of the present invention is fully described below in conjunction with the accompanying drawings.
[0089] The present invention provides a method for evaluating the psychological stress of personnel based on exhaled VOCs. The method uses the Gram angle field to process the exhaled VOCs sample data into images, combines the CBAM attention module, and constructs a deep CNN neural network model to achieve online and on-site psychological stress status evaluation. The method comprises the following steps: Figure 1 As shown,
[0090] Step 1: Construct an exhaled breath VOCs raw sample dataset.
[0091] Step 2: Perform image processing on the exhaled VOCs sample data in the original sample data set based on the Gram angle field.
[0092] Step 3: Establish a psychological stress evaluation algorithm model framework.
[0093] Step 4: Train the psychological stress evaluation algorithm model to obtain a trained model framework.
[0094] Step 5: Read the test dataset and input it into the model framework trained in step 4 for classification, calculate the output category, and calculate the psychological stress assessment index.
[0095] Each step is described in detail below.
[0096] Step 1: Construct an exhaled breath VOCs raw sample dataset. This includes the following steps:
[0097] Step 1.1: For the same subjects with different psychological states, psychological stress is induced through stress experiments. The original sample data of exhaled VOCs under different psychological stress states are collected using the electronic nose hardware platform to construct the original sample dataset X. The original sample dataset X is shown in the following formula;
[0098]
[0099] where x k represents the kth exhaled VOCs sample data, Represents the response data of the vth channel sensor in the kth exhaled VOCs sample data, m is the total number of samples, k∈m, v∈[1,12];
[0100] Step 1.2: After collecting exhaled breath VOC sample data, the subjects completed the State Anxiety Questionnaire (STAI-Y1) and were assigned psychological stress categories based on their STAI-Y1 scores. The psychological stress categories were categorized as mild stress (20-40 points), moderate stress (40-60 points), and high stress (60-80 points).
[0101] Step 2: Perform image processing on the exhaled VOCs sample data in the original sample dataset based on the Gram angle field. This specifically includes the following steps:
[0102] Step 2.1: Define the response data of the vth channel sensor in the kth exhaled VOCs sample data collected by the electronic nose hardware platform as The response data Normalized to the range of [-1,1], the specific formula is shown in formula (1):
[0103]
[0104] Where n is the total number of time points, i is the i-th time point, i∈[1,n], x i Represents the response value of the response data of the i-th sampling point; max and min represent the maximum and minimum response values in a set of response data; Indicates the normalized response value.
[0105] Step 2.2: Convert the normalized response data to the polar coordinate system, where the time and value of the response data are represented by the radius and angle in the polar coordinate system. The specific calculation formula is shown in formula (2):
[0106]
[0107] in, is the angle value of the i-th data point after reconstruction; t i is the timestamp corresponding to the i-th data point; r i represents the radius of the reconstructed data point i. By using polar coordinates, the data size and time relationship are preserved, and the independent variable and the dependent variable are in a one-to-one correspondence, which conforms to the mathematical bijective relationship.
[0108] Step 2.3: Compute the angles and θ between different points to characterize the temporal correlation of different data points, as shown in formula (3). Represents the angle values of different data points.
[0109]
[0110] Wherein the numerical value of GASF is mapped to a pseudo-color image, obtaining a single-channel pseudo-color image about the original exhaled VOCs data, realizing the transformation of one-dimensional time series signal to two-dimensional image.
[0111] Step 2.4: Repeat steps 2.1 to 2.3 to generate GASF images of 12-channel sensor responses in the kth exhaled VOCs sample data respectively, divide the 12 GASF images into four rows from top to bottom and three columns from left to right, arrange them from left to right and from top to bottom in order of channel number from small to large, and then arrange them from top left to bottom right to splice into a complete sample image.
[0112] Step 2.5: Perform the processing operations of steps 2.1 to 2.4 on each sample in the original sample data set X = [x 1 ,..., x k ,..., x m ] to obtain the imaged sample data set Z.
[0113] Step 2.6: Randomly extract 60% of the exhaled VOCs sample data from the imaged sample data set Z to set up a training data set, 20% to set up a validation data set and 20% to set up a test data set. The data in the training data set, the validation data set and the test data set are not repeated.
[0114] Step three: Establish the psychological stress evaluation algorithm model framework. Specifically, the following steps are included:
[0115] Step 3.1: Build a psychological stress evaluation deep algorithm model framework based on enhanced attention mechanism. The structure sequence of the evaluation algorithm model framework is input layer, convolution layer, enhanced attention module, pooling layer and output layer in turn. The input layer is responsible for preprocessing the input image based on the Gram angle field conversion. The convolution layer is used to extract local features in the input feature map and map these features to the next layer through convolution operation. The enhanced attention module enhances the attention of the convolutional neural network to important features by introducing channel attention and spatial attention mechanisms, and improves the feature representation capability. The pooling layer reduces the feature map size and parameter quantity by downsampling the feature map. The output layer calculates the multi-dimensional feature map output by the pooling layer into a one-dimensional feature vector through an improved softmax classifier activation function, performs feature fusion and integration, captures the nonlinear relationship of the input features, and outputs the final psychological stress classification evaluation category.
[0116] Step 3.2: At the input layer, data augmentation is first performed on the input sample image. Next, the dataset is expanded using random geometric transformations, including random horizontal flipping and random cropping operations, and Gaussian noise is randomly added to the image. Finally, the image is normalized. Normalization scales the numerical range of the input data to a smaller range, ensuring smooth convergence of model training. Min-Max normalization is used for normalization. The normalization formula is shown in Equation (4):
[0117]
[0118] Among them, norm represents the normalized pixel value, x i Represents the original image pixel value, min(x) and max(x) represent the minimum and maximum values of the original image pixels respectively.
[0119] Step 3.3: In the convolution layer, the sample images processed by the input layer are respectively subjected to feature extraction using a 3×3 Sobel operator convolution kernel, and a nonlinear ReLu activation function is added. The ReLu activation function is shown in formula (5):
[0120] ReLU(x)=max(0,x) (5)
[0121] The calculation process of the Sobel operator convolution kernel can be expressed by formula (6):
[0122]
[0123] Among them, G is the gradient image obtained by convolution of the Sobel operator, that is, the gradient size of each pixel point of the original sample image; G x is the approximate value of the horizontal gradient of each pixel of the original sample image; G y is the approximate longitudinal gradient of each pixel of the original sample image; normGAF is the normalized image matrix.
[0124] Step 3.4: In the enhanced attention module, the attention module Convolutional Block Attention Module (CBAM) is used, which includes a channel attention module and a spatial attention module. The CBAM attention module is composed of a channel attention module and a spatial attention module in series, as shown in Figure 3 shown.
[0125] In the channel attention module, the feature map G of the module is input t The size of the feature map is H×W×C. First, the global maximum pooling and global average pooling operations are used to compress the spatial size of the input features, aggregate the spatial information to obtain the features that represent the global information, and obtain two feature maps G with a size of 1×1×C. a and Gm Then the two channel feature maps are fed into a shared multi-layer perceptron (MLP). The two inputs share the weights W0 and W1 of the multi-layer perceptron. In order to control the number of parameters, the number of neurons in the first layer is set to C / n, where n is the decay rate, that is, the original channel feature number is reduced to C / n. Then the number of neurons in the last layer is set to C, the compressed channel number is restored, and the feature map G of the size of 1×1×C of the two network outputs is obtained. a1 , G m1 , then sum the two one by one to get the feature vector and use the Sigmoid function to perform activation operation to get the channel attention feature map. The specific formula is shown in formula (7).
[0126]
[0127] Where δ represents the Sigmoid activation function; G represents the input feature map; MLP is a multi-layer perceptron; W0∈R C / n×C , W1∈R C×C / n .
[0128] The spatial attention module is a supplement to the information obtained by the channel attention mechanism. In the spatial attention module, the input original feature map is first subjected to maximum pooling and average pooling operations in the channel direction to compress the number of channels of the input feature, and two feature maps Ma and Mm with a size of H×W×1 are obtained. Subsequently, the two feature maps are spliced along the channel axis to obtain a feature map with a size of H×W×2. Then, a convolution kernel of a specific size is used to calculate it to obtain the spatial attention map Mam. Finally, Mam is normalized by the Sigmoid function to obtain the final spatial feature weight map M. s (G), specifically as shown in formula (8).
[0129]
[0130] Among them, σ represents the sigmoid activation function; f 7×7 Represents a convolution operation with a convolution kernel size of 7×7.
[0131] The channel attention module and the spatial attention module are connected in series to obtain the attention module (CBAM), and the specific formula is shown in Equation (9).
[0132]
[0133] Among them, G′ is the final output feature; G is the original input feature, Mc represents the channel attention unit, and Ms represents the spatial attention unit.
[0134] Step 3.5: In the pooling layer, the maximum pooling process is selected, and the maximum value in the pooling window will be selected as the value of the corresponding position in the output feature map. The maximum pooling helps to retain the main features in the input feature map while suppressing the secondary features. The specific process includes: dividing the input feature map into multiple non-overlapping pooling windows, performing maximum pooling operation in each pooling window, taking the operation result of each pooling window as the value of the corresponding position in the output feature map, and adjusting the spatial dimensions of the output feature map according to the size, step and padding strategy of the pooling window. The maximum pooling operation is shown in equation (10).
[0135]
[0136] wherein represents the value of the output feature map at position (i, j); represents the value of the input feature map within the pooling window; max represents the selected maximum pooling operation.
[0137] Step 3.6: After the feature image sample processed by convolution, pooling and enhanced attention module, it is input into the Softmax classifier. The original output value is converted into a value that can be interpreted as probability through the classifier, and the final output is the result of different categories. The classification process of Softmax classifier includes explicit variables and sets, weighted combination of sample features and softmax function prediction classification. The Softmax function is shown in equation (11).
[0138]
[0139] wherein, softmax(z k ) is the predicted probability of each sample belonging to each category; z represents the output obtained by linearly weighting and combining the features of the sample x, z = (z1, z2,..., z k ); z k represents the scalar value obtained by linearly transforming the features of the sample with the weight vector w k ; k represents the total number of categories, k = 3.
[0140] The specific steps of the explicit variables and sets in the Softmax classifier are as follows. Assuming that the sample set contains N samples, let the sample set be X, then X = {x 1 , x 2 , x 3 ..., x N}; any sample contains M features, let any sample be x, then x = (x1, x2, x3,..., x M ), then the jth feature of the ith sample is represented as The sample set is divided into K categories, denoted as C, then C = {c1, c2,..., cK}; the label set corresponding to the sample set is Y, each sample corresponds to a y, then Y={y1,y2,..,y N}, where y i The value of is an integer from 0 to K-1. There are three label categories. If the sample x i Belongs to category 2, then: y i =(0,1,0).
[0141] The specific steps of weighted combination of sample features in Softmax classifier are as follows. Assume that any sample x=(x1,x2,x3,...,x M ).x i Denotes the i-th feature of the sample. The features of sample x are weighted and combined as shown in formula (12).
[0142]
[0143] Where z represents the output obtained by linearly weighted combination of the features of sample x, z = (z1, z2, ..., z K );z k Indicates that the weight vector of the sample feature is w k The scalar value obtained after the linear transformation of w k represents the kth weight vector, with the same dimension as x; k represents the total number of categories, k=3.
[0144] Step 4: Train the psychological stress evaluation algorithm model to obtain a trained model framework. This includes the following steps:
[0145] Step 4.1: Establish the psychological stress assessment algorithm model framework and set the training parameters. The training parameters include the weights and biases of each layer.
[0146] Step 4.2: Randomly input a certain number of image samples from the training dataset without duplication, calculate the classification results using the evaluation algorithm model framework, and calculate the loss function value using the validation dataset. Input parameters include the number of input image channels and image size.
[0147] The loss function adopts the cross entropy loss function. The cross entropy loss function evaluates the classification model by measuring the amount of information.
[0148] The details are shown in the following formula (13).
[0149]
[0150] in, Represents the predicted value of a single training sample label, y represents the true value of a single training sample label, y=(y1,...,y k );y k Indicates the true value of a single training sample belonging to the kth class, which takes the value 0 or 1; a k Indicates the predicted value that a single training sample belongs to the kth class, which is a probability value.
[0151] Step 4.3: Based on the loss function value, use the set optimization algorithm to update the parameters. The parameters updated by the optimization algorithm usually include the weights and biases of each layer.
[0152] The optimization algorithm uses the gradient descent algorithm. The gradient descent algorithm updates the parameters in the direction where the loss function decreases fastest until it approaches the optimal solution. The gradient descent algorithm first initializes the unknown parameters of the model W = (w1, ..., w K ), where each w K is a vector with the same dimension as the sample x. The value of K is the same as the number of categories. Finally, Equation (14) is repeated until convergence.
[0153]
[0154] Among them, α is the hyperparameter learning rate; J represents the cost function, which is the average of all sample errors defined in the entire training set, that is, the average of the loss function.
[0155] The weights and biases are updated and optimized using the gradient descent method. The updated weights and biases are shown in formula (15).
[0156]
[0157] Among them, w k and b k Represents the weight and bias of a single sample.
[0158] Step 4.4: Repeat steps 4.2 and 4.3 above, each time randomly reading a certain number of images from the training dataset without duplication, calculating the prediction results and loss function values, and optimizing the model parameters until all images in the training dataset have been trained at least once.
[0159] Step 5: Read the test dataset and input it into the model framework trained in step 4 for classification. Calculate the output category and calculate the psychological stress assessment indicators, including accuracy, precision, and recall.
[0160] The evaluation metrics include accuracy, precision, and recall. Accuracy is the ratio of all correctly predicted observations (true positives and true negatives) to the total number of observations; precision is the ratio of true positives to all predicted positive observations; and recall is the ratio of all actually positive observations that were correctly predicted as positive. The specific formulas for accuracy, precision, and recall are shown in Equation (16).
[0161]
[0162] Among them, accuracy is the accuracy rate; precision is the precision rate; recall is the recall rate; TP means that the true category is positive and the category predicted by the model is also positive; FP means that the prediction is positive, but the true category is negative, and the true category and the predicted category are inconsistent; FN means that the prediction is negative, but the true category is positive, and the true category and the predicted category are inconsistent; TN means that the true category is negative and the category predicted by the model is also negative.
[0163] Furthermore, the stress experiment described in step 1 is the Paced Auditory Serial Addition Test (PASAT). The PASAT test involves playing a recording of a number sequence in a closed, quiet environment. The subject is asked to report each number they hear, add it to the previous number, and immediately state the answer. Wrong answers are accompanied by a piercing alarm. The interval between digit presentations is 4.5 seconds, decreasing by 0.5 seconds every two minutes for a total of 10 minutes. A piercing alarm sounds every 10 trials, regardless of the correctness of the answer.
[0164] Furthermore, the electronic nose hardware acquisition platform described in step 1 was developed and manufactured by Anhui Six-Dimensional Sensing Technology Co., Ltd. and can be used to collect VOCs characteristic data from the human body. The sampling period of the electronic nose hardware platform is 500 seconds and the sampling frequency is 10 Hz.
[0165] In a preferred embodiment of the present invention, a self-tested exhaled breath VOCs sample data set is used for testing, and the data set is collected by an electronic nose hardware platform. The electronic nose hardware platform in this embodiment is developed and produced by Anhui Six-Dimensional Sensing Technology Co., Ltd., and consists of 6 groups of sensor arrays, including 6 pairs of different gas sensors integrated and customized, and the sensors are temperature controlled and signal collected. The data set consists of the response values of an array composed of 12 MOS sensors to VOCs in human exhaled breath, and the continuous measurement time of each experiment is 600s. Table 1 gives the model of each sensor in the sensor array and the corresponding average voltage in the heater. Among them, the TGS series sensors are semiconductor gas sensors produced by Japan's FIGARO company, and the homemade VOC is a MOS sensor developed by Anhui Six-Dimensional Sensing Technology Co., Ltd., which is very sensitive to VOCs gas.
[0166] Table 1 Sensor types and average heater voltages
[0167]
[0168]
[0169] The experimental platform in this example is a laboratory high-performance computing platform equipped with an NVIDIA GeForce GTX 3080 processor and 10GB of video memory. Programming is done in Python, using PyTorch as the deep learning framework, and compiled using PyCharm. The complete experimental environment is shown in Table 2.
[0170] Table 2 Experimental configuration
[0171]
[0172] After each stress experiment, the exhaled breath VOCs data of the subject is continuously tested for a long period of 500 seconds. Taking a stress experiment as an example, the exhaled breath VOCs data of a subject is collected to obtain 12 channels of sample data. like Figure 4 As shown in A. To process the 12-channel sample data X in an image, it is necessary to process the responses of the 12 channels in sequence and then splice them. Taking the response data x2 of the second channel as an example, the image processing based on the Gram angle field is performed on x2 = (0.69, 0.69, 0.7, 0.7, ..., 0.64). First, the response data x2 is normalized to the range of [-1, 1] to obtain the normalized response data Normalize the response data Substitute it into the arc cosine function in the polar coordinate system to obtain the polar coordinate angle data corresponding to each sampling point Substitute the corresponding polar coordinate angle into the following formula to obtain a two-dimensional image GASF x2 .
[0173]
[0174] According to the above steps, the response data of the 12 channels in the sample data X are processed into images respectively and spliced in sequence to obtain a complete image sample data, such as Figure 4 As shown in B.
[0175] After collecting a set of exhaled breath VOCs sample data during each stress experiment, participants were asked to complete the State Anxiety Questionnaire (STAI-Y1). Based on the STAI-Y1 scores, psychological stress was categorized into three categories: high stress, moderate stress, and mild stress. Mild stress scores ranged from 20-40, moderate stress scores from 40-60, and high stress scores from 60-80. The STAI-Y1 questionnaire is shown in Table 3 below.
[0176] Table 3 State Anxiety Questionnaire (STAI-Y1)
[0177]
[0178]
[0179]
[0180] The STAI-Y1 questionnaire scoring criteria assigns 1 to 4 points according to the degree of the options. The option of "not at all" is assigned 1 point, the option of "some" is assigned 2 points, the option of "moderate degree" is assigned 3 points, and the option of "very obvious" is assigned 4 points.
[0181] The exhaled VOCs image sample dataset is obtained by image processing of the original sample dataset and is divided into a high-pressure sample set, a medium-pressure sample set, and a low-pressure sample set. The sample set division and label setting are shown in Table 4.
[0182] Table 4 Sample set division and label setting
[0183]
[0184] like Figure 2 As shown in Figure 5, in the process described in step 3, a psychological stress evaluation algorithm model framework was established, which made full use of the exhaled breath VOCs information, converted the exhaled breath VOCs sample data into image data, and improved the feature extraction capability. At the same time, the established psychological stress evaluation algorithm model was compared with the SqueezeNet, MobilenNetV3 and GhostNet models. The performance comparison results are shown in Table 5. The loss curve and accuracy curve of the algorithm model on the training set and validation set are shown in Table 5.Figure 5 As shown. The confusion matrix after the trained algorithm model classifies the test set is as follows Figure 6 As shown in the figure, (a) represents the confusion matrix of the psychological stress evaluation algorithm model, and (b), (c), and (d) represent the confusion matrices obtained by the SqueezeNet, MobilenNetV3, and GhostNet models, respectively.
[0185] Table 5 Performance comparison results of different models
[0186]
[0187] Any matter not described in detail in the present specification belongs to the prior art known to those skilled in the art. As described above, although the present invention has been shown and described with reference to specific preferred embodiments, this should not be construed as limiting the invention itself. Various changes in form and details may be made without departing from the spirit and scope of the invention as defined in the appended claims.
Claims
1. A method for grading and evaluating human psychological stress based on exhaled VOCs, characterized by: The following steps are involved: Step 1: Construct an exhaled breath VOCs original sample dataset; Step 2: Perform image processing on the exhaled VOCs sample data in the original sample dataset based on the Gram angle field; Step 3: Establish a psychological stress evaluation algorithm model framework; build a psychological stress evaluation algorithm model framework based on the enhanced attention mechanism. The structural order of the evaluation algorithm model framework is input layer, convolution layer, enhanced attention module, pooling layer and output layer. The input layer is responsible for preprocessing the input image after Gram angular field transformation; the convolution layer is used to extract local features in the input feature map and map these features to the next layer through convolution operation; the enhanced attention module introduces channel attention and spatial attention mechanisms; enhances the convolutional neural network's attention to important features and improves feature representation capabilities; The pooling layer downsamples the feature map, reducing its size and number of parameters. The output layer flattens the multi-dimensional feature map output by the pooling layer into a one-dimensional feature vector through the improved softmax classifier activation function calculation, performing feature fusion and integration. This captures the nonlinear relationship between the input features and outputs the final psychological stress rating category. Step 4: Train the psychological stress evaluation algorithm model to obtain a trained model framework; Step 5: Read the test dataset and input it into the model framework trained in step 4 for classification, calculate the output category, and calculate the psychological stress assessment index.
2. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 1, wherein: The step 1 specifically includes the following steps: Step 1.1: For the same subjects with different psychological states, psychological stress is induced through stress experiments. The original sample data of exhaled VOCs under different psychological stress states are collected using the electronic nose hardware platform to construct the original sample dataset X. The original sample dataset X is shown in the following formula; , in represents the kth exhaled VOCs sample data, represents the response data of the vth channel sensor in the kth exhaled VOCs sample data, m is the total number of samples, , ; Step 1.2: After collecting the exhaled breath VOCs sample data, the subjects filled out the State Anxiety Questionnaire (STAI-Y1). Based on the STAI-Y1 questionnaire scores, the psychological stress category labels were divided. The psychological stress category labels were specifically divided into mild stress (20-40 points), moderate stress (40-60 points), and high stress (60-80 points) based on the STAI-Y1 questionnaire scores.
3. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 2, wherein: In step 1.1, the stress experiment is a rhythmic auditory serial addition test. The implementation process of the PASAT test includes playing a recording of a digital sequence in a closed and quiet environment. The subject is required to report the number heard one by one and add it to the previous number, and immediately report the answer. If the answer is wrong, an extremely piercing alarm will be sounded. The interval between the presentation of the numbers is 4.5 seconds, which is reduced by 0.5 seconds every 2 minutes. The test lasts for 10 minutes. At the same time, a piercing alarm will sound every 10 trials regardless of the correctness of the answer.
4. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 2, wherein: In step 1.1, the electronic nose hardware platform is developed and manufactured by Anhui Six-Dimensional Sensing Technology Co., Ltd. and is used to collect VOCs characteristic data of the human body. The sampling period of the electronic nose hardware platform is 500s and the sampling frequency is 10hz.
5. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 2, wherein: The step 2 specifically includes the following steps: Step 2.1: Define the response data of the vth channel sensor in the kth exhaled VOCs sample data collected by the electronic nose hardware platform as =( , , ,…, ), the response data Normalized to the range of [-1,1], the specific formula is shown in formula (1): (1) Where n is the total number of time points, i is the i-th time point, , Represents the response value of the response data of the i-th sampling point; max and min represent the maximum and minimum response values in a set of response data; Indicates the normalized response value; Step 2.2: Convert the normalized response data into the polar coordinate system, where the time and value of the response data are represented by the radius and angle in the polar coordinate system respectively. The specific calculation formula is shown in formula (2): (2) in, is the angle value of the i-th data point after reconstruction; is the timestamp corresponding to the i-th data point; Represents the radius of the reconstructed i-th data point. Through the form of polar coordinates, the data size and time relationship are preserved, and the independent variable and the dependent variable are one-to-one corresponding to conform to the mathematical bijective relationship; Step 2.3: Compute the angles between different points to characterize the temporal correlation of different data points, as shown in formula (3), where 𝜑𝑖 and 𝜑𝑗 represent the angle values of different data points. (3) The GASF value is mapped into a pseudo-color image to obtain a single-channel pseudo-color image of the original exhaled breath VOCs data, realizing the transformation of the one-dimensional time series signal into a two-dimensional image. Step 2.4: Repeat steps 2.1 to 2.3 to generate the responses of the 12 channel sensors in the k-th exhaled VOCs sample data. Image, 12 The image is divided into four rows from top to bottom and three columns from left to right. They are arranged from the upper left corner to the lower right corner in descending order of channel number and stitched together to form a complete sample image. Step 2.5: For the original sample data set Perform the processing operations from step 2.1 to step 2.4 on each sample in to obtain an image sample dataset Z; Step 2.6: Randomly extract 60% of the exhaled VOCs sample data from the image sample dataset Z as the training dataset, 20% as the validation dataset, and 20% as the test dataset. The data in the training dataset, validation dataset, and test dataset are not repeated.
6. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 1, wherein: The step three specifically includes the following steps: Step 3.2: At the input layer, first, data augmentation is performed on the input sample image; second, the dataset is expanded using random geometric transformations, including random horizontal flipping and random cropping operations, and Gaussian noise is randomly added to the image; finally, the image is normalized. The function of normalization is to scale the numerical range of the input data to a smaller interval so that the model training converges smoothly. The normalization uses the Min-Max normalization operation. The normalization formula is shown in Equation (4): (4) in, represents the normalized pixel value, Represents the original image pixel value, 、 Represent the minimum and maximum values of the original image pixels respectively; Step 3.3: In the convolution layer, the sample images processed by the input layer are respectively subjected to feature extraction using a 3×3 Sobel operator convolution kernel, and a nonlinear ReLu activation function is added. The ReLu activation function is shown in formula (5): (5) The calculation process of the Sobel operator convolution kernel can be expressed by formula (6): (6) Among them, G is the gradient image obtained by convolution of the Sobel operator, that is, the gradient size of each pixel point of the original sample image; is the approximate value of the horizontal gradient of each pixel of the original sample image; is the approximate longitudinal gradient of each pixel of the original sample image; is the normalized image matrix; Step 3.4: In the enhanced attention module, an attention module is used, including a channel attention module and a spatial attention module. The attention module is composed of a channel attention module and a spatial attention module in series. In the channel attention module, the feature map of the module is input The size of the feature map is H×W×C. First, the global maximum pooling and global average pooling operations are used to compress the spatial size of the input features, aggregate the spatial information to obtain the features that represent the global information, and obtain two feature maps of size 1×1×C. and , then the two channel feature maps are fed into a shared multi-layer perceptron (MLP), and the two inputs share the weights of the multi-layer perceptron and , in order to control the number of parameters, the number of neurons in the first layer is set to , where n is the attenuation rate, which means reducing the original channel feature number to Then, the number of neurons in the last layer is set to C, the compressed number of channels is restored, and the feature maps of the size of the two network outputs are obtained as 1×1×C. 、 , then sum the two one by one to get the feature vector and use the Sigmoid function to activate the channel attention feature map. The specific formula is shown in formula (7). (7) Where 𝛿 represents the Sigmoid activation function; G represents the input feature map; MLP is a multi-layer perceptron; , The spatial attention module is a supplement to the information obtained by the channel attention mechanism. In the spatial attention module, the input original feature map is first subjected to maximum pooling and average pooling operations in the channel direction to compress the number of channels of the input feature, and two feature maps Ma and Mm with sizes of H×W×1 are obtained. Subsequently, the two feature maps are spliced along the channel axis to obtain a feature map with a size of H×W×2. Then, a convolution kernel of a specific size is used to calculate it to obtain the spatial attention map Mam. Finally, Mam is standardized by the Sigmoid function to obtain the final spatial feature weight map. , as shown in formula (8), (8) in, Represents the sigmoid activation function; represents a convolution operation with a convolution kernel size of 7×7, The channel attention module and the spatial attention module are connected in series to obtain the attention module. The specific formula is shown in formula (9): (9) Among them, G′ is the final output feature; G is the original input feature, 𝑀𝑐 represents the channel attention unit, and 𝑀𝑠 represents the spatial attention unit; Step 3.5: In the pooling layer, select the maximum pooling process. The maximum value in the pooling window will be selected as the value of the corresponding position in the output feature map. Maximum pooling helps to retain the main features of the input feature map while suppressing the secondary features. The specific process includes: dividing the input feature map into multiple non-overlapping pooling windows, performing the maximum pooling operation in each pooling window, and using the operation result of each pooling window as the value of the corresponding position in the output feature map. According to the size, step size and filling strategy of the pooling window, the spatial dimension of the output feature map is adjusted. The maximum pooling operation is shown in formula (10). (10) in Indicates that the output feature map is at position ( ) at the value; Represents the value of the input feature map within the pooling window; represents the selected maximum pooling operation; Step 3.6: After the convolution, pooling and enhanced attention modules, the feature image samples are input to the Softmax classifier. The classifier converts the original output value into a value that can be interpreted as a probability, and finally outputs the results of different categories. The classification process of the Softmax classifier includes clarifying variables and sets, weighted combination of sample features and softmax function prediction classification. The Softmax function is shown in formula (11). (11) in, The predicted probability of each sample belonging to each category; Indicates the sample The output obtained by linearly weighted combination of the features of ; Indicates that the weight vector of the sample features is The scalar value obtained after the linear transformation of ; Indicates the total category, =3, The specific steps to clarify variables and sets in the Softmax classifier are as follows. Assume that the sample set contains N samples, let the sample set be X, then ; Any sample contains M features, let any sample be x, then , then the jth feature of the i-th sample is expressed as ; The sample set is divided into K categories, and the classification set is C, then ; The label set corresponding to the sample set is Y, and each sample corresponds to a y, then ,in, The value of There are three categories of labels. If it belongs to Category 2, then: , The specific steps of weighted combination of sample features in Softmax classifier are as follows. Assume that any sample , Indicates the sample’s Features, for samples The features of are weighted combined, as shown in formula (12), (12) in, Indicates the sample The output obtained by linearly weighted combination of the features of ; Indicates that the weight vector of the sample features is The scalar value obtained after the linear transformation of ; Represents the kth weight vector, with the same dimension as consistent; Indicates the total category, =3.
7. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 1, wherein: The step 4 specifically includes the following steps: Step 4.1: Establish the psychological stress assessment algorithm model framework and set the training parameters, including the weights and biases of each level; Step 4.2: Randomly input a certain number of image samples from the training dataset without duplication, calculate the classification results using the evaluation algorithm model framework, and calculate the loss function value using the validation dataset. The input parameters include the number of input image channels and image size. The loss function adopts the cross entropy loss function, which evaluates the classification model by measuring the amount of information, as shown in the following formula (13): (13) in, Represents the label prediction value of a single training sample, ; Represents the true value of a single training sample label, ; Indicates that a single training sample belongs to the true value of the kth class, which takes the value 0 or 1; Indicates the predicted value of a single training sample belonging to the kth class, which is a probability value; Step 4.3: Based on the loss function value, update the parameters using the set optimization algorithm. The parameters updated by the optimization algorithm include the weights and biases of each layer. The optimization algorithm adopts the gradient descent algorithm. The gradient descent algorithm updates the parameters in the direction where the loss function decreases fastest until it approaches the optimal solution. The gradient descent algorithm first initializes the unknown parameters of the model. , each of which is a vector with the same dimension as the sample x, and the value of K is the same as the number of categories; finally, repeat equation (14) until convergence. (14) in, is the hyperparameter learning rate; Represents the cost function, which is the average of all sample errors defined on the entire training set, that is, the average of the loss function. The weights and biases are updated and optimized by the gradient descent method. The updated weights and biases are shown in formula (15). (15) in, and Represents the weight and bias of a single sample; Step 4.4: Repeat steps 4.2 and 4.3 above, each time randomly reading a certain number of images from the training dataset without duplication, calculating the prediction results and loss function values, and optimizing the model parameters until all images in the training dataset have been trained at least once.
8. The method for grading and evaluating psychological stress of a person based on exhaled VOCs according to claim 1, wherein: In step 5, the evaluation indicators include accuracy, precision and recall. Accuracy is the ratio of all correctly predicted observations to the total observations; precision is the ratio of true positive examples to all predicted positive observations; recall is the ratio of all actually positive observations to those correctly predicted positive. The specific formulas for accuracy, precision and recall are shown in formula (16). (16) in, is the accuracy rate; is the accuracy rate; is the recall rate; TP means that the true category is positive and the category predicted by the model is also positive; FP means that the prediction is positive, but the true category is negative, and the true category and the predicted category are inconsistent; FN means that the prediction is negative, but the true category is positive, and the true category and the predicted category are inconsistent; TN means that the true category is negative and the category predicted by the model is also negative.
Citation Information
Patent Citations
A psychological stress assessment method based on the fusion of electrocardiogram and electromyography signals
CN111150410B
A Method and System for Assessing Athlete Psychological Stress Based on Convolutional and Recurrent Neural Networks
CN114343637B
Psychological stress state assessment method and system based on skin electric signals
CN115568853A
Psychological test evaluation method based on adaptive algorithm
CN115813388A
Psychological stress monitoring method based on fusion attention mechanism
CN114668397A