Multi-gas sensor integrated cross interference resolving method

By improving the sparrow algorithm to optimize the BP neural network model, cross-interference in multi-gas sensor integration is solved, sensor detection accuracy and system reliability problems are solved, and more efficient data processing and more accurate gas concentration detection are achieved.

CN119691422AInactive Publication Date: 2025-03-25河南驰诚电气股份有限公司

Patent Information

Application Number
CN202411878427.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-25
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The multi-gas sensors face cross-interference problems during the integration process, resulting in reduced detection accuracy and system reliability.

Method used

The improved sparrow algorithm is used to optimize the BP neural network (ISSA-BP) model to solve the sensor cross-interference. By introducing the ISSA algorithm of global optimization capability, the weight and threshold of the BP neural network model are optimized, which improves the convergence speed and avoids local optimal solutions.

Benefits of technology

It effectively improves the convergence speed of the BP neural network model, reduces the probability of falling into local optimality, improves production efficiency, and significantly improves the detection accuracy and system reliability of multi-gas sensors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119691422A_ABST
    Figure CN119691422A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-gas sensor integration cross interference resolving method, relates to the technical field of multi-gas sensor integration, and solves the problem that the response of a sensor to mixed gas causes deviation of a detection result, so that the overall precision and reliability of a system are influenced. The cross interference resolving method comprises the following steps: calibrating corresponding gas sensors in different standard gas environments; in an environment containing mixed gas, recording cross interference data measured and calculated by the gas sensor; performing normalization processing on the cross interference data, dividing the cross interference data into a training set, a verification set and a test set, and constructing and initializing a BP neural network model; optimizing the BP neural network model by using an improved sparrow search algorithm to obtain feature network parameters; performing multiple times of iterative training on the feature network parameters of the BP neural network model through the training set and the verification set to obtain a to-be-evaluated comprehensive weight matrix; checking the resolving precision and generalization ability of the comprehensive weight matrix to be evaluated through the test set to obtain a final comprehensive weight matrix; and calculating the concentrations of different gases in the cross interference data through the final comprehensive weight matrix.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multi-gas sensor integration, and in particular to a multi-gas sensor integration cross-interference solution method. Background Art

[0002] With the continuous acceleration of industrialization and urbanization, multiple harmful gases coexist in industrial environments, posing a serious threat to human health and environmental safety. Therefore, how to accurately and quickly detect the concentration of multiple gases has become an urgent problem to be solved. In this context, multi-gas sensor integration technology came into being, that is, multiple sensors are integrated into one product, which can detect multiple gases at the same time, providing technical support for the petrochemical and storage and transportation industries, atmospheric and environmental monitoring, and industrial process detection and control. However, there is a key challenge in the integration of multi-gas sensors, namely the cross-interference problem of sensors to multiple gases.

[0003] To address the impact of cross-interference on sensor detection accuracy, traditional research mainly relies on hardware optimization strategies such as highly selective materials, built-in gas filters, applying bias voltage, and adding different catalysts.

[0004] Patent No. CN2022107304888 discloses a traffic signal control optimization method based on an improved sparrow search algorithm, including using elite reverse learning to initialize the population and generate initialization basic parameters, and also includes the following steps: improving the discoverer position update formula by introducing an adaptive convergence factor alpha and adjusting the value range, while optimizing the follower and warner position update formulas and parameters; using the Levy flight mutation perturbation strategy, by introducing polynomial mutations into the sparrow search algorithm to perturb the positions of some individuals that are stuck in a search stagnation, while updating the sparrow positions, calculating the fitness values ​​and sorting them; and performing performance testing on the improved sparrow search algorithm. The above invention proposes a traffic signal control optimization method based on an improved sparrow search algorithm, which can be used to solve multi-objective optimization problems by enhancing the diversity of the population, improving its optimization ability and convergence speed.

[0005] Patent No. CN2021110834457 discloses a distributed power generation site selection and sizing optimization method based on an improved sparrow search algorithm, including: first, establishing a comprehensive acceptance standard model based on three indicators: full life cycle cost, network active power loss and voltage deviation, and determining the optimization objective function and constraints based on the comprehensive acceptance standard model. Then, the improved sparrow search algorithm is used to rationally plan the site selection and sizing of DG. Through the ergodicity, regularity and randomness of Tent chaos, Gaussian variation is introduced to improve the global search ability and convergence speed of the algorithm, which can effectively avoid falling into the local optimum and facilitate obtaining the global optimal solution. The above method can effectively improve the system load rate, save economic costs, reduce active power loss, etc., while ensuring the safe and reliable operation of the distribution network and its economy.

