Disinfectant concentration monitoring method based on machine learning
Through the multi-task learning of the one-dimensional convolutional neural network with an improved structure and the long-short-term memory attention mechanism, the problem of complex gas characteristics and low multi-task learning efficiency in disinfectant concentration monitoring is solved, and efficient disinfectant concentration monitoring and analysis, improving the practicality and accuracy of the model.
Patent Information
- Application Number
- CN202410731360.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-06
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing disinfectant concentration monitoring methods, gas features are complex, machine learning methods rely on feature extraction and have poor results, and cannot meet the needs of qualitative and quantitative two-way quantitative analysis. The multi-task learning model structure affects learning efficiency and accuracy.
A one-dimensional convolutional neural network with an improved structure is used to screen key features, combined with multi-task learning of the long-short-term memory attention mechanism, to build a disinfectant concentration monitoring model, and achieve qualitative and quantitative results by setting up a disinfectant category classification and concentration prediction task sub-network. analysis, and feature feeding through the shared layer and attention layer to improve the practicality and accuracy of the model.
It improves the accuracy of feature extraction and the feature data basis for subsequent classification and prediction tasks, enhances the practicality and scalability of the model, and improves the usability, efficiency and accuracy of disinfectant concentration monitoring.
Smart Images

Figure CN118731280A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of disinfection management, and specifically refers to a disinfectant concentration monitoring method based on machine learning. Background Art
[0002] Disinfectants are commonly used disinfection methods in the fields of medical treatment, food processing, and environmental sanitation. If used improperly, they will cause adverse safety hazards to personnel and the environment. Intelligent monitoring of disinfectant concentrations through machine learning technology can help staff understand the use of disinfectants, thereby ensuring the disinfection effect, controlling the amount of disinfectant used, and helping to prevent safety hazards caused by insufficient or excessive disinfectant concentrations. However, in the existing disinfectant concentration monitoring methods, there are technical problems that gas characteristics are complex and machine learning methods are highly dependent on the effect of feature extraction; there are technical problems that disinfectant concentration monitoring requires qualitative and quantitative two-way quantitative analysis of gas mixtures, and a single or simple task design cannot meet the needs of disinfectant concentration monitoring; there are technical problems that the specific structure of the multi-task learning model has a great impact on learning efficiency and accuracy, and that while extracting features, gas features need to be further enhanced to better meet the needs of multi-task learning. Summary of the invention
[0003] In view of the above situation, in order to overcome the defects of the prior art, the present invention provides a disinfectant concentration monitoring method based on machine learning. In view of the technical problem that in the existing disinfectant concentration monitoring method, the gas characteristics are complex, and the machine learning method is highly dependent on the effect of feature extraction, this solution creatively adopts a one-dimensional convolutional neural network with improved structure to screen key features. By improving the model structure of the one-dimensional convolutional neural network, the time series features are extracted in the feature extraction stage, which improves the accuracy of feature extraction and provides a good feature data foundation for subsequent classification and prediction tasks. In view of the technical problem that in the existing disinfectant concentration monitoring method, the disinfectant concentration monitoring requires qualitative and quantitative two-way quantitative analysis of the gas mixture, and a single or simple task design cannot meet the needs of disinfectant concentration monitoring, this solution creatively adopts a one-dimensional convolutional neural network with improved structure to screen key features. By improving the model structure of the one-dimensional convolutional neural network, the time series features are extracted in the feature extraction stage, which improves the accuracy of feature extraction and provides a good feature data foundation for subsequent classification and prediction tasks. The multi-task learning is creatively used for model construction. By setting up the disinfectant category classification task subnet and the disinfectant concentration prediction task subnet, it is helpful for machine learning qualitative and quantitative analysis, and improves the practicality and scalability of the model. In view of the technical problems in the existing disinfectant concentration monitoring methods, the specific structure of the multi-task learning model has a great impact on the learning efficiency and accuracy, and the gas features need to be further enhanced during feature extraction to better adapt to the needs of multi-task learning. This scheme creatively uses multi-task learning combined with long short-term memory attention mechanism to construct the model. The shared layer based on the model is constructed through the long short-term memory network, and the shared layer output is connected to the attention layer for feature feeding to realize the task allocation of multi-task learning, thereby improving the overall usability, efficiency and accuracy of the method.
[0004] The technical solution adopted by the present invention is as follows: The method for monitoring disinfectant concentration based on machine learning provided by the present invention comprises the following steps:
[0005] Step S1: raw data collection;
[0006] Step S2: data preprocessing;
[0007] Step S3: key feature screening;
[0008] Step S4: constructing a disinfectant concentration monitoring model;
[0009] Step S5: Disinfectant concentration monitoring.
[0010] Furthermore, in step S1, raw data collection is used to collect raw data required for disinfectant concentration monitoring, specifically, collecting gas response data from a hospital environment through a gas sensor array to obtain a raw data set.
[0011] Furthermore, in step S2, the data preprocessing is used to remove noise and baseline drift in the data, specifically, preprocessing the original data set through variational mode decomposition filtering and baseline removal operations to obtain a disinfectant concentration denoised data set.
[0012] Further, in step S3, the key feature screening is used to screen key features from the data set, specifically using a one-dimensional convolutional neural network with improved structure to perform key feature screening on the disinfectant concentration denoising data set to obtain key features, including the following steps:
[0013] Step S31: constructing a one-dimensional convolutional neural network architecture, specifically setting 1 input layer, 3 convolutional layers, 1 pooling layer and 1 fully connected subnet in the one-dimensional convolutional neural network;
[0014] Step S32: construct an input layer for receiving the input of a one-dimensional time series, specifically setting the size of the input layer to L×1×1, where L is the length of the time series;
[0015] Step S33: adjusting the one-dimensional convolutional neural network architecture to improve the model performance and representation ability, specifically by constructing a convolutional layer and a fully connected subnet, adjusting the one-dimensional convolutional network architecture to obtain a one-dimensional convolutional neural network with improved structure, including the following steps:
[0016] Step S331: Construct a convolution layer, specifically, use 3 convolution layers for feature learning, and set 64 convolution kernels in each convolution layer, set the size of the convolution kernel to 100, and the step size to 3. The calculation formula of the convolution kernel is:
[0017] ;
[0018] Where k is the convolution kernel index, c k is the output vector of the kth convolution kernel, conD(·) is a one-dimensional convolution operation, and w k is the weight of the kth convolution kernel, x is the input vector of the convolution kernel, g k is the bias term of the kth convolution kernel;
[0019] Step S332: construct a fully connected subnet for further extracting abstract features. Specifically, three hidden layers of size 500 are set in the fully connected layer subnet, and a LeakReLU activation function is added after the third hidden layer to accelerate model convergence and avoid gradient disappearance. The calculation formula of the LeakReLU activation function is:
[0020] ;
[0021] Where LeakReLU(·) is the LeakReLU activation function, X is the input value of the LeakReLU activation function, max(·) is the maximum value function, and a is a constant less than 1, which is used to control the slope of the negative part;
[0022] Step S34: Perform key feature screening on the disinfectant concentration denoising data set through a one-dimensional convolutional neural network with improved structure to obtain key features.
[0023] Further, in step S4, the disinfectant concentration monitoring model is constructed, specifically, based on key features, multi-task learning combined with long short-term memory attention mechanism is used to construct the model to obtain the disinfectant concentration monitoring model;
[0024] The multi-task learning combined with the long short-term memory attention mechanism specifically includes a shared layer, an attention layer, and a parallel dual-task subnet;
[0025] The parallel dual-task subnet specifically includes a disinfectant category classification task subnet and a disinfectant concentration prediction task subnet;
[0026] The disinfectant concentration monitoring model is constructed, comprising the following steps:
[0027] Step S41: construct a shared layer to strengthen the memory of the network, specifically using a two-layer long short-term memory network architecture as a shared layer, and setting N long short-term memory units in each layer of the long short-term memory network architecture. The calculation formula of the long short-term memory unit is:
[0028] ;
[0029] Where t is the first index of the long short-term memory unit, h t is the hidden state of the t-th LSTM unit, specifically the output of the t-th LSTM unit, LSTM(·) is the LSTM unit calculation function, z t is the input data of the t-th LSTM unit, and the input data specifically refers to the key feature sample, h t-1 is the hidden state of the t-1th LSTM unit;
[0030] Step S42: construct an attention layer for integrating the shared layer output and feeding the shared layer output to the parallel dual-task subnetworks respectively, including the following steps:
[0031] Step S421: Mapping the output result of the shared layer into a scalar by linearly changing the hidden state of each long short-term memory unit;
[0032] Step S422: Calculate the attention weight based on the scalar. The calculation formula is:
[0033] ;
[0034] Where b t is the attention weight, specifically the attention weight of the t-th LSTM unit corresponding to the input data, v is the second index of the LSTM unit, N is the number of LSTM units, exp(·) is the exponential function, a v is the scalar of the vth LSTM unit, a t is the scalar of the t-th LSTM unit;
[0035] Step S423: Based on the attention weight, the hidden state of each long short-term memory unit is weighted and summed to obtain the final output of the shared layer. The calculation formula is:
[0036] ;
[0037] In the formula, c t is the weight vector of the t-th LSTM unit;
[0038] Step S43: construct a parallel dual-task subnetwork for performing disinfectant category classification and disinfectant concentration prediction tasks respectively, including the following steps:
[0039] Step S431: construct a disinfectant classification task subnet, specifically, receive the final output of the shared layer, and classify the disinfectant categories by constructing the fully connected layer and output layer of the regression model to obtain disinfectant classification data. The calculation formula of the regression model is:
[0040] ;
[0041] Where yr is the output of the regression model, specifically the disinfectant classification data, and W r is the regression weight, c is the final output of the shared layer, and b r is the regression bias term;
[0042] Step S432: construct a disinfectant concentration prediction task subnet, specifically, receive the final output of the shared layer, and predict the disinfectant concentration by constructing the fully connected layer and output layer of the classifier to obtain the disinfectant concentration prediction probability. The calculation formula of the classifier is:
[0043] ;
[0044] Where yc is the output of the classifier, specifically the predicted probability of disinfectant concentration, Softmax(·) is the Softmax function, and W c is the classification weight, the size of the classification weight is k×d, k is the number of disinfectant categories, d is the dimension of the final output of the shared layer, and b cis the classification bias term;
[0045] Step S44: constructing a model loss function, including the following steps:
[0046] Step S441: construct a cross entropy loss function to measure the accuracy of disinfectant classification. The calculation formula is:
[0047] ;
[0048] Where, L c is the cross entropy loss function, n is the number of samples, specifically the number of samples of key features, i is the sample index, specifically the index of key feature samples, j is the disinfectant category index, yc ij is the indicator function that the i-th sample is correctly classified as the j-th disinfectant category. If the i-th sample is correctly classified, then yc ij is equal to 1, otherwise yc ij is equal to 0, is the probability that the i-th sample is classified as the j-th disinfectant category;
[0049] Step S442: construct a concentration prediction loss function to measure the accuracy of disinfectant concentration prediction, and the calculation formula is:
[0050] ;
[0051] Where, L r is the concentration prediction loss function, yr i is the true concentration of the ith sample, is the predicted concentration of the ith sample;
[0052] Step S443: Construct a dual-task total loss function with a regularization term to prevent overfitting. The calculation formula is:
[0053] ;
[0054] Where, L total is the total loss function of the two tasks, λ c is the disinfectant classification task weight, λ r is the disinfectant concentration prediction task weight, λ is the regularization term weight, and ||·||2 is the L2 norm;
[0055] Step S45: Model training and optimization, specifically, model training is performed by constructing the shared layer, the attention layer, the parallel dual-task subnet and the model loss function, and the hyperparameters are updated by the PSO algorithm to obtain the disinfectant concentration monitoring model Model CP .
[0056] Further, in step S5, the disinfectant concentration monitoring is used to monitor the disinfectant concentration, specifically using a disinfectant concentration monitoring model Model CP , monitor the disinfectant concentration, obtain disinfectant concentration analysis data, generate disinfectant management auxiliary information based on the disinfectant concentration analysis data, and issue an alarm reminder when the disinfectant concentration deviates from the safe range or the disinfectant category is abnormal;
[0057] The disinfectant concentration analysis data specifically includes disinfectant category data and disinfectant concentration data. The disinfectant category data specifically includes alcohol, chlorine, hydrogen peroxide and ether. The disinfectant concentration data specifically refers to disinfectant concentration prediction probability data.
[0058] The beneficial effects achieved by the present invention using the above scheme are as follows:
[0059] (1) In view of the technical problem that the existing disinfectant concentration monitoring methods have complex gas characteristics and machine learning methods are highly dependent on the effect of feature extraction, this solution creatively uses a one-dimensional convolutional neural network with improved structure to screen key features. By improving the model structure of the one-dimensional convolutional neural network, time series features are extracted in the feature extraction stage, which improves the accuracy of feature extraction and provides a good feature data foundation for subsequent classification and prediction tasks.
[0060] (2) In view of the technical problem that disinfectant concentration monitoring requires qualitative and quantitative bidirectional quantitative analysis of gas mixtures in existing disinfectant concentration monitoring methods, and that a single or simple task design cannot meet the needs of disinfectant concentration monitoring, this solution creatively uses multi-task learning to build a model. By setting up a disinfectant category classification task subnet and a disinfectant concentration prediction task subnet, it helps machine learning for qualitative and quantitative analysis, thereby improving the practicality and scalability of the model.
[0061] (3) In view of the technical problems that the specific structure of the multi-task learning model has a great impact on the learning efficiency and accuracy in the existing disinfectant concentration monitoring methods, and that the gas features need to be further enhanced while extracting features to better adapt to the needs of multi-task learning, this solution creatively adopts multi-task learning combined with long short-term memory attention mechanism to construct the model. The shared layer based on the model is constructed through the long short-term memory network, and the output of the shared layer is connected to the attention layer for feature feeding to realize the task allocation of multi-task learning, thereby improving the overall usability, efficiency and accuracy of the method. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A schematic diagram of a flow chart of a disinfectant concentration monitoring method based on machine learning provided by the present invention;
[0063] Figure 2 is a schematic flow chart of step S3;
[0064] Figure 3 is a schematic flow chart of step S4;
[0065] Figure 4 It is a flowchart diagram of step S42.
[0066] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention. DETAILED DESCRIPTION
[0067] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments; based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0068] In the description of the present invention, it should be understood that terms such as “upper”, “lower”, “front”, “back”, “left”, “right”, “top”, “bottom”, “inside” and “outside” indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore should not be understood as limiting the present invention.
[0069] Example 1, see Figure 1 The present invention provides a method for monitoring disinfectant concentration based on machine learning, the method comprising the following steps:
[0070] Step S1: raw data collection;
[0071] Step S2: data preprocessing;
[0072] Step S3: key feature screening;
[0073] Step S4: constructing a disinfectant concentration monitoring model;
[0074] Step S5: Disinfectant concentration monitoring.
[0075] Example 2, see Figure 1 This embodiment is based on the above embodiment. In step S1, raw data collection is used to collect raw data required for disinfectant concentration monitoring, specifically, collecting gas response data from a hospital environment through a gas sensor array to obtain a raw data set.
[0076] Example 3, see Figure 1 This embodiment is based on the above embodiment. In step S2, the data preprocessing is used to remove noise and baseline drift in the data. Specifically, the original data set is preprocessed through variational mode decomposition filtering and baseline removal operations to obtain a disinfectant concentration denoised data set.
[0077] Example 4, see Figure 1 and Figure 2 This embodiment is based on the above embodiment. The key feature screening is used to screen key features from a data set. Specifically, a one-dimensional convolutional neural network with improved structure is used to screen key features of a disinfectant concentration denoised data set to obtain key features, and the steps include:
[0078] Step S31: constructing a one-dimensional convolutional neural network architecture, specifically setting 1 input layer, 3 convolutional layers, 1 pooling layer and 1 fully connected subnet in the one-dimensional convolutional neural network;
[0079] Step S32: construct an input layer for receiving the input of a one-dimensional time series, specifically setting the size of the input layer to L×1×1, where L is the length of the time series;
[0080] Step S33: adjusting the one-dimensional convolutional neural network architecture to improve the performance and representation capability of the one-dimensional convolutional neural network, specifically by constructing a convolutional layer and a fully connected subnet, adjusting the one-dimensional convolutional network architecture to obtain a one-dimensional convolutional neural network with an improved structure, including the following steps:
[0081] Step S331: Construct a convolution layer, specifically, use 3 convolution layers for feature learning, and set 64 convolution kernels in each convolution layer, set the size of the convolution kernel to 100, and the step size to 3. The calculation formula of the convolution kernel is:
[0082] ;
[0083] Where k is the convolution kernel index, c k is the output vector of the kth convolution kernel, conD(·) is a one-dimensional convolution operation, and w k is the weight of the kth convolution kernel, x is the input vector of the convolution kernel, g k is the bias term of the kth convolution kernel;
[0084] Step S332: construct a fully connected subnet for further extracting abstract features. Specifically, three hidden layers of size 500 are set in the fully connected layer subnet, and a LeakReLU activation function is added after the third hidden layer to accelerate model convergence and avoid gradient disappearance. The calculation formula of the LeakReLU activation function is:
[0085] ;
[0086] Where LeakReLU(·) is the LeakReLU activation function, X is the input value of the LeakReLU activation function, max(·) is the maximum value function, and a is a constant less than 1, which is used to control the slope of the negative part;
[0087] Step S34: screening the key features of the disinfectant concentration denoising data set through a one-dimensional convolutional neural network with improved structure to obtain key features;
[0088] By performing the above operations, in order to address the technical problem that the existing disinfectant concentration monitoring methods have complex gas characteristics and the machine learning methods are highly dependent on the effect of feature extraction, this solution creatively adopts a one-dimensional convolutional neural network with improved structure to screen key features. By improving the model structure of the one-dimensional convolutional neural network, time series features are extracted in the feature extraction stage, which improves the accuracy of feature extraction and provides a good feature data foundation for subsequent classification and prediction tasks.
[0089] Example 5, see Figure 1 , Figure 3 and Figure 4 This embodiment is based on the above embodiment, and the disinfectant concentration monitoring model is constructed, specifically, based on key features, using multi-task learning combined with long short-term memory attention mechanism to construct the model, so as to obtain the disinfectant concentration monitoring model;
[0090] The multi-task learning combined with the long short-term memory attention mechanism specifically includes a shared layer, an attention layer, and a parallel dual-task subnet;
[0091] The parallel dual-task subnet specifically includes a disinfectant category classification task subnet and a disinfectant concentration prediction task subnet;
[0092] The disinfectant concentration monitoring model is constructed, comprising the following steps:
[0093] Step S41: construct a shared layer to strengthen the memory of the network, specifically using a two-layer long short-term memory network architecture as a shared layer, and setting N long short-term memory units in each layer of the long short-term memory network architecture. The calculation formula of the long short-term memory unit is:
[0094] ;
[0095] Where t is the first index of the long short-term memory unit, h t is the hidden state of the t-th LSTM unit, specifically the output of the t-th LSTM unit, LSTM(·) is the LSTM unit calculation function, zt is the input data of the t-th LSTM unit, and the input data specifically refers to the key feature sample, h t-1 is the hidden state of the t-1th LSTM unit;
[0096] Step S42: construct an attention layer for integrating the shared layer output and feeding the shared layer output to the parallel dual-task subnetworks respectively, including the following steps:
[0097] Step S421: By linearly changing the hidden state of each long short-term memory unit, the output result of the shared layer is mapped to a scalar, and the calculation formula is:
[0098] ;
[0099] In the formula, a t is the scalar of the t-th LSTM unit, W1 is the linear transformation weight, and g1 is the linear transformation bias term;
[0100] Step S422: Calculate the attention weight based on the scalar. The calculation formula is:
[0101] ;
[0102] Where b t is the attention weight, specifically the attention weight of the t-th LSTM unit corresponding to the input data, v is the second index of the LSTM unit, N is the number of LSTM units, exp(·) is the exponential function, a v is the scalar of the vth LSTM unit;
[0103] Step S423: Based on the attention weight, the hidden state of each long short-term memory unit is weighted and summed to obtain the final output of the shared layer. The calculation formula is:
[0104] ;
[0105] In the formula, c t is the weight vector of the t-th LSTM unit;
[0106] Step S43: construct a parallel dual-task subnetwork for performing disinfectant category classification and disinfectant concentration prediction tasks respectively, including the following steps:
[0107] Step S431: construct a disinfectant classification task subnet, specifically, receive the final output of the shared layer, and classify the disinfectant categories by constructing the fully connected layer and output layer of the regression model to obtain disinfectant classification data. The calculation formula of the regression model is:
[0108] ;
[0109] Where yr is the output of the regression model, specifically the disinfectant classification data, and W r is the regression weight, c is the final output of the shared layer, and b r is the regression bias term;
[0110] Step S432: construct a disinfectant concentration prediction task subnet, specifically, receive the final output of the shared layer, and predict the disinfectant concentration by constructing the fully connected layer and output layer of the classifier to obtain the disinfectant concentration prediction probability. The calculation formula of the classifier is:
[0111] ;
[0112] Where yc is the output of the classifier, specifically the predicted probability of disinfectant concentration, Softmax(·) is the Softmax function, and W c is the classification weight, the size of the classification weight is k×d, k is the number of disinfectant categories, d is the dimension of the final output of the shared layer, and b c is the classification bias term;
[0113] Step S44: constructing a model loss function, including the following steps:
[0114] Step S441: construct a cross entropy loss function to measure the accuracy of disinfectant classification. The calculation formula is:
[0115] ;
[0116] Where, L c is the cross entropy loss function, n is the number of samples, specifically the number of samples of key features, i is the sample index, specifically the index of key feature samples, j is the disinfectant category index, yc ij is the indicator function that the i-th sample is correctly classified as the j-th disinfectant category. If the i-th sample is correctly classified, then yc ij is equal to 1, otherwise yc ij is equal to 0, is the probability that the i-th sample is classified as the j-th disinfectant category;
[0117] Step S442: construct a concentration prediction loss function to measure the accuracy of disinfectant concentration prediction, and the calculation formula is:
[0118] ;
[0119] Where, L r is the concentration prediction loss function, yr i is the true concentration of the ith sample, is the predicted concentration of the ith sample;
[0120] Step S443: Construct a dual-task total loss function with a regularization term to prevent overfitting. The calculation formula is:
[0121] ;
[0122] Where, L total is the total loss function of the two tasks, λ c is the disinfectant classification task weight, λ r is the disinfectant concentration prediction task weight, λ is the regularization term weight, and ||·||2 is the L2 norm;
[0123] Step S45: Model training and optimization, specifically, model training is performed by constructing the shared layer, the attention layer, the parallel dual-task subnet and the model loss function, and the hyperparameters are updated by the PSO algorithm to obtain the disinfectant concentration monitoring model Model CP ;
[0124] By performing the above operations, in view of the technical problem that in the existing disinfectant concentration monitoring methods, disinfectant concentration monitoring requires qualitative and quantitative bidirectional quantitative analysis of gas mixtures, and a single or simple task design cannot meet the needs of disinfectant concentration monitoring, this solution creatively adopts multi-task learning to build a model. By setting up a disinfectant category classification task subnet and a disinfectant concentration prediction task subnet, it is helpful for machine learning qualitative and quantitative analysis, and improves the practicality and scalability of the model;
[0125] In view of the technical problems that the specific structure of the multi-task learning model in the existing disinfectant concentration monitoring method has a great impact on the learning efficiency and accuracy, and the gas features need to be further enhanced during feature extraction to better adapt to the needs of multi-task learning, this scheme creatively adopts multi-task learning combined with long short-term memory attention mechanism to construct the model, constructs the shared layer based on the model through the long short-term memory network, and connects the shared layer output to the attention layer for feature feeding to realize the task allocation of multi-task learning, thereby improving the overall usability, efficiency and accuracy of the method.
[0126] Example 6, see Figure 1 This embodiment is based on the above embodiment. In step S5, the disinfectant concentration monitoring is used to monitor the disinfectant concentration, specifically using the disinfectant concentration monitoring model Model CP , monitor the disinfectant concentration, obtain disinfectant concentration analysis data, generate disinfectant management auxiliary information based on the disinfectant concentration analysis data, and issue an alarm reminder when the disinfectant concentration deviates from the safe range or the disinfectant category is abnormal;
[0127] The disinfectant concentration analysis data specifically includes disinfectant category data and disinfectant concentration data. The disinfectant category data specifically includes alcohol, chlorine, hydrogen peroxide and ether. The disinfectant concentration data specifically refers to disinfectant concentration prediction probability data.
[0128] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0129] While the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that many changes, modifications, substitutions and variations can be made to the embodiments without departing from the principles and spirit of the invention.
[0130] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. A method for monitoring disinfectant concentration based on machine learning, characterized in that: The method comprises the following steps: Step S1: Raw data collection, used to collect raw data required for disinfectant concentration monitoring; Step S2: data preprocessing, used to remove noise and baseline drift in the data; Step S3: key feature screening, used to screen key features from the data set, specifically using a one-dimensional convolutional neural network with improved structure to screen key features of the disinfectant concentration denoised data set to obtain key features; Step S4: constructing a disinfectant concentration monitoring model, specifically, based on key features, using multi-task learning combined with long short-term memory attention mechanism to construct a model, and obtaining a disinfectant concentration monitoring model; The multi-task learning combined with the long short-term memory attention mechanism specifically includes a shared layer, an attention layer, and a parallel dual-task subnet; The parallel dual-task subnet specifically includes a disinfectant category classification task subnet and a disinfectant concentration prediction task subnet; Step S5: Disinfectant concentration monitoring.
2. The method for monitoring disinfectant concentration based on machine learning according to claim 1, characterized in that: In step S3, the key feature screening includes the following steps: Step S31: constructing a one-dimensional convolutional neural network architecture, specifically setting 1 input layer, 3 convolutional layers, 1 pooling layer and 1 fully connected subnet in the one-dimensional convolutional neural network; Step S32: construct an input layer for receiving the input of a one-dimensional time series, specifically setting the size of the input layer to L×1×1, where L is the length of the time series; Step S33: adjusting the one-dimensional convolutional neural network architecture, specifically by constructing a convolutional layer and a fully connected subnet, adjusting the one-dimensional convolutional network architecture to obtain a one-dimensional convolutional neural network with improved structure, including the following steps: Step S331: Construct a convolution layer, specifically, use 3 convolution layers for feature learning, and set 64 convolution kernels in each convolution layer, set the size of the convolution kernel to 100, and the step size to 3. The calculation formula of the convolution kernel is: ; Where k is the convolution kernel index, c k is the output vector of the kth convolution kernel, conD(·) is a one-dimensional convolution operation, and w k is the weight of the kth convolution kernel, x is the input vector of the convolution kernel, g k is the bias term of the kth convolution kernel; Step S332: construct a fully connected subnet for further extracting abstract features. Specifically, three hidden layers of size 500 are set in the fully connected layer subnet, and a LeakReLU activation function is added after the third hidden layer to accelerate model convergence and avoid gradient disappearance. The calculation formula of the LeakReLU activation function is: ; Where LeakReLU(·) is the LeakReLU activation function, X is the input value of the LeakReLU activation function, max(·) is the maximum value function, and a is a constant less than 1, which is used to control the slope of the negative part; Step S34: Perform key feature screening on the disinfectant concentration denoising data set through a one-dimensional convolutional neural network with improved structure to obtain key features.
3. The method for monitoring disinfectant concentration based on machine learning according to claim 2, characterized in that: In step S4, the disinfectant concentration monitoring model is constructed, specifically, based on key features, multi-task learning combined with long short-term memory attention mechanism is used to construct the model to obtain the disinfectant concentration monitoring model; The multi-task learning combined with the long short-term memory attention mechanism specifically includes a shared layer, an attention layer, and a parallel dual-task subnet; The parallel dual-task subnet specifically includes a disinfectant category classification task subnet and a disinfectant concentration prediction task subnet; The disinfectant concentration monitoring model is constructed, comprising the following steps: Step S41: construct a shared layer to strengthen the memory of the network, specifically using a two-layer long short-term memory network architecture as a shared layer, and setting N long short-term memory units in each layer of the long short-term memory network architecture. The calculation formula of the long short-term memory unit is: ; Where t is the first index of the long short-term memory unit, h t is the hidden state of the t-th LSTM unit, specifically the output of the t-th LSTM unit, LSTM(·) is the LSTM unit calculation function, z t is the input data of the t-th LSTM unit, and the input data specifically refers to the key feature sample, h t-1 is the hidden state of the t-1th LSTM unit; Step S42: construct an attention layer for integrating the shared layer output and feeding the shared layer output to the parallel dual-task subnetworks respectively, including the following steps: Step S421: Mapping the output result of the shared layer into a scalar by linearly changing the hidden state of each long short-term memory unit; Step S422: Calculate the attention weight based on the scalar. The calculation formula is: ; Where b t is the attention weight, specifically the attention weight of the t-th LSTM unit corresponding to the input data, v is the second index of the LSTM unit, N is the number of LSTM units, exp(·) is the exponential function, a v is the scalar of the vth LSTM unit, a t is the scalar of the t-th LSTM unit; Step S423: Based on the attention weight, the hidden state of each long short-term memory unit is weighted and summed to obtain the final output of the shared layer. The calculation formula is: ; In the formula, c t is the weight vector of the t-th LSTM unit; Step S43: construct a parallel dual-task subnetwork for performing disinfectant category classification and disinfectant concentration prediction tasks respectively; Step S44: constructing a model loss function; Step S45: Model training and optimization, specifically, by constructing the shared layer, the attention layer, the parallel dual-task subnet and the model loss function, model training is performed, and the hyperparameters are updated by the PSO algorithm to obtain the disinfectant concentration monitoring model Model CP .
4. The method for monitoring disinfectant concentration based on machine learning according to claim 3, characterized in that: In step S43, the construction of the parallel dual-task subnet includes the following steps: Step S431: construct a disinfectant classification task subnet, specifically, receive the final output of the shared layer, and classify the disinfectant categories by constructing the fully connected layer and output layer of the regression model to obtain disinfectant classification data. The calculation formula of the regression model is: ; Where yr is the output of the regression model, specifically the disinfectant classification data, and W r is the regression weight, c is the final output of the shared layer, and b r is the regression bias term; Step S432: construct a disinfectant concentration prediction task subnet, specifically, receive the final output of the shared layer, and predict the disinfectant concentration by constructing the fully connected layer and output layer of the classifier to obtain the disinfectant concentration prediction probability. The calculation formula of the classifier is: ; Where yc is the output of the classifier, specifically the predicted probability of disinfectant concentration, Softmax(·) is the Softmax function, and W c is the classification weight, the size of the classification weight is k×d, k is the number of disinfectant categories, d is the dimension of the final output of the shared layer, and b c is the classification bias term.
5. The method for monitoring disinfectant concentration based on machine learning according to claim 4, characterized in that: In step S44, the construction of the model loss function includes the following steps: Step S441: construct a cross entropy loss function to measure the accuracy of disinfectant classification. The calculation formula is: ; Where, L c is the cross entropy loss function, n is the number of samples, specifically the number of samples of key features, i is the sample index, specifically the index of key feature samples, j is the disinfectant category index, yc ij is the indicator function that the i-th sample is correctly classified as the j-th disinfectant category. If the i-th sample is correctly classified, then yc ij is equal to 1, otherwise yc ij is equal to 0, is the probability that the i-th sample is classified as the j-th disinfectant category; Step S442: construct a concentration prediction loss function to measure the accuracy of disinfectant concentration prediction, and the calculation formula is: ; Where, L r is the concentration prediction loss function, yr i is the true concentration of the ith sample, is the predicted concentration of the ith sample; Step S443: Construct a dual-task total loss function with a regularization term to prevent overfitting. The calculation formula is: ; Where, L total is the total loss function of the two tasks, λ c is the disinfectant classification task weight, λ r is the disinfectant concentration prediction task weight, λ is the regularization term weight, and ||·||2 is the L2 norm.
6. The method for monitoring disinfectant concentration based on machine learning according to claim 5, characterized in that: In step S5, the disinfectant concentration monitoring is used to monitor the disinfectant concentration, specifically using a disinfectant concentration monitoring model Model CP , monitor the disinfectant concentration, obtain disinfectant concentration analysis data, generate disinfectant management auxiliary information based on the disinfectant concentration analysis data, and issue an alarm reminder when the disinfectant concentration deviates from the safe range or there is an abnormality in the disinfectant category.
7. The method for monitoring disinfectant concentration based on machine learning according to claim 6, characterized in that: In step S1, raw data collection is used to collect raw data required for disinfectant concentration monitoring, specifically, collecting gas response data from a hospital environment through a gas sensor array to obtain a raw data set.
8. The method for monitoring disinfectant concentration based on machine learning according to claim 7, characterized in that: In step S2, the data preprocessing is used to remove noise and baseline drift in the data, specifically, preprocessing the original data set through variational mode decomposition filtering and baseline removal operations to obtain a disinfectant concentration denoised data set.
Citation Information
Cited By
Signal enhancement method and platform for off-line concentration monitor
CN119224239A
Intelligent monitoring method and system for waste incineration process and electronic equipment
CN120538063A
Disinfectant whole-course quality monitoring and early warning management method
CN122434376A
A disinfectant whole-process quality monitoring early warning management method
CN122434376B
