A sensor gas concentration detection method based on a deep learning transformer neural network
By using a gas concentration detection method based on Transformer neural networks, the problems of long detection time and low accuracy of traditional gas sensors are solved, achieving rapid and accurate multi-gas detection and environmental adaptability, and providing real-time monitoring capabilities.
Patent Information
- Application Number
- CN202310311018.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2043-03-28
AI Technical Summary
Traditional gas sensor detection methods suffer from problems such as long detection time, significant historical influence, complex data processing, inaccurate experimental results, and low detection precision. Furthermore, they are difficult to handle various gases and adapt to complex environments.
A gas concentration detection method based on deep learning Transformer neural network is adopted. Through data preprocessing, Transformer model construction and training, and time-series processing using Encoder-Decoder architecture, fast and accurate gas concentration detection is achieved.
It improves the precision and accuracy of gas concentration detection, has the versatility to handle multiple gases, is robust to adapt to different environments, and enables real-time monitoring and online detection.
Smart Images

Figure CN116304912B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of intelligent sensor detection technology, specifically relating to a sensor gas concentration detection method based on deep learning transformer neural network. 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 have a preheating step. The gas-sensitive element of the gas sensor undergoes a full chemical or physical reaction with the gas, resulting in a change in its own properties. By designing detection circuits based on the characteristics of different gas-sensitive elements, the physical or chemical signal is ultimately converted into an electrical signal. From the above reaction characteristics, it can be concluded that the measurement cycle of gas sensors is slow, and ensuring accuracy is very difficult.
[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. Summary of the Invention
[0005] To overcome the problems of long detection time, high susceptibility to historical factors, complex data processing, inaccurate experimental results, and low detection accuracy in the current field of gas sensor detection, this invention provides a sensor gas concentration detection method based on deep learning transformer neural network. This algorithm enables gas sensors to quickly detect gas concentrations in the environment under conditions of rapid operation and small sample size by using a model trained on an existing dataset.
[0006] This invention is achieved through the following technical solution:
[0007] A sensor gas concentration detection method based on deep learning transformer neural network specifically includes the following steps:
[0008] Step 1: Dataset preparation and preprocessing;
[0009] Data from a gas sensor is collected and preprocessed, including cleaning, noise reduction, and standardization, to obtain a gas concentration sequence with a time dimension.
[0010] Step 2: Constructing the Transformer neural network model;
[0011] The dataset is split and fed into the embedding layer. The hyperparameters of the encoder and decoder modules in the model 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) metrics. The best MSE and MAE are used to characterize the model performance.
[0012] Step 3: Training the Transformer neural network model;
[0013] Step 4: Use the trained Transformer neural network model to estimate the actual environmental parameter values and gas concentration values.
[0014] Furthermore, in step one, the data includes gas concentration and time sequence values. The sequence values from the sensor, including concentration and time, are converted into a format suitable for the Transformer model, thereby enabling model training. This specifically includes the following:
[0015] A1. Discretize the time series: Discretize continuous time series data into data with fixed 10-minute time intervals;
[0016] A 2. Sequence standardization: The discretized time series is normalized to the mean so that they have similar statistical characteristics;
[0017] 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;
[0018] 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.
[0019] Furthermore, in step two, the Transformer neural network's Encoder-Decoder model and embedding layer are used 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; and 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.
[0020] Furthermore, the embedding layer consists of a position encoder and an input embedding. The position encoder is used to add 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 is used to convert 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.
[0021] Furthermore, the Encoder module includes:
[0022] 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.
[0023] 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.
[0024] Furthermore, the Decoder module includes:
[0025] 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.
[0026] 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.
[0027] 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.
[0028] Furthermore, each component of the Encoder module and Decoder module is connected to a LayerNormalization module to better facilitate signal transmission and prevent gradient vanishing during model training.
[0029] Furthermore, step two, model construction, specifically includes the following:
[0030] B1: Dataset splitting;
[0031] The sequence data obtained in step one is segmented into fixed-length time windows, each ranging from 10 to 30 minutes. The dataset is divided into 70 / 15 / 15 ratios. The first 70% of the time windows are used as the training set, the middle 15% as the validation set, and the remaining 15% as the test set.
[0032] B2: Set the hyperparameter range;
[0033] 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.
[0034] B3: Grid search;
[0035] The grid search method is used to search for the optimal combination of hyperparameters within the hyperparameter range;
[0036] B4: Random search;
[0037] The optimal hyperparameter combination is randomly searched within the range of hyperparameters using a random search method.
[0038] B5: Bayesian optimization;
[0039] The Bayesian optimization method is used to find the optimal combination of hyperparameters within the hyperparameter range;
[0040] B6: Evaluate model performance;
[0041] 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.
[0042] Furthermore, step three is detailed as follows:
[0043] The extracted parameter values and their corresponding time values are selected as the analytical features of the transformer 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, and after a series of interleaving, normalization, and attention mechanism training processes, the parameter relationships between the curve feature changes are obtained, that is, the model training is completed.
[0044] This invention employs a sensor gas concentration detection method based on a deep learning transformer neural network, which has the following advantages compared to traditional methods:
[0045] 1. Improved accuracy and precision of gas concentration detection: Existing gas concentration detection methods rely on the processing of sensor measurement data and model fitting, which suffer from problems such as insufficient model complexity and insufficient model generalization ability; while the transformer neural network, through training with a large amount of data and optimization of the model, can better mine data features and improve the accuracy and precision of detection.
[0046] 2. Capable of handling the concentration detection of multiple gases: Existing gas concentration detection methods model and process specific gases, making it difficult to handle the detection of multiple gases; while the transformer neural network method does not depend on a specific physical model, can handle the detection of multiple gases, and has better versatility and scalability.
[0047] 3. Adaptability to different environments and conditions: Existing gas concentration detection methods are sensitive to environmental changes and sensor drift, making it difficult to cope with complex environments and conditions; while the transformer neural network method, through adaptive learning and optimization, can better adapt to different environments and conditions, improving the robustness and stability of detection.
[0048] 4. Enables online detection and real-time monitoring: Existing gas concentration detection methods require offline processing and model training, and cannot achieve real-time monitoring and online detection; while deep learning methods have faster training speed and lower computational complexity, enabling real-time monitoring and online detection, and have better practicality and application value;
[0049] In summary, the sensor gas concentration detection method based on deep learning transformer neural network of the present invention has the advantages of high accuracy, strong versatility, good robustness and strong real-time performance. It can overcome the problems of traditional methods and achieve better gas concentration detection results. Attached Figure Description
[0050] 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.
[0051] Figure 1 : Response curve of gas sensor to 1 μL SO2F2;
[0052] Figure 2 : The overall architecture diagram of sequence processing based on the transformer model in this invention;
[0053] Figure 3 The present invention describes the sensor test time and voltage change curves;
[0054] Figure 4 : A two-dimensional diagram of sequence information in this invention. Detailed Implementation
[0055] 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:
[0056] Example 1
[0057] This embodiment provides a sensor gas concentration detection method based on a deep learning transformer neural network, which specifically includes the following steps:
[0058] Step 1: Dataset preparation and preprocessing;
[0059] Data from a gas sensor is collected and preprocessed, including cleaning, noise reduction, and standardization, to obtain a gas concentration sequence with a time dimension.
[0060] In this embodiment, the data processing specifically includes the following steps:
[0061] A. Discretize the time series: Discretize continuous time series data into data with fixed 10-minute time intervals;
[0062] B. Sequence standardization: The discretized time series is normalized to the mean, so that they have similar statistical characteristics;
[0063] C. 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 model;
[0064] D. 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;
[0065] Step 2: Constructing the Transformer neural network model;
[0066] The dataset is split and fed into the embedding layer. The hyperparameters of the encoder and decoder modules in the model 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) metrics. The best MSE and MAE are used to characterize the model performance.
[0067] The detection parameters vary considerably for gases with different properties. In this embodiment, the model construction of nitrogen dioxide gas is taken as an example, and the specific steps are as follows:
[0068] ① Data segmentation: Train the Transformer neural network model on the two-dimensional time series data obtained in step one, and perform data segmentation. Divide the 24-hour data into fixed-length time windows, each with a length of 10 to 30 minutes; and use a 70 / 15 / 15 ratio to divide the dataset; use the first 70% of the time windows as the training set, the middle 15% as the validation set, and the remaining 15% as the test set;
[0069] ② Set 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. Next, determine the batch size. Based on the computing power of the GPU or TPU to avoid issues such as insufficient video memory, set the batch size to 32, 64, or 128. Then, determine the number of hidden layers. Based on the data complexity and computing resource limitations, select the optimal number of hidden layers, choosing 5-6 layers to improve the model's expressive power. Finally, determine the number of heads. Multi-head self-attention is one of the key components of the transformer network. To enable the model to better capture the dependencies between different time steps, set the number of heads to 6-8.
[0070] ③ Grid search: The grid search method is used to search for the optimal combination of hyperparameters within the range of hyperparameters. The grid search method is an exhaustive search method that traverses all possible parameter combinations and selects the optimal one. The grid search method is implemented using the GridSearchCV library in Python.
[0071] ④ Random Search: This method uses a random search approach to find the optimal combination of hyperparameters within the hyperparameter range. The random search method randomly selects some parameter combinations within the hyperparameter range and chooses the optimal one. The random search method can be implemented using the RandomizedSearchCV library in Python.
[0072] ⑤ Bayesian optimization: This method uses Bayesian optimization to find the optimal combination of hyperparameters within a given range. Bayesian optimization searches for the optimal hyperparameter combination by establishing a relationship between the prior distribution of the hyperparameters and the posterior distribution of the model. It is implemented using the BayesianOptimization library in Python.
[0073] ⑥ Evaluate model performance: Train the model using the optimal hyperparameter combinations obtained by the above methods, and evaluate the optimal hyperparameter combinations on the test set using mean squared error (MSE) and mean absolute error (MAE). Use the MSE and MAE corresponding to the optimal parameter model to characterize the model performance.
[0074] When using Transformer neural networks for time-series processing in gas sensors, an Encoder-Decoder model is typically employed. The Encoder module converts the input sequence into a set of hidden representations, while the Decoder module generates the output sequence. The overall framework of the solution is attached. Figure 2As shown, the time-amplitude sequence is provided by the lower-level machine, directly enters the transformer model through the embedding module, and is processed by the Encoder and Decoder modules to output the gas concentration value.
[0075] The embedding module, specifically the embedding layer, is primarily used to convert the data acquired by the sensor (such as time-series signals) into a vector form that the neural network can process. In other words, it represents the sensor data as a vector to facilitate neural network processing and learning. Specifically, the embedding layer maps the discrete numerical values input from the gas sensor's host computer into continuous vector representations. In a Transformer neural network, the embedding layer typically consists of two parts: a position encoder and input embedding. The position encoder adds positional information to the input data at each time point, enabling the model to learn the order of the time series. The input embedding converts the input data at each time point into a fixed-dimensional vector representation for subsequent processing by the attention mechanism, encoder, and decoder.
[0076] The Encoder module converts the input sequence into a set of hidden representations, enabling the Decoder module to better utilize the information in the input sequence. In gas sensor applications, the Encoder module can be used to convert the gas concentration at the current time step into a set of hidden representations for use by the Decoder module. The Encoder module typically consists of the following components:
[0077] ①Multi-Head Attention: The first component of the Encoder module is a multi-head attention mechanism, which is used to weight and converge the input sequence so that the Encoder module can better utilize the information of the input sequence.
[0078] ②Position-wise Feed-Forward Network: The second component of the Encoder module is a feed-forward neural network, which is used to weight and converge the outputs of the multi-head attention mechanism described above in order to generate a set of hidden representations.
[0079] ③Layer Normalization: A LayerNormalization module has been added between each component of the Encoder module to improve signal transmission and prevent gradient vanishing during model training.
[0080] The signal transmission relationships between the various components in the Encoder module are as follows:
[0081] Input sequence → Multi-Head Attention → Position-wise Feed-Forward Network → Hidden representation sequence
[0082] The Multi-Head Attention component in the Encoder module extracts information from the input sequence and generates a set of hidden representations for use by the Decoder module. The Position-wise Feed-Forward Network component further processes this information and generates the final sequence of hidden representations. Finally, the hidden representation sequence can be used in the Decoder module to generate the output sequence.
[0083] The Decoder module generates the output for the current time step based on the hidden representation provided by the Encoder module and the previously generated output. In gas sensor applications, the Decoder module is used to predict the gas concentration for the next time step. The Decoder module typically consists of the following components:
[0084] ①Masked Multi-Head Attention: The first component of the Decoder module is a self-attention mechanism, which is used to compute the relationship between the output of the current time step and the previously generated output, and to interact with the hidden representation provided by the Encoder module and the output of the current time step;
[0085] ② Multi-Head Attention: The second component of the Decoder module is the multi-head attention mechanism, which 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;
[0086] ③Position-wise Feed-Forward Network: The third component of the Decoder module is a feed-forward neural network, which 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;
[0087] ④Layer Normalization: A LayerNormalization module has been added between each component of the Decoder module to improve signal transmission and prevent gradient vanishing during model training.
[0088] The signal transmission relationships between the various components in the Decoder module are as follows:
[0089] The input sequence → Masked Multi-Head Attention → Multi-Head Attention → Position-wise Feed-Forward Network → Output Sequence. The Masked Multi-Head Attention and Multi-Head Attention components in the Decoder module extract information from the hidden representations provided by the Encoder module and interact with the output of the current time step to generate the output for that time step. The Position-wise Feed-Forward Network component further processes this information and generates the final output. Finally, the output sequence can be used to predict the gas concentration at the next time step.
[0090] Step 3: Training the Transformer neural network model;
[0091] The extracted parameter values and their corresponding time values are selected as the analytical features of the transformer neural network, as shown in the appendix. Figure 3 Appendix Figure 4 As shown, 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 concentration and time values of the corresponding gases; the feature parameters of the time series curves are obtained as the training set, and imported into the neural network through embedding. After a series of interleaving, normalization, and attention mechanism training processes, the parameter relationship between the curve feature changes is obtained, that is, the model training is completed.
[0092] Step 4: Use the trained Transformer neural network model to estimate the actual environmental parameter values and gas concentration values.
[0093] Example 2
[0094] Practical application examples of using gas sensors with the Transformer model to detect nitrogen dioxide gas concentration:
[0095] First, nitrogen dioxide gas sample data is collected. The gas sensor is placed in the monitoring area and standard concentration nitrogen dioxide gas concentration data is collected. The data includes the concentration and time sequence value of nitrogen dioxide gas.
[0096] Next, the collected data is preprocessed. The data is cleaned, denoised, and standardized; the moving average method is used to smooth the data, and the least squares method is used to remove noise.
[0097] The processed data is then fed into the Transformer model for training. During training, the model learns how to correlate the input gas concentration data with time series and establishes the model's weight parameters.
[0098] After training, the model is deployed to the actual system. When it is necessary to detect the concentration of nitrogen dioxide gas, the sensor only needs to transmit a small amount of collected sensor time series data to the Transformer model for inference.
[0099] Finally, the concentration of nitrogen dioxide gas is quickly assessed based on the model's output; if the concentration exceeds the safety threshold, the system can trigger an alarm or take other necessary actions.
[0100] 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.
[0101] 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.
[0102] 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. A sensor gas concentration detection method based on deep learning transformer neural network, characterized in that, Specifically, the steps include the following: Step 1: Dataset preparation and preprocessing; Data from a gas sensor is collected and preprocessed, including cleaning, noise reduction, and standardization, to obtain a gas concentration sequence with a time dimension. Step 2: Constructing the Transformer neural network model; The dataset is split and fed into the training set in the embedding layer. The hyperparameters of the encoder and decoder modules in the model are adjusted. The optimal combination of hyperparameters is evaluated using a grid search optimization function with reference to mean squared error and mean absolute error. The best MSE and MAE are used to characterize the model performance. Step 3: Training the Transformer neural network model; Step 4: Use the trained Transformer neural network model to estimate the actual environmental parameter values and gas concentration values; 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. Step two, model building, specifically includes the following: B1: Dataset splitting; The sequence data obtained in step one is segmented into fixed-length time windows, each ranging from 10 to 30 minutes. The dataset is divided into 70 / 15 / 15 proportions. The first 70% of the time windows are used as the training set, the middle 15% as the validation set, and the remaining 15% as the test set. B2: Set 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. B3: Grid search; The grid search method is used to search for the optimal combination of hyperparameters within the hyperparameter range; B4: Random search; The optimal hyperparameter combination is randomly searched within the range of hyperparameters using a random search method. B5: Bayesian optimization; The Bayesian optimization method is used to find the optimal combination of hyperparameters within the hyperparameter range; B6: 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.
2. The sensor gas concentration detection method based on deep learning transformer neural network as described in claim 1, characterized in that, In step one, the data includes gas concentration and time sequence values. The sequence values from the sensor, including concentration and time, 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 sensor gas concentration detection method based on deep learning transformer neural network as described in claim 1, characterized in that, The embedding layer consists of a position encoder and an input embedding. The position encoder is used to add position information to the input data at each time point so that the model can learn the order of the time series. Input embedding is used to transform the input data at each time point into a fixed-dimensional vector representation so that it can be processed by subsequent attention mechanisms, encoders and decoders.
4. The sensor gas concentration detection method based on deep learning transformer neural network as described in claim 1, characterized in that, 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.
5. The sensor gas concentration detection method based on deep learning transformer neural network as described in claim 1, characterized in that, 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.
6. The sensor gas concentration detection method based on deep learning transformer neural network as described in claim 1, characterized in that, Each component of the Encoder and Decoder modules is connected by a LayerNormalization module to improve signal transmission and prevent gradient vanishing during model training.
7. The sensor gas concentration detection method based on deep learning transformer neural network as described in claim 1, characterized in that, Step three is as follows: The extracted parameter values and their corresponding time values are selected as the analytical features of the transformer neural network, i.e. , This represents the data parameters sent by the lower-level machine at a certain moment. These are the corresponding gas concentrations and time values; the training set is imported into the neural network via embedding, and after a series of interleaving, normalization, and attention mechanism training processes, the parameter relationships between the curve feature changes are obtained, that is, the model training is completed.
Citation Information
Patent Citations
Environmental monitoring method based on Transform time sequence prediction
CN114580710A
Transformer fault early warning model establishment method, early warning method and device
CN115730246A