[0006] Patent No. CN2024109518151 discloses a method for predicting overlapping heating deformation of complex curved plates of titanium alloy based on a multi-strategy improved sparrow search algorithm to optimize a BP neural network. S1: Acquire the forming data of titanium alloy wire heating, and perform Latin hypercube sampling to obtain the sampled forming data; S2: Perform finite element calculation based on the sampled forming data to obtain deformation field data; S3: Normalize the data to obtain the normalized data, and divide it into a training set and a prediction set; S4: Construct a BP neural network model, and use a multi-strategy improved sparrow search algorithm to optimize the BP neural network model;

[0007] S5: training the optimized BP neural network model based on the training set; S6: determining the prediction accuracy of the trained BP neural network model based on the prediction set to obtain the final BP neural network model; S7: predicting the deformation field data corresponding to the actual forming data based on the final BP neural network model. The above invention can be used for the prediction of heating deformation of titanium alloy wire, realizing the rapid and large-scale prediction of the heating deformation field data of titanium alloy wire, and shortening the calculation time.

[0008] However, the strategies in the above patents can mitigate the impact of cross-interference, but when processing mixed gases, the sensor's response to non-target gases will cause deviations in the detection results, thereby affecting the overall accuracy and reliability of the system, and may lead to erroneous evaluations and decisions, thereby affecting production efficiency and safety management. Summary of the invention

[0009] The purpose of the present invention is to provide a multi-gas sensor integrated cross-interference solution method, which can solve the sensor cross-interference by optimizing the BP neural network (ISSA-BP) model through an improved sparrow algorithm; by introducing the ISSA algorithm that can achieve global optimization, the weights and thresholds of the BP neural network model are optimized, effectively avoiding the BP neural network model from falling into the local optimal situation due to the slow convergence speed of the BP neural network model, thereby improving production efficiency.

[0010] The present invention utilizes the following technical solutions:

[0011] A method for solving cross-interference of multi-gas sensor integration includes the following steps:

[0012] S1: Calibrate the corresponding gas sensor in different standard gas environments;

[0013] S2: In an environment containing mixed gases, the cross-interference data measured by different calibrated gas sensors are recorded;

[0014] S3: normalize the cross-interference data, divide the normalized cross-interference data into a training set, a validation set, and a test set, and construct a BP neural network model and initialize it;

[0015] S4: Optimize the BP neural network model using the sparrow search algorithm or the improved sparrow search algorithm based on Tent chaos mapping, Levy flight strategy and Cauchy-Gauss mutation strategy to obtain characteristic network parameters;

[0016] S5: Perform several iterations of training on the characteristic network parameters of the BP neural network model through the training set and the validation set to obtain the comprehensive weight matrix to be evaluated;

[0017] S6: The calculation accuracy and generalization ability of the comprehensive weight matrix to be evaluated are tested through the test set to obtain the final comprehensive weight matrix;

[0018] S7: Calculate the concentrations of different gases in the cross-interference data through the final comprehensive weight matrix.

[0019] Preferably, the standard gas includes carbon monoxide, chlorine, ammonia, sulfur dioxide and nitrogen dioxide; the gas sensor includes a carbon monoxide sensor, a chlorine sensor, an ammonia sensor, a sulfur dioxide sensor and a nitrogen dioxide sensor.

[0020] Preferably, in step S2, the formula for calculating the cross-interference data by the gas sensor is:

[0021]

[0022] Among them, r sis the true concentration value of the sth gas, s = 1, 2, 3, 4, 5, f 1 () represents the sensor function, y m This is the cross-interference data of sensor m in a mixed gas environment.

[0023] Preferably, step S3 includes the following steps:

[0024] S31: clustering the cross-interference data according to the type of gas sensor to obtain several types of cross-interference data;

[0025] S32: extracting the maximum value and the minimum value in each type of cross-interference data, and calculating the absolute difference between the maximum value and the minimum value; and calculating the average value and the standard deviation value of each type of cross-interference data;

[0026] S33: Dividing the difference between each cross-interference data of the same type and the minimum value by the absolute difference to obtain first normalized data; and dividing the difference between each cross-interference data of the same type and the average value by the standard deviation to obtain second normalized data;

[0027] S34: calculating the average of the first normalized data and the second normalized data to obtain standard normalized data of each cross-interference data;

[0028] S35: Divide all standard normalized data into training set, validation set and test set according to the ratio of 7:2:1;

[0029] S36: setting the number of input layer nodes of the BP neural network model according to the total number of gas sensors, selecting X hidden layers and activation functions, setting the number of output layer nodes according to the number of gas sensor types, and then constructing the BP neural network model;

[0030] S37: Initialize the weights and thresholds of the BP neural network model.

[0031] Preferably, step S4 includes the following steps:

[0032] S41: randomly generate N sparrows to form an initial sparrow population, and set the sparrow population size, warning value, number of iterations and solution accuracy;

