Disinfectant concentration monitoring method based on machine learning
Through non-intrusive methods and Gaussian noise data augmentation combined with vector network analyzer and machine learning, combined with weighted Stacking integrated classifier, the problem of equipment contamination and insufficient data in the measurement of alcohol disinfectants is solved, and the measurement accuracy and model are improved. Adaptability enables accurate judgment of alcohol disinfectant concentration.
Patent Information
- Application Number
- CN202410852218.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the existing technology, alcohol disinfectants are easily contaminated and interfered by invasive equipment during the measurement process, and it is difficult to obtain sufficient diversity data sets, resulting in model overfitting and inability to capture complex patterns, which limits the application of machine learning models. performance.
A non-invasive method combining vector network analyzer and machine learning was used to measure the concentration of alcohol disinfectants, the data set was expanded through Gaussian noise, and a weighted Stacking integrated classifier was designed, combining random forests, XGBoost, decision trees and support vector machines as For the base classifier, a logistic regression model is used as a meta-classifier, and K-fold cross-validation training is performed to improve the adaptability and accuracy of the model.
It achieves non-invasive measurement, reduces equipment interference and contamination, improves measurement accuracy, avoids overfitting, enhances the adaptability and prediction ability of the model, and ensures accurate judgment of alcohol disinfectant concentration.
Smart Images

