Array sensor adaptive parameter detection method based on deep learning and mask operator
By adopting an adaptive parameter detection method for array sensors based on deep learning and the MASK operator, the problems of long detection time and low accuracy of traditional gas sensors are solved, achieving efficient and accurate gas concentration measurement and sensor status diagnosis, and reducing system complexity and cost.
Patent Information
- Application Number
- CN202310311010.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2043-03-28
AI Technical Summary
Traditional gas sensor detection suffers from problems such as long detection time, significant influence from historical concentrations, complex data processing, and low detection accuracy. Furthermore, array sensor systems are highly complex, costly, and difficult to guarantee stability.
An adaptive parameter detection method for array sensors based on deep learning and the MASK operator is adopted. The MASK operator is used to adaptively process the sensor input time series, and the deep neural network algorithm is combined to improve the computational efficiency and measurement accuracy. The Transformer model and CNN are used for feature extraction and diagnosis.
This improves the robustness and stability of the detection system, enhances the accuracy of sensor condition diagnosis and target gas concentration detection, and reduces system complexity and cost.
Smart Images

Figure CN116467671B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent sensor detection technology, specifically relating to an adaptive parameter detection method for array sensors based on deep learning and the MASK operator. Background Technology
[0002] In a sealed environment where a certain amount of gas has been injected, a gas sensor is used to detect the gas concentration in the environment. Gas sensors generally involve a preheating process. The gas-sensitive element of the sensor undergoes a complete chemical or physical reaction with the gas, resulting in a change in its own properties. Detection circuits are designed based on the characteristics of different gas-sensitive elements to ultimately convert the physical or chemical signal into an electrical signal. From these reaction characteristics, it can be concluded that gas sensors have a slow measurement cycle and face significant challenges in ensuring accuracy.
[0003] Traditional gas sensor measurement methods utilize a lower-level computer to collect the amplitude of the electrical signal emitted by the gas sensor circuit, and then set the stationary or peak value in the amplitude time series as the current ambient gas concentration value. For example... Figure 1 As shown, the changes in conductivity amplitude caused by SOF2 and SO2F2 gas concentrations measured by the carbon nanotube gas sensor reveal an irregular peak variation throughout the reaction process. This experiment lasted 85 hours. Traditional methods for collecting time-series amplitude peaks can only reduce errors by infinitely extending the experimental period, which suffers from time consumption and experimental result bias.
[0004] This paper proposes a method for measuring peak amplitude based on mathematical characteristics such as time-series derivatives, building upon traditional measurement schemes. This method estimates the actual gas concentration by analyzing the first derivative value of the amplitude-time-series curve. It changes the original method of peak amplitude estimation by using the measured velocity value to further estimate the actual value. This method shortens the experimental cycle to some extent, but it discards the integrity of the time-series curve and cannot accurately estimate continuously changing time-series acceleration curves. Furthermore, during dynamic measurements, gas concentrations are highly susceptible to the influence of historical concentration conditions. When the test gas is injected into a closed system with existing gas, the process derivative of the concentration measurement curve is affected by various factors, potentially leading to different process derivatives for the same concentration or similar process derivatives but mismatched actual concentrations. Therefore, this method still has certain problems and limitations.
[0005] Traditional array sensor fusion processing schemes typically employ an array of multiple individual sensors. By fusing the signals acquired by each sensor in the array, more accurate measurement results are obtained. Specifically, the fusion processing scheme usually includes five steps: data acquisition, data preprocessing, feature extraction, feature fusion, and classification / recognition. The algorithm is simple, and the measurement results are relatively reliable. However, its system complexity is high. The need to use multiple sensors and perform multiple data processing steps leads to complex hardware and software; the cost is high due to the high cost of multiple sensors and processors, coupled with the high system complexity, resulting in a high overall system cost; signal synchronization is difficult, as multiple sensors need to operate synchronously to avoid data misalignment or delay, increasing engineering design difficulty and cost; and stability is difficult to guarantee because multiple sensors and processors have potential failure points, making system stability difficult to guarantee and increasing maintenance costs. Summary of the Invention
[0006] To overcome the problems of long detection time, high susceptibility to historical factors, complex data processing, and low detection accuracy in the current field of gas sensor detection, this invention provides an adaptive parameter detection method for array sensors based on deep learning and the MASK operator. This detection method can adaptively and dynamically process the input time series of array sensors through the MASK operator, and can make full use of sensor data under temporary disabling conditions. Combined with deep neural network algorithms, it can further improve computational efficiency and measurement accuracy.
[0007] This invention is achieved through the following technical solution:
[0008] An adaptive parameter detection method for array sensors based on deep learning and the MASK operator includes the following steps:
[0009] Step 1: Dataset preparation and preprocessing;
[0010] Existing data of the gas to be tested detected by the same type of array sensor are collected, and the data is preprocessed. The preprocessing includes cleaning, noise reduction and standardization. After preprocessing, gas concentration sequence data with time dimension is obtained.
[0011] Step 2: Construction of a neural network model based on deep learning and the MASK operator;
[0012] The neural network model includes a data processing module, a sequence processing module, and a fusion processing module;
[0013] In the data processing module, the MASK operator is used to augment the dataset, and the dataset is split using ten-fold cross-validation. In the sequence processing module, the hyperparameters of the encoder and decoder modules in the sequence neural network model (Transformer) are adjusted. The optimal combination of hyperparameters is evaluated using optimization functions such as grid search, with reference to mean squared error (MSE) and mean absolute error (MAE), to estimate the gas concentration corresponding to each sensor sequence. In the fusion processing module, a convolutional neural network (CNN) is used to automatically extract features from the sequence-processed data, thereby realizing the detection and diagnosis of the sensors.
[0014] Step 3: Training the neural network model based on deep learning and the MASK operator;
[0015] Step 4: Use the trained neural network model to detect the actual concentration value and the status of the array sensor devices.
[0016] Further, in step one, the data includes the sequence values of concentration and time detected by the array sensor. The sequence values, including concentration and time, are converted into a format suitable for the Transformer model for model training. This process specifically includes the following:
[0017] A1. Discretize the time series: Discretize continuous time series data into data with fixed 10-minute time intervals;
[0018] A 2. Sequence standardization: The discretized time series is normalized to the mean so that they have similar statistical characteristics;
[0019] A3. Constructing the input sequence: Transform the mean-normalized time series data into an input sequence, that is, input a data segment of a fixed time length as a sequence into the Transformer neural network model;
[0020] A4. Batch processing and padding: For cases where the input sequence length is insufficient, padding is performed to ensure the consistency of the input sequence length.
[0021] Furthermore, in step two, the MASK operator operation in the data processing module can expand the dataset and increase the number of samples. Specifically, the MASK operator is designed according to the sensor array form, and the generated MASK operator mask is used to cover the sequence data obtained after preprocessing in step one, resulting in a series of new masked sample sequence data. Finally, the generated new sample sequence data is used as the dataset for model training and evaluation.
[0022] Furthermore, in step two, the dataset is split using a ten-fold cross-validation method, and the model is trained and evaluated. The specific steps are as follows:
[0023] B1. Divide the original dataset into 10 non-overlapping subsets;
[0024] B2. For each subset, use that subset as the test set and the remaining 9 subsets as the training set to train and evaluate the model.
[0025] B3. Repeat step B2 a total of 10 times until each subset is used as a test set;
[0026] B4. For each partition, record the model's performance metrics on the test set;
[0027] B5. Average the performance metrics of all 10 test sets to obtain the final performance metrics of the model.
[0028] Further, in step two, the sequence processing module uses the Transformer neural network's Encoder-Decoder model and embedding layer to perform time-series processing on the data; wherein, the embedding layer is used to convert the data collected by the sensor into a vector form that the neural network can process; the Encoder module is used to convert the input sequence into a set of hidden representations; the Decoder module is used to generate the output of the current time step based on the hidden representations provided by the Encoder module and the previously generated outputs;
[0029] The embedding layer consists of a position encoder and an input embedding. The position encoder adds position information to the input data at each time point so that the model can learn the order of the time series. The input embedding converts the input data at each time point into a fixed-dimensional vector representation so that it can be processed by the subsequent attention mechanism, encoder and decoder.
[0030] The Encoder module includes:
[0031] Multi-Head Attention is used to weight and converge the input sequence so that the Encoder module can better utilize the information in the input sequence.
[0032] Position-wise Feed-Forward Network: Used to weight and converge the outputs of the multi-head attention mechanism described above in order to generate a set of hidden representations.
[0033] The Decoder module includes:
[0034] Masked Multi-Head Attention is a self-attention mechanism used to compute the relationship between the output at the current time step and the previously generated outputs, and to interact with the hidden representation provided by the Encoder module and the output at the current time step.
[0035] Multi-Head Attention is used to weight and converge the hidden representations provided by the Encoder module so that the Decoder module can better utilize the information of the input sequence.
[0036] The Position-wise Feed-Forward Network is used to weight and converge the outputs of the two attention mechanisms mentioned above in order to generate the output of the current time step;
[0037] Each component of the Encoder and Decoder modules is connected by a Layer Normalization module to improve signal transmission and prevent gradient vanishing during model training.
[0038] Furthermore, the second step, sequence processing module, specifically includes the following aspects in building the model:
[0039] C1: Sets the hyperparameter range;
[0040] First, determine the input sequence length. Based on the data sampling frequency and application scenario, select data points from 0 to 24 hours as an input sequence length to comprehensively record changes in environmental gas concentration. Then, determine the batch size and the number of hidden layers. Set the batch size to 32, 64, or 128. Determine the number of hidden layers to 5-6. Finally, determine the number of heads to 6-8.
[0041] C2: Grid search;
[0042] The grid search method is used to search for the optimal combination of hyperparameters within the hyperparameter range;
[0043] C3: Random search;
[0044] The optimal hyperparameter combination is randomly searched within the range of hyperparameters using a random search method.
[0045] C4: Bayesian optimization;
[0046] The Bayesian optimization method is used to find the optimal combination of hyperparameters within the hyperparameter range;
[0047] C5: Evaluate model performance;
[0048] Transformer neural network models were trained using the optimal hyperparameter combinations obtained by the above methods, and the optimal hyperparameter combinations were evaluated on the test set using mean squared error (MSE) and mean absolute error (MAE). The MSE and MAE corresponding to the optimal parameter model were used to characterize the model performance.
[0049] Furthermore, in step two, the fusion processing module uses a convolutional neural network (CNN) to extract features from the gas concentrations corresponding to each sensor sequence estimated by the sequence processing module, thereby enabling the detection and diagnosis of damaged sensors and outputting gas concentration values and array sensor status.
[0050] Furthermore, in step two, the implementation of the fusion processing module includes the following steps:
[0051] D1: Input the sensor array data into the CNN network;
[0052] In the input layer of the CNN network, the sensor array data is arranged according to the position of the sensor array, and the reading of each sensor in the sensor array is used as one input channel.
[0053] D2: Uses multiple convolutional and pooling layers to extract features from the input data;
[0054] In the convolutional layer, the input data is filtered through convolution operations to extract spatial features from the data; in the pooling layer, the convolution output is downsampled to reduce the size of the feature map while retaining key feature information.
[0055] D3: Use fully connected layers to classify features;
[0056] In the fully connected layer, the feature vector is expanded into a one-dimensional vector, and through a series of fully connected operations, the features are mapped to the output space to achieve classification of sensor array data;
[0057] D4: Based on the classification results, output the gas concentration value and the status of the array sensor devices;
[0058] Specifically, the gas concentration data is classified according to the classification results to determine which category it belongs to, thereby obtaining the status of the corresponding array sensor device.
[0059] Furthermore, step three is detailed below:
[0060] An existing dataset of the target gas array sensor is selected, and the parameter values of this dataset and their corresponding time values are used as the analytical features of the neural network, i.e., Q. i =[t i v i ] T Qi t represents the data parameters sent by the lower-level machine at a certain moment. i v i These are the corresponding gas concentrations and time values. The training set is imported into the neural network via embedding. After a series of interleaving, normalization, attention mechanism, MASK operator masking, and fusion algorithm training processes, the parameter relationship between the gas array sensor data sequence and the actual gas concentration and array sensor device state is obtained, that is, the model training is completed.
[0061] Compared with the prior art, the advantages of the present invention are as follows:
[0062] This invention adds a weight template MASK to the input data. The MASK can be used or masked with reduced weights for any number of sensor response data. This allows the trained model to still give the most accurate prediction results based on the normally functioning devices when some devices have numerical deviations or anomalies, thereby improving the robustness, stability and reliability of the entire detection system.
[0063] This invention fully utilizes the redundant design of devices on the sensor array to achieve mutual verification of the working status between devices and suppression of test data errors, thereby improving the accuracy of sensor working status diagnosis.
[0064] This invention incorporates the training dataset into the model trained by the MASK operator, which better subdivides the fault source solution for evaluating changes in test parameters. On the one hand, it improves the accuracy of fault source analysis, and on the other hand, it incorporates suspicious parameters into the calculation according to weights, thereby improving the accuracy of target gas concentration detection. Attached Figure Description
[0065] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the accompanying drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. In all the drawings, similar elements or parts are generally identified by similar reference numerals. In the drawings, the elements or parts are not necessarily drawn to scale.
[0066] Figure 1 : Response curve of gas sensor to 1 μL SO2F2;
[0067] Figure 2 : The overall architecture diagram of sequence processing based on the transformer model in this invention;
[0068] Figure 3 The present invention describes the sensor test time and voltage change curves;
[0069] Figure 4 : A two-dimensional diagram of sequence information in this invention;
[0070] Figure 5 : A graph showing the composition of the MASK operator subset sumk in this invention;
[0071] Figure 6 : Composition diagram of the MASK operator in this invention. Detailed Implementation
[0072] To clearly and completely describe the technical solution and its specific working process of the present invention, the specific embodiments of the present invention are as follows, in conjunction with the accompanying drawings:
[0073] Example 1
[0074] This embodiment provides an adaptive parameter detection method for array sensors based on deep learning and the MASK operator, which specifically includes the following steps:
[0075] Step 1: Dataset preparation and preprocessing;
[0076] Existing data of the gas to be tested detected by the same type of array sensor are collected, and the data is preprocessed. The preprocessing includes cleaning, noise reduction and standardization. After preprocessing, gas concentration sequence data with time dimension is obtained.
[0077] like Figure 2 The diagram shows the overall architecture for sequence processing based on the Transformer model. It includes three end-point array gas sensors, a lower-level machine module, a mask module, and a deep learning module. The data includes the sequence values of concentration and time detected by the array sensors. The sequence values, including concentration and time, are converted into a format suitable for the Transformer model for training. Specifically, this includes the following:
[0078] A1. Discretize the time series: Discretize continuous time series data into data with fixed 10-minute time intervals;
[0079] A 2. Sequence standardization: The discretized time series is normalized to the mean so that they have similar statistical characteristics;
[0080] A3. Constructing the input sequence: Transform the mean-normalized time series data into an input sequence, that is, input a data segment of a fixed time length as a sequence into the Transformer neural network model;
[0081] A4. Batch processing and padding: For cases where the input sequence length is insufficient, padding is performed to ensure the consistency of the input sequence length.
[0082] Step 2: Construction of a neural network model based on deep learning and the MASK operator;
[0083] In the data processing module, the MASK operator is used to augment the dataset, and the dataset is split using ten-fold cross-validation. In the sequence processing module, the hyperparameters of the encoder and decoder modules in the sequence neural network model (Transformer) are adjusted. The optimal combination of hyperparameters is evaluated using optimization functions such as grid search, with reference to mean squared error (MSE) and mean absolute error (MAE), to estimate the gas concentration corresponding to each sensor sequence. In the fusion processing module, a convolutional neural network (CNN) is used to automatically extract features from the sequence-processed data, thereby realizing the detection and diagnosis of the sensors.
[0084] In step two, within the data processing module, the MASK operator effectively expands the dataset and increases the number of samples. This operator is a data augmentation method based on the state changes of array devices, implemented in the form of a mask. It achieves sample diversity by adding the MASK operator to the dataset. Specifically, as shown in the attached... Figure 6 As shown, a MASK operator is designed based on a 1×3 sensor array. The generated MASK operator mask is used to cover the preprocessed sequence data obtained in step one, resulting in a series of new masked sample sequence data. Finally, the generated new sample sequence data is used as the dataset for model training and evaluation. In this embodiment, the time series data of the array sensor undergoes MASK preprocessing to limit the computational range of deep learning, ensuring that the entire network operates efficiently and effectively, ultimately outputting the environmental target gas concentration value and fault source information.
[0085] like Figure 3 and Figure 4 As shown, the lower-level computer sends electrical signals as two-dimensional time series information. Point Q in the figure represents the actual gas concentration value. The two-dimensional information contained in this vector corresponds to the t and v values, respectively. The former is the actual environmental concentration value, and the latter is the time value at which the lower-level computer sends this value. The three sets of two-dimensional time series from the array sensor are input into the MASK module for processing.
[0086] In step two, the dataset is split using a 10-fold cross-validation method, and the model is trained and evaluated. The specific steps are as follows:
[0087] B1. Divide the original dataset into 10 non-overlapping subsets;
[0088] B2. For each subset, use that subset as the test set and the remaining 9 subsets as the training set to train and evaluate the model.
[0089] B3. Repeat step B2 a total of 10 times until each subset is used as a test set;
[0090] B4. For each partition, record the model's performance metrics on the test set, such as accuracy, precision, and recall.
[0091] B5. Average the performance metrics of all 10 test sets to obtain the final performance metrics of the model.
[0092] In the sequence processing module described in step two, the Transformer neural network's Encoder-Decoder model and embedding layer are used to perform time-series processing on the data. The embedding layer converts the data collected by the sensor into a vector form that the neural network can process. The Encoder module converts the input sequence into a set of hidden representations. The Decoder module generates the output for the current time step based on the hidden representations provided by the Encoder module and the previously generated outputs.
[0093] The embedding layer consists of a position encoder and an input embedding. The position encoder adds position information to the input data at each time point so that the model can learn the order of the time series. The input embedding converts the input data at each time point into a fixed-dimensional vector representation so that it can be processed by the subsequent attention mechanism, encoder and decoder.
[0094] The Encoder module includes:
[0095] Multi-Head Attention is used to weight and converge the input sequence so that the Encoder module can better utilize the information in the input sequence.
[0096] Position-wise Feed-Forward Network: Used to weight and converge the outputs of the multi-head attention mechanism described above in order to generate a set of hidden representations.
[0097] The Decoder module includes:
[0098] Masked Multi-Head Attention is a self-attention mechanism used to compute the relationship between the output at the current time step and the previously generated outputs, and to interact with the hidden representation provided by the Encoder module and the output at the current time step.
[0099] Multi-Head Attention is used to weight and converge the hidden representations provided by the Encoder module so that the Decoder module can better utilize the information of the input sequence.
[0100] The Position-wise Feed-Forward Network is used to weight and converge the outputs of the two attention mechanisms mentioned above in order to generate the output of the current time step;
[0101] Each component of the Encoder and Decoder modules is connected by a Layer Normalization module to improve signal transmission and prevent gradient vanishing during model training.
[0102] Step two, the sequence processing module, specifically includes the following aspects in building the model:
[0103] C1: Sets the hyperparameter range;
[0104] First, determine the input sequence length. Based on the data sampling frequency and application scenario, select data points from 0 to 24 hours as an input sequence length to comprehensively record changes in environmental gas concentration. Then, determine the batch size and the number of hidden layers. Set the batch size to 32, 64, or 128. Determine the number of hidden layers to 5-6. Finally, determine the number of heads to 6-8.
[0105] C2: Grid search;
[0106] The grid search method is used to search for the optimal combination of hyperparameters within the hyperparameter range;
[0107] C3: Random search;
[0108] The optimal hyperparameter combination is randomly searched within the range of hyperparameters using a random search method.
[0109] C4: Bayesian optimization;
[0110] The Bayesian optimization method is used to find the optimal combination of hyperparameters within the hyperparameter range;
[0111] C5: Evaluate model performance;
[0112] Transformer neural network models were trained using the optimal hyperparameter combinations obtained by the above methods, and the optimal hyperparameter combinations were evaluated on the test set using mean squared error (MSE) and mean absolute error (MAE). The MSE and MAE corresponding to the optimal parameter model were used to characterize the model performance.
[0113] In step two, the fusion processing module uses a convolutional neural network (CNN) to extract features from the gas concentrations of each sensor sequence estimated by the sequence processing module, thereby enabling the detection and diagnosis of damaged sensors and outputting gas concentration values and the status of the array sensor devices.
[0114] Step two, the implementation of the fusion processing module includes the following steps:
[0115] D1: Input the sensor array data into the CNN network;
[0116] In the input layer of the CNN network, the sensor array data is arranged according to the position of the sensor array, and the reading of each sensor in the sensor array is used as one input channel.
[0117] D2: Uses multiple convolutional and pooling layers to extract features from the input data;
[0118] In the convolutional layer, the input data is filtered through convolution operations to extract spatial features from the data; in the pooling layer, the convolution output is downsampled to reduce the size of the feature map while retaining key feature information.
[0119] D3: Use fully connected layers to classify features;
[0120] In the fully connected layer, the feature vector is expanded into a one-dimensional vector, and through a series of fully connected operations, the features are mapped to the output space to achieve classification of sensor array data;
[0121] D4: Based on the classification results, output the gas concentration value and the status of the array sensor devices;
[0122] Specifically, the gas concentration data is classified according to the classification results to determine which category it belongs to, thereby obtaining the status of the corresponding array sensor device.
[0123] Step 3: Training the neural network model based on deep learning and the MASK operator;
[0124] An existing dataset of the target gas array sensor is selected, and the parameter values of this dataset and their corresponding time values are used as the analytical features of the neural network, i.e., Q. i =[t i v i ] T Q i t represents the data parameters sent by the lower-level machine at a certain moment. i v i These are the corresponding gas concentrations and time values. The training set is imported into the neural network via embedding. After a series of interleaving, normalization, attention mechanism, MASK operator masking, and fusion algorithm training processes, the parameter relationship between the gas array sensor data sequence and the actual gas concentration and array sensor device state is obtained, that is, the model training is completed.
[0125] In this embodiment, as Figure 5As shown, taking a commonly used array mode consisting of three gas sensors as an example, the MASK operator module subset is composed of a 3x8 matrix formed by eight column vectors: K1, K2, K3, K4, K5, K6, K7, and K8. The binary value in each column vector represents the state of the array sensor, for example, [1 1 0] in column vector K2. T This indicates that of the three gas sensors, the first and second sensors are functioning normally, while the third sensor is malfunctioning. Furthermore, based on the number of gas sensors in the array, `sumk` is weighted and concatenated to improve learning accuracy. For example... Figure 6 As shown, for an array consisting of three gas sensors, a six-part gradient splicing matrix of sumk is defined. The model trained by incorporating the training dataset into the MASK operator can better refine the fault source calculation for evaluating changes in test parameters. This improves the accuracy of fault source analysis and, by incorporating suspicious parameters according to weights, enhances the accuracy of target gas concentration detection.
[0126] Step 4: Use the trained neural network model to detect the actual concentration value and the status of the array sensor devices; the final output values y1 and y2 represent the current environmental target gas concentration value and the fault source location parameter, respectively.
[0127] In the gas array sensor test experiment, the gas-sensitive element serves as the gas sensing element. The lower-level computer converts the changes in the physical or chemical characteristic parameters of the gas-sensitive element into electrical signals and sends them to the upper-level computer. The PC imports the obtained small amount of time-series curve parameters as the test dataset into the model. The gas concentration parameters and fault source status information output by the model are the estimated values of the deep neural network combined with the MASK operator method used in this invention. This process, through calculations on a large training set, makes full use of rich time-series information data, and can obtain actual environmental parameter values and gas concentration values under experimental conditions with a short time and a small amount of data.
[0128] The preferred embodiments of the present invention have been described in detail above with reference to the accompanying drawings. However, the present invention is not limited to the specific details of the above embodiments. Within the scope of the technical concept of the present invention, various simple modifications can be made to the technical solution of the present invention, and these simple modifications all fall within the protection scope of the present invention.
[0129] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present invention will not describe the various possible combinations separately.
[0130] Furthermore, various different embodiments of the present invention can be combined in any way, as long as they do not violate the spirit of the present invention, they should also be regarded as the content disclosed by the present invention.
Claims
1. An adaptive parameter detection method for array sensors based on deep learning and the MASK operator, characterized in that, Specifically, the steps include the following: Step 1: Dataset preparation and preprocessing; Existing data of the gas to be tested detected by the same type of array sensor are collected, and the data is preprocessed. The preprocessing includes cleaning, noise reduction and standardization. After preprocessing, gas concentration sequence data with time dimension is obtained. Step 2: Construction of a neural network model based on deep learning and the MASK operator; In the data processing module, the MASK operator is used to augment the dataset, and the dataset is split using ten-fold cross-validation. In the sequence processing module, the hyperparameters of the encoder and decoder modules in the sequence neural network model are adjusted, and the optimal hyperparameter combination is evaluated using a grid search optimization function with reference to mean squared error and mean absolute error to estimate the gas concentration corresponding to each sensor sequence. In the fusion processing module, a convolutional neural network is used to automatically extract features from the sequence-processed data, thereby realizing the detection and diagnosis of the sensors. Step 3: Training the neural network model based on deep learning and the MASK operator; Step 4: Use the trained neural network model to detect the actual concentration value and the status of the array sensor devices.
2. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, In step one, the data includes the concentration and time sequence values detected by the array sensor. The concentration and time sequence values from the sensor are converted into a format suitable for the Transformer model, thus enabling model training. This specifically includes the following: A1. Discretize the time series: Discretize continuous time series data into data with fixed 10-minute time intervals; A 2. Sequence standardization: The discretized time series is normalized to the mean so that they have similar statistical characteristics; A3. Constructing the input sequence: Transform the mean-normalized time series data into an input sequence, that is, input a data segment of a fixed time length as a sequence into the Transformer neural network model; A4. Batch processing and padding: For cases where the input sequence length is insufficient, padding is performed to ensure the consistency of the input sequence length.
3. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, In step two, the MASK operator operation in the data processing module can expand the dataset and increase the number of samples. Specifically, the MASK operator is designed according to the sensor array form, and the generated MASK operator mask is used to cover the sequence data obtained after preprocessing in step one, resulting in a series of new masked sample sequence data. Finally, the generated new sample sequence data is used as the dataset for model training and evaluation.
4. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, In step two, the dataset is split using a 10-fold cross-validation method, and the model is trained and evaluated. The specific steps are as follows: B1. Divide the original dataset into 10 non-overlapping subsets; B2. For each subset, use that subset as the test set and the remaining 9 subsets as the training set to train and evaluate the model. B3. Repeat step B2 a total of 10 times until each subset is used as a test set; B4. For each partition, record the model's performance metrics on the test set; B5. Average the performance metrics of all 10 test sets to obtain the final performance metrics of the model.
5. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, In step two, the sequence processing module uses the Transformer neural network's Encoder-Decoder model and embedding layer to perform time-series processing on the data. The embedding layer converts the data collected by the sensor into a vector form that the neural network can process. The Encoder module converts the input sequence into a set of hidden representations. The Decoder module generates the output for the current time step based on the hidden representations provided by the Encoder module and the previously generated outputs. The embedding layer consists of a position encoder and an input embedding. The position encoder adds position information to the input data at each time point so that the model can learn the order of the time series. The input embedding converts the input data at each time point into a fixed-dimensional vector representation so that it can be processed by the subsequent attention mechanism, encoder and decoder. The Encoder module includes: Multi-Head Attention is used to weight and converge the input sequence so that the Encoder module can better utilize the information in the input sequence. Position-wise Feed-Forward Network: Used to weight and converge the outputs of the multi-head attention mechanism described above in order to generate a set of hidden representations; The Decoder module includes: Masked Multi-Head Attention is a self-attention mechanism used to compute the relationship between the output at the current time step and the previously generated outputs, and to interact with the hidden representation provided by the Encoder module and the output at the current time step. Multi-Head Attention is used to weight and converge the hidden representations provided by the Encoder module so that the Decoder module can better utilize the information of the input sequence. The Position-wise Feed-Forward Network is used to weight and converge the outputs of the two attention mechanisms mentioned above in order to generate the output of the current time step; Each component of the Encoder and Decoder modules is connected by a Layer Normalization module to improve signal transmission and prevent gradient vanishing during model training.
6. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, Step two, the sequence processing module, specifically includes the following aspects in building the model: C1: Sets the hyperparameter range; First, determine the input sequence length. Based on the data sampling frequency and application scenario, select data points from 0 to 24 hours as an input sequence length to comprehensively record changes in environmental gas concentration. Then, determine the batch size and the number of hidden layers. Set the batch size to 32, 64, or 128. Determine the number of hidden layers to 5-6. Finally, determine the number of heads to 6-8. C2: Grid search; The grid search method is used to search for the optimal combination of hyperparameters within the hyperparameter range; C3: Random search; The optimal hyperparameter combination is randomly searched within the range of hyperparameters using a random search method. C4: Bayesian optimization; The Bayesian optimization method is used to find the optimal combination of hyperparameters within the hyperparameter range; C5: Evaluate model performance; Transformer neural network models were trained using the optimal hyperparameter combinations obtained by the above methods. The optimal hyperparameter combinations were evaluated on the test set using mean squared error and mean absolute error. The MSE and MAE corresponding to the optimal parameter models were used to characterize the model performance.
7. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, In step two, the fusion processing module uses a convolutional neural network to extract features from the gas concentrations of each sensor sequence estimated by the sequence processing module, thereby enabling the detection and diagnosis of damaged sensors and outputting gas concentration values and the status of the array sensor devices.
8. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, Step two, the implementation of the fusion processing module includes the following steps: D1: Input the sensor array data into the CNN network; In the input layer of the CNN network, the sensor array data is arranged according to the position of the sensor array, and the reading of each sensor in the sensor array is used as one input channel. D2: Uses multiple convolutional and pooling layers to extract features from the input data; In the convolutional layer, the input data is filtered through convolution operations to extract spatial features from the data; in the pooling layer, the convolution output is downsampled to reduce the size of the feature map while retaining key feature information. D3: Use fully connected layers to classify features; In the fully connected layer, the feature vector is expanded into a one-dimensional vector, and through a series of fully connected operations, the features are mapped to the output space to achieve classification of sensor array data; D4: Based on the classification results, output the gas concentration value and the status of the array sensor devices; Specifically, the gas concentration data is classified according to the classification results to determine which category it belongs to, thereby obtaining the status of the corresponding array sensor device.
9. The adaptive parameter detection method for array sensors based on deep learning and the MASK operator as described in claim 1, characterized in that, Step three is as follows: An existing dataset of the target gas array sensor is selected, and the parameter values of this dataset and their corresponding time values are used as the analytical features of the neural network, i.e., Q. i =[t i v i ] T Q i t represents the data parameters sent by the lower-level machine at a certain moment. i v i These are the corresponding gas concentrations and time values. The training set is imported into the neural network via embedding. After a series of interleaving, normalization, attention mechanism, MASK operator masking, and fusion algorithm training processes, the parameter relationship between the gas array sensor data sequence and the actual gas concentration and array sensor device state is obtained, that is, the model training is completed.
Citation Information
Patent Citations
Drainage pipeline defect detection method and system based on deep learning
CN113469177A
Gas sensor and gas detection system
CN115015321A