[0033] S42: Initialize the initial sparrow population using Tent chaotic mapping and divide the initial sparrow population into discoverers, joiners and guards;

[0034] S43: In each iteration, the finder is responsible for finding food sources and providing foraging information to the initial sparrow population;

[0035] S44: The joiner uses the Levy flight strategy to forage based on the foraging information of the discoverer;

[0036] S45: During the foraging process of discoverers and joiners, the vigilants monitor abnormal behaviors in the initial sparrow population and warn the initial sparrow population when danger is detected;

[0037] S46: Calculate the fitness of each sparrow in the initial sparrow population, and sort all fitnesses from low to high, and then update the positions of the discoverer, joiner and guard;

[0038] S47: Use the Cauchy-Gauss mutation strategy to mutate the sparrow individuals with low fitness in the initial sparrow population, compare the positions before and after the mutation, and select the better position to be substituted into the next iteration;

[0039] S48: During the iterative training process, the number of iterations or the solution accuracy is continuously judged: if the number of iterations and / or the solution accuracy reaches the set value, the optimal sparrow individual information and characteristic network parameters are output; if the number of iterations and the solution accuracy do not reach the set value, the steps S42 to S48 are looped to continue iteration.

[0040] Preferably, the function expression of the Tent chaos map is:

[0041]

[0042] Among them, k represents the number of mappings, Z k represents the value of the k-th mapping function, β is the Tent chaos parameter, and β is 0.5;

[0043] The functional expression of the Cauchy-Gauss mutation strategy is:

[0044]

[0045] in, represents the position of the best sparrow individual after mutation in the current iteration, t represents the number of current iterations, represents the position of the best sparrow individual in the current iteration, σ 2 represents the standard deviation of the Cauchy-Gaussian mutation strategy, Cauchy(0,σ 2 ) represents a random variable with Cauchy distribution, Gauss(0,σ 2 ) represents a Gaussian distributed random variable, λ 1 ,λ 2 represents the adaptive dynamic parameter with the number of iterations, f() represents the Cauchy-Gaussian mutation strategy function, T max represents the maximum number of iterations, X best represents the optimal position of the sparrow individual, X i Represents the position of the i-th sparrow.

[0046] Preferably, the location update function of the discoverer is:

[0047]

[0048] in, represents the position of the i-th discoverer in the j-th dimension in the t-th iteration, α represents a random number in the interval [0,1], iter max represents the maximum number of iterations, Q represents a random number that obeys a normal distribution, L represents the unit matrix, and R 2 represents a random number in the interval [0,1], and ST represents a random number in the interval [0.5,1].

[0049] Preferably, in step S44, the improved position function of the joiner is:

[0050]

[0051] γ=μ / |υ| 1 / β (8)

[0052]

[0053] in, represents the position of the wth joiner in the tth iteration, n represents the total number of discoverers, A + represents the random matrix, L represents the flight step length, γ represents the Levy flight strategy factor, μ and υ represent the normal distribution parameters, Γ is the gamma function, and represents the variance of the normal distribution, Indicates the position of the b-th joiner at the t+1-th iteration.

[0054] Preferably, the position update formula of the sentinel is:

[0055]

[0056] Among them, K represents a random number in the interval [-1,1], ε represents a very small constant, and f i represents the fitness of the current sparrow individual, f g represents the optimal fitness, f w Indicates the worst fitness.

[0057] Preferably, step S5 includes the following steps:

[0058] S51: The input layer of the BP neural network model receives each training sample in the training set and extracts feature information of the training sample;

[0059] S52: The hidden layer uses the activation function and the hidden bias to perform several iterative training on the extracted feature information, and then outputs the feature weight matrix; the activation function includes the MISH activation function and the RELU activation function;

[0060] S53: The output layer calculates the difference between the verification value and the actual value of the feature weight matrix using the loss function, the hidden weight, the output bias and the verification set; the loss function includes a mean square error function or a cross entropy function;

[0061] S54: Utilize the loss function and gradient descent algorithm to continuously update all weights and biases in the BP neural network model, and then obtain the comprehensive weight matrix to be evaluated; the gradient descent algorithm includes the Adam algorithm and the RMSprop algorithm.

[0062] The present invention solves the sensor cross interference by improving the sparrow algorithm to optimize the BP neural network (ISSA-BP) model; by introducing the ISSA algorithm that can achieve global optimization to optimize the weights and thresholds of the BP neural network model, the convergence speed of the BP neural network model is effectively improved, the probability of the BP neural network model falling into the local optimum is reduced, and the production efficiency is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or related technologies, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0064] Figure 1 It is the principle block diagram of the cross-interference solution method;

[0065] Figure 2 It is a schematic diagram of the ISSA-BP neural network structure;

[0066] Figure 3 Flowchart for improving the sparrow search algorithm;