Figure CN118731287A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of disinfectant concentration monitoring, and specifically refers to a disinfectant concentration monitoring method based on machine learning. Background Art
[0002] In view of the above situation, in order to make up for the shortcomings of the prior art, the present invention provides a disinfectant concentration monitoring method based on machine learning. In view of the problem that alcohol disinfectants are tested in an invasive manner, making them susceptible to contamination and interference from measuring equipment, the present invention measures alcohol disinfectants in a non-invasive manner by combining a vector network analyzer with machine learning; in view of the problem that it is difficult to obtain a large number of diverse data sets, resulting in overfitting of the model and difficulty in adapting to the complex changes in the alcohol disinfectant environment, the present invention expands the data set by a Gaussian noise method; in view of the problem that machine learning relies only on a single classifier, resulting in the model being unable to capture the complex patterns and relationships in the data, thereby limiting the performance of the model, the present invention designs a weighted Stacking ensemble classifier to estimate the concentration of the tested alcohol disinfectant, combines random forest, XGBoost, decision tree and support vector machine as base classifiers, and trains them through a K-fold cross validation algorithm, while selecting a logistic regression model as a meta-classifier, weighting the base classifier and outputting the final prediction result. Summary of the invention
[0003] The technical solution adopted by the present invention is as follows: The present invention provides a disinfectant concentration monitoring method based on machine learning, and the specific steps are as follows:
[0004] S1: Take alcohol disinfectants as samples, construct feature datasets and augment them with Gaussian noise;
[0005] S2: Build a weighted stacking ensemble classifier and train it using the feature dataset;
[0006] S3: Measure the S of the alcohol disinfectant under test by vector network analyzer 11 parameter;
[0007] S4: Estimate the concentration of the tested alcohol disinfectant through the weighted stacking ensemble classifier and determine whether the concentration meets the standard;
[0008] Furthermore, the step S1 specifically includes:
[0009] S11: Using volume fraction as the concentration index, 14 samples of alcohol disinfectants with different concentrations were prepared. The volume fraction contents of the samples included: 0%, 10%, 20%, 30%, 40%, 50%, 55%, 60%, 65%, 70%, 75%, 80%, 90%, 100%;
[0010] S12: The S of 14 samples were analyzed by vector network analyzer. 11 Parameters to be measured, S 11 The parameter range is 1.21GHz-1.80GHz, the frequency interval is 0.01GHz, and 10 groups of S are measured for each concentration. 11 parameter data;
[0011] S13: S 11 The amplitude and frequency in the parameter data are used as feature vectors to construct feature data sets;
[0012] S14: The standard deviation of the Gaussian noise is set to 0.05, 0.1, and 0.15, and 160, 100, and 30 groups of Gaussian noise are added to the feature data set, respectively, so that the feature data set is expanded to contain 300 sets of feature vectors for each concentration.
[0013] Furthermore, the step S2 specifically includes:
[0014] S21: Construct a weighted stacking ensemble classifier: It contains two layers. The first layer constructs the base classifier, and the second layer constructs the meta classifier, and performs weighted prediction based on the base classifier.
[0015] S22: Random forest, XGBoost, decision tree and support vector machine were selected as base classifiers, the feature dataset was divided into 4 sub-datasets, and each concentration in the sub-dataset was ensured to have the same number of feature vectors. Four base classifiers were trained on the four sub-datasets respectively;
[0016] S23: Normalize and divide sub-datasets: Normalize each sub-dataset in S22, and then divide each sub-dataset into a training set and a test set in a ratio of 7:3, and divide each training set into n sub-training sets;
[0017] S24: training the base classifier by a K-fold cross validation algorithm: using each sub-training set for prediction in turn to obtain a sub-training set prediction result, and using the remaining sub-training sets for feature learning. After repeating K times, the prediction results of each sub-training set are stacked to form a new feature value.
[0018] S25: The base classifier makes predictions based on the test set to obtain the test set prediction results. After repeating K times, the average value of the sum of the test set prediction results each time is taken as the new prediction value.
[0019] S26: Calculate the weight of each base classifier: Calculate the mean square error and random sampling mean square error of the test set prediction results of each base classifier, and subtract the mean square error from the random sampling mean square error to obtain the weight of the base classifier. The specific formula for calculating the weight is as follows:
[0020] ;
[0021] ;
[0022] ;
[0023] in, Indicates The mean square error of the base classifiers is Indicates The number of test set samples for the base classifier, Indicates samples, Indicates The base classifier for The prediction results, Indicates The random sampling mean square error of the base classifiers is is the concentration category randomly sampled, for The probability distribution of .
[0024] S27: Select the logistic regression model as the meta-classifier and perform weighted prediction on the base classifiers: assign corresponding weights to the new feature values of each base classifier and stack them to form a new training data set, assign corresponding weights to the new prediction values of each base classifier and stack them to form a new prediction data set, train the meta-classifier based on the new training data set, verify it with the new prediction data set, and use the output of the meta-classifier as the final prediction result.
[0025] Furthermore, the step S3 is specifically: using a vector network analyzer to analyze the S 11 The parameters were measured to obtain amplitude data with an interval of 0.01 GHz between 1.21 GHz and 1.80 GHz, and the feature vector of the measured alcohol disinfectant was constructed.
[0026] Furthermore, the step S4 specifically includes:
[0027] S41: inputting the feature vector of the alcohol disinfectant to be tested into a weighted Stacking ensemble classifier to obtain the final prediction result of the meta-classifier, that is, the predicted value of the concentration of the alcohol disinfectant to be tested;
[0028] S42: Compare the predicted value of the concentration with the standard to determine whether the concentration of the tested alcohol disinfectant meets the standard.
[0029] The beneficial results achieved by the present invention using the above scheme are as follows:
[0030] (1) In view of the problem that alcohol disinfectants are tested in an invasive manner, which makes them susceptible to contamination and interference from measuring equipment, the present invention measures the concentration of alcohol disinfectants by combining a vector network analyzer with machine learning, and can measure alcohol disinfectants in a non-invasive manner, thereby reducing the interference and potential contamination of the measuring equipment on the alcohol disinfectants and improving the accuracy of the measurement.
[0031] (2) In order to solve the problem that it is difficult to obtain a large and diverse data set, which leads to overfitting of the model and makes it difficult to adapt to the complex changes in the alcohol disinfectant environment, the present invention expands the data set through the Gaussian noise method to help the machine learning model better generalize to new and unseen data, thereby improving its performance in practical applications. At the same time, the overfitting phenomenon in the modeling process is reduced through diverse data.
[0032] (3) In order to address the problem that machine learning relies solely on a single classifier, resulting in the model being unable to capture the complex patterns and relationships in the data, thereby limiting the performance of the model, the present invention designs a weighted Stacking ensemble classifier to estimate the concentration of the tested alcohol disinfectant, combines random forest, XGBoost, decision tree and support vector machine as base classifiers, and trains them through a K-fold cross-validation algorithm. At the same time, a logistic regression model is selected as a meta-classifier, the base classifier is weighted and the final prediction result is output, thereby improving the model's prediction ability for alcohol disinfectants in different environments and increasing the model's adaptability and accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flow chart of the disinfectant concentration monitoring method based on machine learning proposed in the present invention;
[0034] Figure 2 This is a flow chart of step S2 proposed by the present invention.
[0035] 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
[0036] 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.
[0037] Example 1, see Figure 1 , Figure 1 Flow chart of a disinfectant concentration monitoring method based on machine learning. In this embodiment, the method includes the following steps:
[0038] S1: Take alcohol disinfectants as samples, construct feature datasets and augment them with Gaussian noise;
[0039] S2: Build a weighted stacking ensemble classifier and train it using the feature dataset;
[0040] S3: Measure the S of the alcohol disinfectant under test by vector network analyzer 11 parameter;
[0041] S4: Estimate the concentration of the tested alcohol disinfectant through the weighted stacking ensemble classifier and determine whether the concentration meets the standard;
[0042] Embodiment 2: Based on the above embodiment, this embodiment realizes the construction of a feature data set and expands it through Gaussian noise, which specifically includes the following steps:
[0043] S11: Using volume fraction content as concentration index, 14 ethanol disinfectant samples of different concentrations were prepared. The volume of ethanol was 100 ml and placed in a sealed glass container. The volume fraction content of ethanol disinfectant samples included: 0%, 10%, 20%, 30%, 40%, 50%, 55%, 60%, 65%, 70%, 75%, 80%, 90%, 100%;
[0044] S12: Connect the patch wires through a vector network analyzer and fit the patch wires to the cup wall of the ethanol disinfectant container. The S of the 14 ethanol disinfectant samples with different concentrations are measured. 11 Parameters to be measured, S 11 The parameter represents the input reflection coefficient, which reflects the reflection loss of the signal at the input end. 11 The parameter range was set to 1.21 GHz-1.80 GHz, the frequency interval was 0.01 GHz, and 10 groups of S were measured for each concentration. 11 parameter data, each concentration should have 600 S 11 parameter data;
[0045] S13: S 11 The amplitude and frequency in the parameter data are used as feature vectors to construct a feature data set, which contains 8400 data in total;
[0046] S14: The standard deviation of Gaussian noise is set to 0.05, 0.1 and 0.15, and 160, 100 and 30 different Gaussian noises are added to the feature data set respectively. The smaller the standard deviation, the closer the distribution of surface noise is to the original data. Therefore, for a larger standard deviation, less noise data is generated to reduce the difference between data of the same concentration. After adding Gaussian noise, the feature data set is expanded from 10 sets of feature vectors for each concentration to 300 sets of feature vectors for each concentration, that is, the expanded feature data set contains 252,000 data;
[0047] Example 3, see Figure 2 , Figure 2 This is a flowchart of step S2. Based on the above embodiment, this embodiment implements the construction and training of a weighted stacking ensemble classifier, which specifically includes the following steps:
[0048] S21: Construct a weighted stacking ensemble classifier: It contains two layers. The first layer constructs the base classifier, and the second layer constructs the meta classifier, and performs weighted prediction based on the base classifier.
[0049] S22: Random forest, XGBoost, decision tree and support vector machine were selected as base classifiers. The 252,000 data of the feature data set were randomly divided into 4 sub-datasets, and each concentration in the sub-dataset was guaranteed to have the same number of feature vectors. Four base classifiers were trained for each of the four sub-datasets.
[0050] S23: Normalize and divide sub-datasets: Normalize each sub-dataset in S22, and then divide each sub-dataset into a training set and a test set in a ratio of 7:3, and divide each training set into 10 sub-training sets;
[0051] S24: training the base classifier by a 10-fold cross validation algorithm: using each sub-training set for prediction in turn to obtain a sub-training set prediction result, and using the remaining sub-training sets for feature learning. After repeating 10 times, the prediction results of each sub-training set are stacked to form a new feature value.
[0052] S25: The base classifier makes predictions based on the test set to obtain the test set prediction results. After repeating 10 times, the average value of the sum of the test set prediction results each time is taken as the new prediction value.
[0053] S26: Calculate the weight of each base classifier: Calculate the mean square error and random sampling mean square error of the test set prediction results of each base classifier, and subtract the mean square error from the random sampling mean square error to obtain the weight of the base classifier. The specific formula for calculating the weight is as follows:
[0054] ;
[0055] ;
[0056] ;
[0057] in, Indicates The mean square error of the base classifiers is Indicates The number of test set samples for the base classifier, Indicates samples, Indicates The base classifier for The prediction results, Indicates The random sampling mean square error of the base classifiers is is the concentration category randomly sampled, for The probability distribution of .
[0058] S27: Select the logistic regression model as the meta-classifier and perform weighted prediction on the base classifiers: assign corresponding weights to the new feature values of each base classifier and stack them to form a new training data set, assign corresponding weights to the new prediction values of each base classifier and stack them to form a new prediction data set, train the meta-classifier based on the new training data set, verify it with the new prediction data set, and use the output of the meta-classifier as the final prediction result.
[0059] Embodiment 4, based on the above embodiment, this embodiment realizes the evaluation of the concentration of the disinfectant being tested, specifically:
[0060] A 100 ml sample of the tested ethanol disinfectant was taken and placed in a sealed glass container. The patch wire was placed close to the wall of the container. The S 11 The parameters were measured to obtain amplitude data with an interval of 0.01 GHz between 1.21 GHz and 1.80 GHz, and the feature vector of the tested ethanol disinfectant was constructed.
[0061] The feature vector is input as an input vector into a weighted Stacking ensemble classifier to obtain an evaluation result of the meta-classifier on the concentration of the tested ethanol disinfectant;
[0062] The concentration assessment result is compared with the qualified concentration in the alcohol disinfectant hygiene requirement document in the national standard. In this embodiment, the assessment result of the tested ethanol disinfectant is 70%, which is within the range specified in GB / T 26373-2020 and is therefore a qualified product.
Claims
1. A method for monitoring disinfectant concentration based on machine learning, characterized in that: The following steps are involved: S1: Take alcohol disinfectants as samples, construct feature datasets and augment them with Gaussian noise; S2: Build a weighted stacking ensemble classifier and train it using the feature dataset; S3: Measure the S of the alcohol disinfectant under test by vector network analyzer 11 parameter; S4: Estimate the concentration of the tested alcohol disinfectant through the weighted stacking ensemble classifier and determine whether the concentration meets the standard; The step S1 specifically includes: S11: Using volume fraction content as concentration index, prepare samples of alcohol disinfectants with different concentrations; S12: The S of the samples were measured by vector network analyzer. 11 Parameters are measured; S13: S 11 The amplitude and frequency in the parameters are used as feature vectors to construct feature data sets; S14: The standard deviation of the Gaussian noise is set to 0.05, 0.1, and 0.15, and 160, 100, and 30 groups of Gaussian noise are added to the feature data set, respectively, so that the feature data set is expanded to contain 300 sets of feature vectors for each concentration.
2. The method for monitoring disinfectant concentration based on machine learning according to claim 1, characterized in that: The step S2 specifically includes: S21: Construct a weighted stacking ensemble classifier: It contains two layers. The first layer constructs the base classifier, and the second layer constructs the meta classifier, and performs weighted prediction based on the base classifier. S22: Random forest, XGBoost, decision tree and support vector machine were selected as base classifiers, the feature dataset was divided into 4 sub-datasets, and each concentration in the sub-dataset was ensured to have the same number of feature vectors. Four base classifiers were trained on the four sub-datasets respectively; S23: Normalize and divide sub-datasets: Normalize each sub-dataset in S22, and then divide each sub-dataset into a training set and a test set in a ratio of 7:3, and divide each training set into n sub-training sets; S24: training the base classifier by a K-fold cross validation algorithm: using each sub-training set for prediction in turn to obtain a sub-training set prediction result, and using the remaining sub-training sets for feature learning. After repeating K times, the prediction results of each sub-training set are stacked to form a new feature value. S25: The base classifier makes a prediction based on the test set to obtain the test set prediction result. After repeating K times, the average value of the sum of the test set prediction results each time is taken as the new prediction value. S26: Calculate the weight of each base classifier: Calculate the mean square error and random sampling mean square error of the test set prediction results of each base classifier, and subtract the mean square error from the random sampling mean square error to obtain the weight of the base classifier; S27: Select the logistic regression model as the meta-classifier and perform weighted prediction on the base classifiers: assign corresponding weights to the new feature values of each base classifier and stack them to form a new training data set, assign corresponding weights to the new prediction values of each base classifier and stack them to form a new prediction data set, train the meta-classifier based on the new training data set, verify it with the new prediction data set, and use the output of the meta-classifier as the final prediction result.
3. The method for monitoring disinfectant concentration based on machine learning according to claim 2, characterized in that: The step S3 specifically comprises: using a vector network analyzer to analyze the S 11 The parameters were measured to obtain amplitude data with an interval of 0.01 GHz between 1.21 GHz and 1.80 GHz, and the feature vector of the measured alcohol disinfectant was constructed.
4. The method for monitoring disinfectant concentration based on machine learning according to claim 3, characterized in that: The step S4 specifically includes: S41: inputting the feature vector of the alcohol disinfectant to be tested into a weighted Stacking ensemble classifier to obtain the final prediction result of the meta-classifier, that is, the predicted value of the concentration of the alcohol disinfectant to be tested; S42: Compare the predicted value of the concentration with the standard to determine whether the concentration of the tested alcohol disinfectant meets the standard.
5. The method for monitoring disinfectant concentration based on machine learning according to claim 1, characterized in that: In step S11, the volume fraction content of the alcohol disinfectant sample includes: 0%, 10%, 20%, 30%, 40%, 50%, 55%, 60%, 65%, 70%, 75%, 80%, 90%, and 100%.
6. The method for monitoring disinfectant concentration based on machine learning according to claim 1, characterized in that: The S 11 The parameter range is 1.21GHz-1.80GHz, the frequency interval is 0.01GHz, and 10 groups of S are measured for each concentration. 11 Parameter data.
Citation Information
Cited By
Online monitoring and fault diagnosis method and system for laser cutting machine
CN120244308A
