Personnel psychological stress grading evaluation method based on expiratory VOCs (Volatile Organic Compounds)
By combining the image processing of exhaled VOCs data and the CBAM attention module, a deep CNN model was constructed, which solved the problem of grading and evaluation of psychological stress that failed to effectively utilize exhaled VOCs in the existing technology, and achieved high-precision psychological stress Rating evaluation.
Patent Information
- Application Number
- CN202411030529.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-07-30
AI Technical Summary
The existing technology lacks the grading and evaluation technology of psychological stress based on expiratory VOCs. The existing research mainly focuses on the correlation between psychological stress and respiratory signals. It has failed to effectively use the fingerprint feature data of expiratory VOCs to quantify psychological stress, and there is subjectivity and theory. A simple basic question.
Gram angle field is used to image the expiratory VOCs sample data, and combined with the CBAM attention module, a deep CNN neural network model is constructed to realize the online and in-situ psychological stress status rating evaluation.
By converting expiratory VOCs information into two-dimensional images, the feature extraction ability is improved and high-precision and efficient psychological stress grading evaluation is achieved, which has better accuracy and efficiency than traditional methods based on physiological parameters.
Smart Images

Figure CN119073988A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of gas detection, and in particular relates to a breath VOCs psychological stress evaluation technology. Background Art
[0002] 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 shown to be significantly associated with a variety of chronic respiratory diseases. Interferon γ (IFN-γ) is related to the initiation of inflammation, and its concentration will reflect the level of psychological stress. It can be seen that VOCs can be used as a marker for breath detection. A large amount of evidence shows that exhaled VOCs signal molecules are associated with the physiological state of the human body, and exhaled VOCs are expected to decode and accurately diagnose disease and health.
[0003] VOCs fingerprint characteristics provide non-invasive, safe and direct observation of various biochemical processes occurring inside the human body. VOCs come from the metabolism of organs throughout the body and can be used as biomarkers to assess physical health and disease. After 50 years of development in breath testing research, the correlation between exhaled VOCs and diseases has become increasingly clear and explicit. Oxford Academic's "Human Breathomics Database" includes at least 2,000 research papers, identifying the association between nearly 60 diseases and VOCs disease signal molecules in exhaled breath. These correlations involve the support of hundreds of thousands of clinical samples.
[0004] In the prior art, CN202010053285.0 discloses a psychological stress assessment method based on the fusion of ECG signals and EMG signals. This method extracts the identification features of electrocardiographic physiological parameters and electromyographic physiological parameters; uses the stress recognition model for classification and identification to complete the psychological stress rating; CN202211173892.6 discloses a psychological stress state assessment method and system based on skin electrodermal signals. This method captures the changes in skin electrodermal signals from multiple directions, and through the joint analysis of multi-domain features, gives a more accurate assessment of the psychological stress state; CN202210889339.6 discloses a psychological test assessment method based on an adaptive algorithm. This method extracts and analyzes the characteristics of EEG, ECG, pulse and skin electrodermal physiological parameters, combines the single physiological parameter psychological stress assessment with the other three physiological parameter psychological stress assessments, realizes fusion classification based on multiple physiological parameters, and completes the psychological state assessment. CN202111641148.X published a method and system for assessing athlete psychological stress based on convolutional and recurrent neural networks. The method establishes a psychological stress data set through the athlete's heartbeat changes, uses convolutional neural networks and recurrent neural networks to extract electrocardiogram signal features, constructs and trains a psychological stress monitoring model, and predicts the athlete's psychological stress level results.
[0005] In summary, most of the existing technologies are based on physiological parameter characteristics such as electrocardiogram, electrodermal, 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 have been 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 method for grading and evaluating personnel psychological stress based on exhaled VOCs was 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 angular 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 data set 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 different psychological states of the same subjects, psychological stress is induced through stress experiments, and 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 data set X. The original sample data set 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 VOCs sample data, the subjects filled out the state anxiety questionnaire (STAI-Y1), and divided the psychological stress category labels according to the STAI-Y1 questionnaire scores. 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 according to the STAI-Y1 questionnaire scores.
[0020] Further, in step 1.1, the stress experiment is a rhythmic auditory sequence addition test. The implementation process of the PASAT test includes playing a digital sequence recording in a closed and quiet environment, requiring the subject to report the heard numbers 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 number presentations 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 collection platform is developed and produced by Anhui Six Dimensional Sensing Technology Co., Ltd., and is used to collect human VOCs characteristic data, wherein 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; Represents the normalized response value.
[0026] 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):
[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 i-th data point. 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, which conforms to the mathematical bijective relationship.
[0029] Step 2.3: Compute the angles and between different points to characterize the temporal correlation of different data points, as shown in formula (3), where: Represents 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 sensor responses of the 12 channels in the k-th 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 the upper left corner to the lower right corner in order from small to large according to the number of channels, 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 ] performs processing operations from step 2.1 to step 2.4 on each sample in the image to obtain an image sample data set Z;
[0034] Step 2.6: Randomly extract 60% of the exhaled VOCs sample data from the imaged 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 focus of the convolutional neural network on important features and improves the feature representation ability; the pooling layer reduces the feature map size and the 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 the improved softmax classifier activation function calculation, and 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, firstly, data enhancement is performed on the input sample image; secondly, the data set is expanded by random geometric transformation, 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 formula (4):
[0038]
[0039] Among them, norm represents the normalized pixel value, x i Represents the pixel value of the original image, min(x) and max(x) represent the minimum and maximum values of the pixels of the original image, 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 lateral gradient of each pixel of the original sample image; G yis the approximate longitudinal gradient of each pixel of the original sample image; normGAF is the image matrix after normalization.
[0045] 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 the channel attention module and the spatial attention module in series. In the channel attention module, the feature map G of the module is input i 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 G m Then, the obtained two channel feature maps are sent to 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, and the compressed number of channels is restored to obtain the feature map G of the size of 1×1×C output by the two networks. a1 , G m1 , 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).
[0046]
[0047] Among them, δ 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 information obtained by the channel attention mechanism. In the spatial attention module, the input original feature map is firstly 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 concatenated along the channel axis direction to obtain a feature map with a size of H×W×2, and 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 M. s (G), specifically as shown in formula (8),
[0049]
[0050] Among them, σ 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 into 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 that each sample belongs 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 features is w k The scalar value obtained after 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, 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 i-th sample is expressed as The sample set is divided into K categories, and the category set is denoted as 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. There are three 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 features is w k The scalar value obtained after the linear transformation of 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 the psychological stress evaluation algorithm model framework and set the training parameters, which include the weights and biases of each level.
[0066] Step 4.2: Randomly input a certain number of image samples from the training data set without duplication, use the evaluation algorithm model framework to calculate the classification results, and use the verification data set to calculate the loss function value. The input parameters include the number of input image channels and image size.
[0067] The loss function uses 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: According to the loss function value, use the set optimization algorithm to update the parameters. 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 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, randomly reading a certain number of images from the training data set without duplication each time, calculating the prediction results and loss function values, and optimizing the model parameters until all images in the training data set have completed training more than 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 as positive examples. The specific formulas of 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 evaluating the psychological stress of personnel based on exhaled VOCs. The method uses the Gram angle field to perform image processing on the exhaled VOCs sample data, and combines the CBAM attention module to fully extract local and global information to achieve online and on-site psychological stress grading evaluation. Compared with the traditional psychological stress classification method based on physiological parameters, the method provided by the present invention utilizes the exhaled VOCs information, converts the exhaled VOCs sample time series data into two-dimensional image data, improves the feature extraction capability, and fully utilizes the advantages of deep learning and computer vision in the 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 personnel 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 This is a comparison chart of the 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 in an image format, 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 angular 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 data set 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 the exhaled breath VOCs original sample dataset. Specifically, it includes the following steps:
[0097] Step 1.1: For the different psychological states of the same subjects, psychological stress is induced through stress experiments, and 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 data set X. The original sample data set 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 the exhaled VOCs sample data, the subjects filled out the state anxiety questionnaire (STAI-Y1), and classified the psychological stress category labels according to the STAI-Y1 questionnaire scores. The psychological stress category labels are specifically divided into mild stress (20-40 points), moderate stress (40-60 points), and high stress (60-80 points) according to the STAI-Y1 questionnaire scores;
[0101] Step 2: Based on the Gram angular field, the exhaled VOCs sample data in the original sample data set is processed into images. Specifically, the following steps are included:
[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; Represents 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 i-th data point after reconstruction. 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 each other, 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] 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.
[0111] Step 2.4: Repeat steps 2.1 to 2.3 to generate GASF images of the sensor responses of the 12 channels in the k-th 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 the upper left corner to the lower right corner in order from small to large according to the number of channels, and splice them into a complete sample image.
[0112] Step 2.5: For the original sample data set X = [x 1 , ..., x k , ..., x m ] perform processing operations from step 2.1 to step 2.4 for each sample in the image to obtain an image sample data set Z.
[0113] 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.
[0114] Step 3: Establish a psychological stress evaluation algorithm model framework. Specifically, it includes the following steps:
[0115] Step 3.1: Build a deep algorithm model framework for psychological stress evaluation based on 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 enhances the focus of the convolutional neural network on important features and improves the feature representation ability by introducing channel attention and spatial attention mechanisms. The pooling layer reduces the feature map size and the 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 the 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.
[0116] Step 3.2: At the input layer, first perform data augmentation on the input sample image. Secondly, use random geometric transformation to expand the data set, including random horizontal flipping and random cropping operations, and randomly add Gaussian noise to the image. Finally, normalize the image. 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. Normalization uses the Min-Max normalization operation. The normalization formula is shown in formula (4):
[0117]
[0118] Among them, norm represents the normalized pixel value, x i Represents the pixel value of the original image, min(x) and max(x) represent the minimum and maximum values of the pixels of the original image, 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 lateral 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 image matrix after normalization.
[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, such as 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 sent to 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, and the compressed channel number is restored to obtain the feature map G of the size of 1×1×C output by the two networks. a1 , G m1 , 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).
[0126]
[0127] Among them, δ 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 firstly 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 concatenated along the channel axis to obtain a feature map with a size of H×W×2, and 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 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 formula (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, select the maximum pooling process, and 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 in the input feature map while suppressing 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 padding strategy of the pooling window, the spatial dimension of the output feature map is adjusted. The maximum pooling operation is shown in formula (10).
[0135]
[0136] 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.
[0137] Step 3.6: After the convolution, pooling and enhanced attention modules, the feature image samples are input into 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).
[0138]
[0139] Among them, softmax(z k ) is the predicted probability that each sample belongs 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 features is w k The scalar value obtained after linear transformation of ; k represents the total category, k = 3.
[0140] The specific steps to define 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 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 i-th sample is expressed as The sample set is divided into K categories, and the category set is 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 between 0 and K-1. There are 3 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 ). i Represents the i-th feature of the sample. The features of sample x are weighted 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 features is w k The scalar value obtained after the linear transformation of 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 model framework of the psychological stress evaluation algorithm and set the training parameters. The training parameters include the weights and biases of each level.
[0146] Step 4.2: Randomly input a certain number of image samples from the training data set without duplication, use the evaluation algorithm model framework to calculate the classification results, and use the validation data set to calculate the loss function value. The 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: Update the parameters using the set optimization algorithm according to the loss function value. The parameters updated by the optimization algorithm usually include the weights and biases of each layer.
[0152] 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 sample x. The value of K is the same as the number of categories. Finally, repeat equation (14) 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 by 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, randomly reading a certain number of images from the training data set without duplication each time, calculating the prediction results and loss function values, and optimizing the model parameters until all images in the training data set have completed training more than once.
[0159] Step 5: Read the test data set 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 indicators include accuracy, precision and recall. Accuracy is the ratio of all correctly predicted observations (true positives and true negatives) to the total observations; precision is the ratio of true positives to all predicted positive observations; recall is the ratio of all actually positive observations that are correctly predicted to be positive. The specific formulas for accuracy, precision and recall are shown in formula (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 a rhythmic auditory serial addition test (PASAT). The implementation process of the PASAT test includes playing a digital sequence recording in a closed and quiet environment, requiring the subject to report the heard numbers 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 harsh alarm. 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, every 10 trials, regardless of the correctness of the answer, a harsh alarm will sound.
[0164] Furthermore, the electronic nose hardware collection platform described in step 1 is developed and produced by Anhui Six Dimensional Sensing Technology Co., Ltd., and can be used to collect human VOCs characteristic data. The sampling period of the electronic nose hardware platform is 500s and the sampling frequency is 10hz.
[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 which the TGS series sensors are semiconductor gas sensors produced by FIGARO of Japan, 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 voltage
[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 10G video memory. Python language is used for programming, Pytorch is used as the deep learning framework, and Pycharm is used as the compilation software. The complete configuration environment of the experiment is shown in Table 2.
[0170] Table 2 Experimental configuration
[0171]
[0172] After each stress experiment, the exhaled breath VOCs data of the subject was continuously tested for a long period of 500 seconds. Taking a stress experiment as an example, the exhaled breath VOCs data of a subject was 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, x2 = (0.69, 0.69, 0.7, 0.7, ..., 0.64) is processed in an image based on the Gram angle field. 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 arccosine 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 VOCs sample data in each stress experiment, the subjects were required to fill out the state anxiety questionnaire (STAI-Y1). According to the scores of the STAI-Y1 questionnaire, the psychological stress category was divided into three categories: high stress, moderate stress and mild stress. Among them, the mild stress score was 20-40 points, the moderate stress score was 40-60 points, and the high stress score was 60-80 points. 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 imaging 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, the psychological stress evaluation algorithm model framework is established, the exhaled VOCs information is fully utilized, the exhaled VOCs sample data is converted into image data, and the feature extraction capability is improved. At the same time, the established psychological stress evaluation algorithm model is 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 the validation set are shown in Table 5. Figure 5 The confusion matrix after the trained algorithm model classifies the test set is as follows Figure 6 As shown, (a) represents the confusion matrix of the psychological stress evaluation algorithm model, (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] Contents not described in detail in the present specification belong to the prior art known to those skilled in the art. As mentioned above, although the present invention has been shown and described with reference to specific preferred embodiments, it should not be construed as limiting the present invention itself. Various changes may be made to it in form and detail without departing from the spirit and scope of the present invention as defined in the appended claims.
Claims
1. A method for evaluating the psychological stress of personnel based on exhaled VOCs, characterized by: The following steps are involved: Step 1: Construct an exhaled breath VOCs original sample dataset; Step 2: Image processing of the exhaled VOCs sample data in the original sample data set based on the Gram angle field; Step 3: Establish a psychological stress evaluation algorithm model framework; Step 4: Train the psychological stress evaluation algorithm model to obtain a trained model framework; Step 5: Read the test data set 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 evaluating the psychological stress of personnel based on exhaled VOCs according to claim 1, characterized in that: The step 1 specifically includes the following steps: Step 1.1: For the different psychological states of the same subjects, psychological stress is induced through stress experiments, and 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 data set X. The original sample data set X is shown in the following formula; 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]; Step 1.2: After collecting the exhaled VOCs sample data, the subjects filled out the state anxiety questionnaire (STAI-Y1), and divided the psychological stress category labels according to the STAI-Y1 questionnaire scores. 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 according to the STAI-Y1 questionnaire scores.
3. The method for evaluating the psychological stress of personnel based on exhaled VOCs according to claim 2, characterized in that: In step 1.1, the stress experiment is a rhythmic auditory sequence addition test. The implementation process of the PASAT test includes playing a digital sequence recording in a closed and quiet environment, requiring the subject to report the heard numbers 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 number presentations 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 evaluating the psychological stress of personnel based on exhaled VOCs according to claim 2, characterized in that: 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.
5. The method for evaluating the psychological stress of personnel based on exhaled VOCs according to claim 1, characterized in that: 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): 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; 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): 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 i-th data point. 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, which conforms to the mathematical bijective relationship. Step 2.3: Compute the angles and between different points to characterize the temporal correlation of different data points, as shown in formula (3), where: Represents the angle values of different data points, Among them, 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 to a two-dimensional image; Step 2.4: Repeat steps 2.1 to 2.3 to generate GASF images of the sensor responses of the 12 channels in the k-th exhaled VOCs sample data, and 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 from the smallest to the largest number of channels, and splice them into a complete sample image; Step 2.5: For the original sample data set X = [x 1 , ..., x k , ..., x m ] performs processing operations from step 2.1 to step 2.4 on each sample in the image to obtain an image sample data set Z; Step 2.6: Randomly extract 60% of the exhaled VOCs sample data from the imaged 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 evaluating the psychological stress of personnel based on exhaled VOCs according to claim 1, characterized in that: The step three specifically includes the following steps: 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 focus of the convolutional neural network on important features and improves the feature representation ability; the pooling layer reduces the feature map size and the number of parameters by downsampling the feature map; the output layer calculates the improved softmax classifier activation function, flattens the multi-dimensional feature map output by the pooling layer into a one-dimensional feature vector, and performs feature fusion and integration; captures the nonlinear relationship of the input features and outputs the final psychological stress grading evaluation category; Step 3.2: At the input layer, firstly, data enhancement is performed on the input sample image; secondly, the data set is expanded by random geometric transformation, 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 formula (4): Among them, norm represents the normalized pixel value, x i Represents the pixel value of the original image, min(x) and max(x) represent the minimum and maximum values of the pixels of the original image 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): ReLU(x)=max(0,x) (5) The calculation process of the Sobel operator convolution kernel can be expressed by formula (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; G x is the approximate value of the lateral 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 image matrix after normalization; 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 the channel attention module and the spatial attention module in series. 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 G m Then, the two channel feature maps are sent to 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, and the compressed number of channels is restored to obtain the feature map G of the size of 1×1×C output by the two networks. a1 , G m1 , 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). Among them, δ 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 , 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 firstly 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 concatenated along the channel axis direction to obtain a feature map with a size of H×W×2, and 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 M. s (G), specifically as shown in formula (8), Among them, σ represents the sigmoid activation function; f 7×7 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): 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; 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). 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; Step 3.6: After the convolution, pooling and enhanced attention modules, the feature image samples are input into 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). Among them, softmax(z k ) is the predicted probability that each sample belongs 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 features is w k The scalar value obtained after the linear transformation of ; k represents the total category, k = 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 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 i-th sample is expressed as The sample set is divided into K categories, and the category 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. There are three label categories. If the sample x i Belongs to category 2, then: y i =(0,1,0), 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): 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 features is w k The scalar value obtained after the linear transformation of k represents the kth weight vector, with the same dimension as x; k represents the total number of categories, k=3.
7. The method for evaluating the psychological stress of personnel based on exhaled VOCs according to claim 1, characterized in that: The step 4 specifically includes the following steps: Step 4.1: Establish the model framework of the psychological stress evaluation algorithm and set the training parameters, which include the weights and biases of each level; Step 4.2: Randomly input a certain number of image samples from the training data set without duplication, use the evaluation algorithm model framework to calculate the classification results, and use the validation data set to calculate the loss function value. The input parameters include the number of input image channels and image size. The loss function uses the cross entropy loss function, which evaluates the classification model by measuring the amount of information, as shown in the following formula (13): 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; Step 4.3: According to the loss function value, use the set optimization algorithm to update the parameters. 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 sample x, and the value of K is the same as the number of categories. Finally, repeat equation (14) until convergence. Among them, α is the hyperparameter learning rate; J 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): Among them, w k and b k Represents the weight and bias of a single sample; Step 4.4: Repeat steps 4.2 and 4.3 above, randomly reading a certain number of images from the training data set without duplication each time, calculating the prediction results and loss function values, and optimizing the model parameters until all images in the training data set have completed training more than once.
8. The method for evaluating the psychological stress of personnel based on exhaled VOCs according to claim 1, characterized in that: 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 as positive examples. The specific formulas of accuracy, precision and recall are shown in formula (16). 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.
Citation Information
Patent Citations
Psychological stress evaluation method based on fusion of electrocardiosignal and electromyographic signal
CN111150410A
Athlete psychological stress assessment method and system based on convolution and recurrent neural network
CN114343637A
Psychological stress state assessment method and system based on skin electric signals
CN115568853A
Psychological test evaluation method based on adaptive algorithm
CN115813388A
Physiological signal quality evaluation method based on Gram angle field
CN112370015A
Cited By
Nose electrical stimulation device, system and method
CN120900121A