[0067] Figure 4 This is the result diagram of carbon monoxide solution using different algorithms;

[0068] Figure 5 This is the solution result diagram of chlorine gas using different algorithms;

[0069] Figure 6 This is the calculation result diagram of ammonia using different algorithms;

[0070] Figure 7 This is the calculation result diagram of sulfur dioxide using different algorithms;

[0071] Figure 8 This is the calculation result diagram of nitrogen dioxide using different algorithms;

[0072] Fig. 9 This is the error result diagram of carbon monoxide in different algorithms;

[0073] Fig.10 This is the error result diagram of chlorine in different algorithms;

[0074] Fig.11 This is the error result diagram of ammonia in different algorithms;

[0075] Fig.12 This is the error result diagram of sulfur dioxide in different algorithms;

[0076] Fig.13 This is the error result diagram of nitrogen dioxide using different algorithms. DETAILED DESCRIPTION

[0077] The present invention is described in detail below with reference to the accompanying drawings and embodiments:

[0078] like Figure 1-Figure 3 As shown, the multi-gas sensor integrated cross-interference solution method of the present invention includes the following steps:

[0079] S1: Calibrate the corresponding gas sensor in different standard gas environments;

[0080] In the present invention, the standard gas includes carbon monoxide, chlorine, ammonia, sulfur dioxide and nitrogen dioxide, etc.; the gas sensor includes a carbon monoxide sensor, a chlorine sensor, an ammonia sensor, a sulfur dioxide sensor and a nitrogen dioxide sensor, etc.;

[0081] S2: In an environment containing mixed gases, the cross-interference data measured by different calibrated gas sensors are recorded;

[0082] In the present invention, in step S2, the formula for calculating the cross-interference data by the gas sensor is:

[0083]

[0084] Among them, r s is the true concentration value of the sth gas, s = 1, 2, 3, 4, 5, f 1 () represents the sensor function, y m is the cross-interference data of sensor m in a mixed gas environment;

[0085] S3: normalize the cross-interference data, divide the normalized cross-interference data into a training set, a validation set, and a test set, and construct a BP neural network model and initialize it;

[0086] S4: Optimize the BP neural network model using the sparrow search algorithm or the improved sparrow search algorithm based on Tent chaos mapping, Levy flight strategy and Cauchy-Gauss mutation strategy to obtain characteristic network parameters;

[0087] S5: Perform several iterations of training on the characteristic network parameters of the BP neural network model through the training set and the validation set to obtain the comprehensive weight matrix to be evaluated;

[0088] S6: The calculation accuracy and generalization ability of the comprehensive weight matrix to be evaluated are tested through the test set to obtain the final comprehensive weight matrix;

[0089] S7: Calculate the concentrations of different gases in the cross-interference data through the final comprehensive weight matrix.

[0090] In the present invention, step S3 includes the following steps:

[0091] S31: clustering the cross-interference data according to the type of gas sensor to obtain several types of cross-interference data;

[0092] S32: extracting the maximum value and the minimum value in each type of cross-interference data, and calculating the absolute difference between the maximum value and the minimum value; and calculating the average value and the standard deviation value of each type of cross-interference data;

[0093] S33: Dividing the difference between each cross-interference data of the same type and the minimum value by the absolute difference to obtain first normalized data; and dividing the difference between each cross-interference data of the same type and the average value by the standard deviation to obtain second normalized data;

[0094] S34: calculating the average of the first normalized data and the second normalized data to obtain standard normalized data of each cross-interference data;

[0095] S35: Divide all standard normalized data into training set, validation set and test set according to the ratio of 7:2:1;

[0096] S36: setting the number of input layer nodes of the BP neural network model according to the total number of gas sensors, selecting X hidden layers and activation functions, setting the number of output layer nodes according to the number of gas sensor types, and then constructing the BP neural network model;

[0097] S37: Initialize the weights and thresholds of the BP neural network model;

[0098] In the present invention, step S4 includes the following steps:

[0099] S41: randomly generate N sparrows to form an initial sparrow population, and set the sparrow population size, warning value, number of iterations and solution accuracy;

[0100] S42: Initialize the initial sparrow population using Tent chaotic mapping and divide the initial sparrow population into discoverers, joiners and guards;

[0101] In this embodiment, the function expression of the Tent chaotic map is:

[0102]

[0103] Among them, k represents the number of mappings, Z k represents the value of the k-th mapping function, β is the Tent chaos parameter, and β is 0.5;

[0104] In this embodiment, in order to solve the problem that the initial population of sparrows is unevenly distributed, thereby affecting the subsequent iterative optimization, the population is initialized by using tent mapping, which can conduct a wide search in the solution space of complex problems, avoid "premature convergence" in the search process, and effectively adjust the search direction, thereby accelerating the convergence to the global optimal solution;

[0105] S43: In each iteration, the finder is responsible for finding food sources and providing foraging information to the initial sparrow population;

[0106] In this embodiment, the location update function of the discoverer is:

[0107]

[0108] in, represents the position of the i-th discoverer in the j-th dimension in the t-th iteration, α represents a random number in the interval [0,1], iter max represents the maximum number of iterations, Q represents a random number that obeys a normal distribution, L represents the unit matrix, and R 2 represents a random number in the interval [0,1], and ST represents a random number in the interval [0.5,1];

[0109] S44: The joiner uses the Levy flight strategy to forage based on the foraging information of the discoverer;

[0110] In this embodiment, the improved position function of the joiner is:

[0111]

[0112] γ=μ / |υ| 1 / β (8)

[0113]

[0114] in, represents the position of the wth joiner in the tth iteration, n represents the total number of discoverers, A + represents the random matrix, L represents the flight step length, γ represents the Levy flight strategy factor, μ and υ represent the normal distribution parameters, Γ is the gamma function, and represents the variance of the normal distribution, represents the position of the b-th joiner at the t+1th iteration;

[0115] In this embodiment, the traditional joiner position update is too dependent on the discoverer position information, resulting in insufficient local search capabilities, easy to fall into the local optimal solution, and limited movement step length, lack of flexibility; therefore, the Levy flight strategy is introduced to make the sparrows move with a smaller step length, but occasionally a larger jump will occur; this update mechanism not only enhances the joiner's detailed search capabilities near the discoverer, but also improves its detection capabilities in a wider area;

[0116] S45: During the foraging process of discoverers and joiners, the vigilants monitor abnormal behaviors in the initial sparrow population and warn the initial sparrow population when danger is detected;

[0117] In this embodiment, the position update formula of the alerter is:

[0118]

[0119] Among them, K represents a random number in the interval [-1,1], ε represents a very small constant, and f i represents the fitness of the current sparrow individual, f g represents the optimal fitness, f w represents the worst fitness;

[0120] S46: Calculate the fitness of each sparrow in the initial sparrow population, and sort all fitnesses from low to high, and then update the positions of the discoverer, joiner and guard;

[0121] S47: Use the Cauchy-Gauss mutation strategy to mutate the sparrow individuals with low fitness in the initial sparrow population, compare the positions before and after the mutation, and select the better position to be substituted into the next iteration;

[0122] In this embodiment, the functional expression of the Cauchy-Gaussian mutation strategy is:

[0123]

[0124] in, represents the position of the best sparrow individual after mutation in the current iteration, t represents the number of current iterations, represents the position of the best sparrow individual in the current iteration, σ 2 represents the standard deviation of the Cauchy-Gaussian mutation strategy, Cauchy(0,σ 2 ) represents a random variable with Cauchy distribution, Gauss(0,σ 2 ) represents a Gaussian distributed random variable, λ 1 ,λ 2 represents the adaptive dynamic parameter with the number of iterations, f() represents the Cauchy-Gaussian mutation strategy function, T max represents the maximum number of iterations, X best represents the optimal position of the sparrow individual, X i represents the position of the i-th sparrow;

[0125] In this embodiment, when the sparrow search algorithm gradually approaches the optimal solution, the flexibility of the search will be weakened, resulting in a significant decrease in detection ability, prone to over-convergence, and lack of necessary diversity and adaptability; by introducing the Cauchy-Gauss mutation strategy, the individual with the best current fitness is selected for mutation, and then the positions before and after the mutation are compared, and the better position is selected for the next iteration;

[0126] S48: During the iterative training process, the number of iterations or the solution accuracy is continuously judged: if the number of iterations and / or the solution accuracy reaches the set value, the optimal sparrow individual information and characteristic network parameters are output; if the number of iterations and the solution accuracy do not reach the set value, the steps S42 to S48 are looped to continue the iteration;

[0127] In the present invention, step S5 includes the following steps:

[0128] S51: The input layer of the BP neural network model receives each training sample in the training set and extracts feature information of the training sample;

[0129] S52: The hidden layer uses the activation function and the hidden bias to perform several iterative training on the extracted feature information, and then outputs the feature weight matrix; the activation function includes the MISH activation function and the RELU activation function;

[0130] S53: The output layer calculates the difference between the verification value and the actual value of the feature weight matrix using the loss function, the hidden weight, the output bias and the verification set; the loss function includes a mean square error function or a cross entropy function;

[0131] S54: Using the loss function and gradient descent algorithm, all weights and biases in the BP neural network model are continuously updated to obtain the comprehensive weight matrix to be evaluated;

[0132] In the present invention, the diversity of the initial position of the population is enhanced by combining the Tent chaotic mapping, thereby improving the global search capability; the Levy flight strategy improves the randomness and effectiveness of the joiner position enhancement search, and increases the ability to jump out of the local optimum; the Cauchy-Gauss mutation strategy improves the diversity of solutions, thereby improving the overall optimization capability of the algorithm.

[0133] Example:

[0134] The test was conducted in a 30L well-sealed environmental chamber with standard atmospheric pressure (101.325 kPa), standard temperature (25°C), and standard humidity (60% RH). A fan was placed in the environmental chamber to assist gas diffusion, and six five-in-one detectors (carbon monoxide sensor, chlorine sensor, ammonia sensor, sulfur dioxide sensor, and nitrogen dioxide sensor) were placed at different locations to eliminate the influence of location on sensor data.

[0135] Before the experiment began, all sensors were placed in a standard gas concentration environment for calibration. Subsequently, 25 groups of mixed gases were prepared through the intelligent dynamic gas distribution system, and these mixed gas combinations were introduced into the environmental chamber, and the fan in the environmental chamber was enabled to assist gas diffusion. After the gas concentration stabilized, the host computer recorded the response data of each sensor. The experiment was repeated three times for each mixed gas combination, and the environmental chamber was cleaned after each experiment to ensure that no residual gas would affect subsequent experiments. In the end, a total of 150 groups of cross-interference experimental data were collected;

[0136] Table 1 shows some measured data, among which a 1 、a 2 、a 3 、a 4 and a 5 is the actual concentration of the corresponding introduced CO, Cl2, NH3, SO2, and NO2 gases, b 1 、b 2 、b 3 、b 4 and b 5 is the corresponding concentration after cross interference.

[0137] Table 1 Part of the original data

[0138] <![CDATA[a 1 ]]> <![CDATA[b 1 ]]> <![CDATA[a 2 ]]> <![CDATA[b 2 ]]> <![CDATA[a 3 ]]> <![CDATA[b 3 ]]> <![CDATA[a 4 ]]> <![CDATA[b 4 ]]> <![CDATA[a 5 ]]> <![CDATA[b 5 ]]> 500.00 495.12 30.00 33.75 100.00 92.85 16.00 6.45 16.00 14.14 200.00 189.43 10.00 12.12 80.00 70.61 20.00 10.98 16.00 2.41 300.00 288.33 20.00 23.75 60.00 48.88 20.00 11.66 20.00 9.12 300.00 290.46 10.00 10.19 40.00 38.29 16.00 12.03 8.00 1.18 100.00 99.81 10.00 10.11 20.00 15.33 4.00 1.84 4.00 2.67 400.00 400.37 10.00 16.27 100.00 99.87 12.00 1.72 20.00 20.22 400.00 386.54 20.00 22.34 20.00 17.83 16.00 11.19 12.00 7.67 200.00 196.55 50.00 45.66 60.00 37.06 16.00 12.16 4.00 0.02 100.00 88.72 40.00 41.75 80.00 57.63 16.00 7.15 20.00 7.39 500.00 500.36 10.00 14.29 60.00 66.75 8.00 2.78 12.00 17.85

[0139] Normalize the cross-interference data using Min-Max normalization

[25] to convert all cross-interference data into the range of [0, 1] as the data set; this can reduce the impact of outliers, more effectively identify data patterns, and improve the robustness and performance of the model;

[0140] The mean absolute error (MAE), root mean square error (RMSE) and mean absolute error (MAPE) are used for evaluation. The smaller the MAE, the smaller the model error; the smaller the RMSE, the better the model fitting effect; the smaller the MAPE, the more accurate the model reflects the data trend changes;

[0141] The dataset is divided into three mutually exclusive subsets, each containing 50 sets of experimental data, corresponding to the measurement results of two five-in-one detectors. In each iteration, one of the subsets is selected as the test set, and the other two subsets are used as training sets and validation sets; this process is repeated three times to ensure that each subset is used as a test set once, and finally the average of the three test results is taken as the output of the model;

[0142] The input variables of the algorithm model are the detection concentrations of the corresponding sensors of carbon monoxide, chlorine, ammonia, sulfur dioxide and nitrogen dioxide, and the output variables are the actual concentration values ​​of the five gases. The neural network parameter settings are shown in Table 2.

[0143] Table 2 Neural network parameter settings

[0144] parameter value parameter value Number of hidden layers 1 Learning Rate 0.01 Number of hidden layer nodes 10 Training function Trainlm Target minimum error <![CDATA[1×10 -6 ]]> Hidden layer function Relu Minimum performance gradient <![CDATA[1×10 -7 ]]> Output layer function Purelin Iterations 1000

[0145] The BP, PSO-BP, GA-BP, SSA-BP, and ISSA-BP solution model codes were built into the five-in-one gas detector program, and then the experiment was conducted again to obtain the data after the five models were solved; in order to verify the accuracy of the cross-interference solution, the solution results of the ISSA-BP model were compared with the cross-interference value, BP, PSO-BP, GA-BP, and SSA-BP model results. The solution comparison results are shown in Figure 4-Figure 8 ;

[0146] The carbon monoxide sensor has a large detection range, and its cross-interference value and solution value fluctuate little relative to the true value. Figure 4 The performance of the solution value is not obvious, but the solution value of the ISSA-BP model is still closest to the true value;

[0147] For the chlorine gas sensor, ISSA-BP also performs well, while the calculated values ​​of PSO-BP and SSA-BP fluctuate greatly and fail to stably reflect the true concentration; Figures 6 to 8 It shows that the cross-interference of ammonia, sulfur dioxide and nitrogen dioxide sensors is significant, affecting the calculated values ​​of all algorithms. However, ISSA-BP still performs well in all samples, effectively suppressing interference and maintaining closeness to the true value, indicating that the algorithm model has good applicability and stability;

[0148] To further verify the solution effect of the ISSA-BP model, the ISSA-BP is compared with the BP, PSO-BP, GA-BP, and SSA-BP models in the dimension of the absolute value of the absolute error;

[0149] Fig. 9 and Fig.13 In the data, the errors of the BP, PSO-BP and GA-BP models are presented in the form of scattered points, showing large volatility and error range; especially in some sample intervals, the errors increase significantly, reflecting the poor stability of these models when dealing with cross-interference. Overall, the error fluctuation of the BP model is the largest, and although the errors of PSO-BP and GA-BP are relatively small, there are still large fluctuations;

[0150] The errors of SSA-BP and ISSA-BP are presented in the form of dot-line graphs, showing smaller errors and fluctuations, but the error of SSA-BP still fluctuates slightly at certain points in the sample interval; the performance of the ISSA-BP algorithm is particularly outstanding, and its error value remains at a low level in most samples with minimal fluctuations, demonstrating its high accuracy and good stability when dealing with cross-interference.

Claims

1. A method for solving cross-interference of multi-gas sensors, characterized by: The steps include: S1: Calibrate the corresponding gas sensor in different standard gas environments; S2: In an environment containing mixed gases, the cross-interference data measured by different calibrated gas sensors are recorded; S3: normalize the cross-interference data, divide the normalized cross-interference data into a training set, a validation set, and a test set, and construct a BP neural network model and initialize it; S4: Optimize the BP neural network model using the sparrow search algorithm or the improved sparrow search algorithm based on Tent chaos mapping, Levy flight strategy and Cauchy-Gauss mutation strategy to obtain characteristic network parameters; S5: Perform several iterations of training on the characteristic network parameters of the BP neural network model through the training set and the validation set to obtain the comprehensive weight matrix to be evaluated; S6: The calculation accuracy and generalization ability of the comprehensive weight matrix to be evaluated are tested through the test set to obtain the final comprehensive weight matrix; S7: Calculate the concentrations of different gases in the cross-interference data through the final comprehensive weight matrix.

2. The method for solving the cross-interference of multiple gas sensors according to claim 1, characterized in that: The standard gases include carbon monoxide, chlorine, ammonia, sulfur dioxide and nitrogen dioxide; the gas sensors include a carbon monoxide sensor, a chlorine sensor, an ammonia sensor, a sulfur dioxide sensor and a nitrogen dioxide sensor.

3. The method for solving the cross-interference of multiple gas sensors according to claim 1, characterized in that: In step S2, the formula for calculating the cross-interference data by the gas sensor is: Among them, r s is the true concentration value of the sth gas, s=1,2,3,4,5, f1() represents the sensor function, y m This is the cross-interference data of sensor m in a mixed gas environment.

4. The method for solving the cross-interference of multiple gas sensors according to claim 1, characterized in that: The step S3 includes the following steps: S31: clustering the cross-interference data according to the type of gas sensor to obtain several types of cross-interference data; S32: extracting the maximum value and the minimum value in each type of cross-interference data, and calculating the absolute difference between the maximum value and the minimum value; and calculating the average value and the standard deviation value of each type of cross-interference data; S33: Dividing the difference between each cross-interference data of the same type and the minimum value by the absolute difference to obtain first normalized data; and dividing the difference between each cross-interference data of the same type and the average value by the standard deviation to obtain second normalized data; S34: calculating the average of the first normalized data and the second normalized data to obtain standard normalized data of each cross-interference data; S35: Divide all standard normalized data into training set, validation set and test set according to the ratio of 7:2:1; S36: setting the number of input layer nodes of the BP neural network model according to the total number of gas sensors, selecting X hidden layers and activation functions, setting the number of output layer nodes according to the number of gas sensor types, and then constructing the BP neural network model; S37: Initialize the weights and thresholds of the BP neural network model.

5. The method for solving the cross-interference of multiple gas sensors according to claim 1, characterized in that: The step S4 includes the following steps: S41: randomly generate N sparrows to form an initial sparrow population, and set the sparrow population size, warning value, number of iterations and solution accuracy; S42: Initialize the initial sparrow population using Tent chaotic mapping and divide the initial sparrow population into discoverers, joiners and guards; S43: In each iteration, the finder is responsible for finding food sources and providing foraging information to the initial sparrow population; S44: The joiner uses the Levy flight strategy to forage based on the foraging information of the discoverer; S45: During the foraging process of discoverers and joiners, the vigilants monitor abnormal behaviors in the initial sparrow population and warn the initial sparrow population when danger is detected; S46: Calculate the fitness of each sparrow in the initial sparrow population, and sort all fitnesses from low to high, and then update the positions of the discoverer, joiner and guard; S47: Use the Cauchy-Gauss mutation strategy to mutate the sparrow individuals with low fitness in the initial sparrow population, compare the positions before and after the mutation, and select the better position to be substituted into the next iteration; S48: During the iterative training process, the number of iterations or the solution accuracy is continuously judged: if the number of iterations and / or the solution accuracy reaches the set value, the optimal sparrow individual information and characteristic network parameters are output; if the number of iterations and the solution accuracy do not reach the set value, the steps S42 to S48 are looped to continue iteration.

6. The method for solving cross-interference of multiple gas sensors according to claim 5, characterized in that: The function expression of the Tent chaotic map is: Among them, k represents the number of mappings, Z k represents the value of the k-th mapping function, β is the Tent chaos parameter, and β is 0.5; The functional expression of the Cauchy-Gauss mutation strategy is: in, represents the position of the best sparrow individual after mutation in the current iteration, t represents the number of current iterations, represents the position of the best sparrow individual in the current iteration, σ 2 represents the standard deviation of the Cauchy-Gaussian mutation strategy, Cauchy(0,σ 2 ) represents a random variable with Cauchy distribution, Gauss(0,σ 2 ) represents a random variable with Gaussian distribution, λ1,λ2 represent adaptive dynamic parameters with the number of iterations, f() represents the Cauchy-Gaussian mutation strategy function, T max represents the maximum number of iterations, X best represents the optimal position of the sparrow individual, X i Represents the position of the i-th sparrow.

7. The method for solving cross-interference of multiple gas sensors according to claim 5, characterized in that: The position update function of the discoverer is: in, represents the position of the i-th discoverer in the j-th dimension in the t-th iteration, α represents a random number in the interval [0,1], iter max represents the maximum number of iterations, Q represents a random number that obeys a normal distribution, L represents the identity matrix, R2 represents a random number in the interval [0,1], and ST represents a random number in the interval [0.5,1].

8. The method for solving cross-interference of multiple gas sensors according to claim 5, characterized in that: In step S44, the improved position function of the joiner is: c = m / u 1 / β (8) in, represents the position of the wth joiner in the tth iteration, n represents the total number of discoverers, A + represents the random matrix, L represents the flight step length, γ represents the Levy flight strategy factor, μ and υ represent the normal distribution parameters, Γ is the gamma function, and represents the variance of the normal distribution, Indicates the position of the b-th joiner at the t+1-th iteration.

9. The method for solving cross-interference of multiple gas sensors according to claim 5, characterized in that: The position update formula of the sentinel is: Among them, K represents a random number in the interval [-1,1], ε represents a very small constant, and f i represents the fitness of the current sparrow individual, f g represents the optimal fitness, f w Indicates the worst fitness.

10. The method for solving cross-interference of multiple gas sensors according to claim 1, characterized in that: The step S5 includes the following steps: S51: The input layer of the BP neural network model receives each training sample in the training set and extracts feature information of the training sample; S52: The hidden layer uses the activation function and the hidden bias to perform several iterative training on the extracted feature information, and then outputs the feature weight matrix; the activation function includes the MISH activation function and the RELU activation function; S53: The output layer calculates the difference between the verification value and the actual value of the feature weight matrix using the loss function, the hidden weight, the output bias and the verification set; the loss function includes a mean square error function or a cross entropy function; S54: Utilize the loss function and gradient descent algorithm to continuously update all weights and biases in the BP neural network model, and then obtain the comprehensive weight matrix to be evaluated.

Citation Information

Patent Citations

  • Active power distribution network voltage control method based on improved sparrow search algorithm

    CN118249425A

  • Motion optimization method and system of mechanical arm based on improved sparrow algorithm

    CN118305805A

Cited By

  • Pressure sore risk prediction method and intelligent pressure sore prevention mattress

    CN120713477A

  • A lithium battery thermal runaway multi-modal monitoring module independent of a battery management system outer package and a gas concentration inversion method

    CN122860154A