Indoor gas concentration prediction method, device and equipment with dynamic selection of environmental variables
By calculating the correlation coefficient between environmental variables and gas concentration and extracting features through comparative learning, environmental variables are dynamically selected for gas concentration prediction, which solves the problem of low gas concentration prediction accuracy in the existing technology and achieves accurate prediction of gas concentration over long time intervals. .
Patent Information
- Application Number
- CN202410917686.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-07-10
AI Technical Summary
Existing gas concentration prediction methods cannot fully capture time series information, resulting in low long-interval gas concentration prediction accuracy. The impact of environmental variables on the gas concentration prediction accuracy at different prediction intervals is not fully considered, and environmental variables participate with the same weight in the prediction model. prediction, reducing the prediction accuracy.
By calculating the average correlation coefficient between environmental variables and target gas concentrations, the target environmental variables are dynamically selected, the feature extraction network obtained by comparative learning is used to extract trend features and seasonal features, and the input is input to the dual-flow lightweight attention model for gas concentration prediction. .
It achieves accurate prediction of gas concentration over long time intervals, improves the accuracy of gas concentration prediction results, and enhances the ability to capture time series information through dynamic selection of environmental variables and feature extraction.
Smart Images

Figure CN118467915B
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of gas concentration prediction, and in particular to a method, device and equipment for predicting indoor gas concentration by dynamic selection of environmental variables. Background Art
[0002] Industrial sites usually produce a large amount of carbon dioxide, nitrogen oxides, sulfur dioxide, formaldehyde and other gases that affect human health and the normal operation of industrial workshops. If the gas processing equipment fails and is not discovered in time, it is easy to cause the gas concentration to increase and lead to production safety accidents. Therefore, the prediction of gas concentration is crucial to ensure industrial safety production. The gas concentration information measured by the non-dispersive infrared sensor is a typical time series, so mining the gas concentration time series characteristics and building a prediction model are crucial for the safe operation of process industries.
[0003] While the non-dispersive infrared sensor system measures the gas concentration value, its coupled measuring device measures environmental variables including temperature, flow rate, pressure, etc., and the above environmental variables have different degrees of influence on the gas concentration prediction. If the measurement system is selected without screening to obtain all environmental variables to jointly predict the gas concentration, it will increase computing resources and reduce the prediction accuracy. In addition, at different prediction intervals, the degree of influence of environmental variables on gas concentration is different. Although the relevant technology takes into account the differential influence of environmental variables in predicting gas concentration, it does not dynamically screen the environmental variables in the process of building the prediction model, so that the environmental variables participate in the gas concentration prediction with the same weight, which reduces the prediction accuracy.
[0004] However, the related gas concentration prediction methods cannot fully capture the time series information when predicting gas concentration, resulting in low prediction accuracy of long-interval gas concentration. In addition, the related gas concentration prediction methods do not fully consider the impact of environmental variables on the prediction accuracy of gas concentration at different prediction intervals. Therefore, there is an urgent need for a gas concentration prediction method that can accurately predict long time intervals. Summary of the invention
[0005] In view of the above problems, the embodiments of the present application provide a method, device and apparatus for predicting indoor gas concentration with dynamic selection of environmental variables, so as to overcome the above problems or at least partially solve the above problems.
[0006] In a first aspect of an embodiment of the present application, a method for predicting indoor gas concentration by dynamically selecting environmental variables is disclosed, the method comprising:
[0007] Calculate the average value of the correlation coefficient between each environmental variable and the target gas concentration to obtain the average correlation coefficient of each environmental variable;
[0008] Sorting the environmental variables according to the magnitude of the average correlation coefficient, and dynamically selecting a target environmental variable for predicting gas concentrations at different intervals from the plurality of environmental variables according to the sorting result;
[0009] Using the feature extraction network obtained by contrastive learning, trend feature extraction and season feature extraction are performed on the target environmental variable to obtain trend features and season features;
[0010] The trend characteristics and the seasonal characteristics are input into the dual-stream lightweight attention model to perform gas concentration prediction to obtain a gas concentration prediction result.
[0011] Optionally, the average value of the correlation coefficient between each environmental variable and the target gas concentration is calculated to obtain the average correlation coefficient of each environmental variable, including:
[0012] According to the environmental variable sequence and the target gas concentration sequence, the correlation coefficients at different offset intervals are calculated;
[0013] Calculate the average of the correlation coefficients of multiple groups of environmental variables at different offset intervals to obtain the average correlation coefficient of the environmental variables;
[0014] According to the above steps, the average correlation coefficient of each environmental variable is calculated in turn to obtain the average correlation coefficient of each environmental variable.
[0015] Optionally, the feature extraction network includes: an encoder, a seasonal feature extraction module and a trend feature extraction module; the feature extraction network is trained according to the following steps:
[0016] The sample target environmental variable and the sample target gas concentration are encoded by the encoder to obtain a label sample, and the sample target environmental variable and the sample target gas concentration are encoded and data enhanced to obtain a comparison sample;
[0017] By means of the seasonal feature extraction module, seasonal features are extracted from the label sample and the comparison sample, and a seasonal feature cross entropy loss value is calculated according to the extracted seasonal features;
[0018] The trend feature extraction module is used to extract trend features from the label sample and the comparison sample, and a trend feature cross entropy loss value is calculated based on the extracted trend features;
[0019] The seasonal feature cross entropy loss value and the trend feature cross entropy loss value are weightedly summed to obtain a total loss value, and the parameters of the encoder, the parameters of the seasonal feature extraction module, and the parameters of the trend feature extraction module are updated according to the total loss value.
[0020] Optionally, the seasonal feature extraction module includes: a Fourier transform module, a linear connection layer and an inverse Fourier transform module;
[0021] The seasonal feature extraction module is used to extract seasonal features from the label sample and the comparison sample, and the seasonal feature cross entropy loss value is calculated according to the extracted seasonal features, including:
[0022] Processing the label sample to obtain a first complex vector, and processing the comparison sample to obtain a second complex vector, wherein the first complex vector and the second complex vector constitute a seasonal feature;
[0023] According to the first complex vector and the second complex vector, an amplitude loss and a phase loss are calculated, and according to the amplitude loss and the phase loss, a seasonal characteristic cross entropy loss value is obtained.
[0024] Optionally, the trend feature extraction module includes: L layers of causal convolution and average pooling layers;
[0025] The trend feature extraction module is used to extract trend features from the label sample and the comparison sample, and a trend feature cross entropy loss value is calculated according to the extracted trend features, including:
[0026] Processing the label sample to obtain a third complex vector, and processing the comparison sample to obtain a fourth complex vector, wherein the third complex vector and the fourth complex vector constitute a trend feature;
[0027] A trend feature loss is calculated according to the third complex vector and the fourth complex vector to obtain a trend feature cross entropy loss value.
[0028] Optionally, the dual-stream lightweight attention model includes: a trend stream attention module and a season stream attention module; the dual-stream lightweight attention model is trained according to the following steps:
[0029] Extracting features of sample target environmental variables through the feature extraction network to obtain sample trend features and sample seasonal features;
[0030] Inputting the sample trend feature into the trend flow attention module for processing to obtain a sample trend flow gas concentration prediction result;
[0031] Inputting the sample seasonal characteristics into the seasonal flow attention module for processing to obtain the sample seasonal flow gas concentration prediction result;
[0032] Calculating a gas concentration loss value according to the sample trend flow gas concentration prediction result and the sample trend flow gas concentration prediction result;
[0033] The model parameters of the dual-stream lightweight attention model are updated according to the gas concentration loss value.
[0034] Optionally, the trend stream attention module and the season stream attention module have the same structure, and the trend stream attention module and the season stream attention module use multi-head sparse self-attention and attention distillation processing.
[0035] Optionally, encoding and data enhancement processing are performed on the sample target environmental variable and the sample target gas concentration to obtain a comparison sample, including:
[0036] According to a data enhancement processing method, data enhancement processing is performed on the sample target environmental variable and the sample target gas concentration to obtain a comparison sample, and the data enhancement processing method includes: scaling processing, offset processing and noise addition processing;
[0037] The method further comprises:
[0038] Put the label sample and the comparison sample into a sample set as a comparison learning sample pair;
[0039] After the current training is completed, comparative learning sample pairs for the next training are obtained from the sample set, and the data enhancement processing method of the comparative samples in the comparative learning sample pairs for the next training is different from the data enhancement processing method of the comparative samples in the comparative learning sample pairs used for the current training.
[0040] In a second aspect of the embodiments of the present application, a device for predicting indoor gas concentration by dynamically selecting environmental variables is disclosed, the device comprising:
[0041] A calculation module, used to calculate the average value of the correlation coefficient between each environmental variable and the target gas concentration, and obtain the average correlation coefficient of each environmental variable;
[0042] A selection module, for sorting the environmental variables according to the magnitude of the average correlation coefficient, and dynamically selecting a target environmental variable for different prediction interval gas concentrations from the plurality of environmental variables according to the sorting result;
[0043] An extraction module, used to extract trend features and season features of the target environmental variables using a feature extraction network obtained through contrastive learning, to obtain trend features and season features;
[0044] The prediction module is used to input the trend characteristics and the seasonal characteristics into the dual-stream lightweight attention model to predict the gas concentration and obtain a gas concentration prediction result.
[0045] A third aspect of an embodiment of the present application discloses a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the indoor gas concentration prediction method by dynamic selection of environmental variables described in the first aspect of the embodiment of the present application are implemented.
[0046] The embodiments of the present application include the following advantages:
[0047] In an embodiment of the present application, the average value of the correlation coefficient between each environmental variable and the target gas concentration is calculated to obtain the average correlation coefficient of each environmental variable; the environmental variables are sorted according to the size of the average correlation coefficient, and the target environmental variables for different prediction interval gas concentrations are dynamically selected from multiple environmental variables according to the sorting result; the feature extraction network obtained by contrastive learning is used to extract trend features and seasonal features of the target environmental variables to obtain trend features and seasonal features; the trend features and seasonal features are input into the dual-stream lightweight attention model to predict gas concentration and obtain gas concentration prediction results.
[0048] This method takes into account the impact of environmental variables on the prediction accuracy of gas concentration at different prediction intervals. For gas concentration prediction at different prediction intervals, the number and type of environmental variables are dynamically selected through the average correlation coefficient of environmental variables to fully capture time series information, thereby achieving accurate gas concentration prediction based on the dynamically selected target environmental variables. In addition, trend characteristics and seasonal characteristics respectively characterize input time series information of different dimensions, so gas concentration prediction is performed based on the trend characteristics and seasonal characteristics of the target environmental variables, further improving the accuracy of gas concentration prediction results. In this way, a gas concentration prediction method that can accurately predict long time intervals is realized.
[0049] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0051] Figure 1 It is a flowchart of the steps of a method for predicting indoor gas concentration by dynamically selecting environmental variables provided in an embodiment of the present application;
[0052] Figure 2 It is a heat map of correlation coefficients between an environmental variable and target gas concentration at different offset intervals provided in an embodiment of the present application;
[0053] Figure 3 It is a schematic diagram of implementing input variable contrast learning based on data enhancement provided in an embodiment of the present application;
[0054] Figure 4 is a schematic diagram of a dual-stream lightweight attention model provided in an embodiment of the present application;
[0055] Figure 5 It is a framework diagram of an indoor gas concentration prediction method for dynamic selection of environmental variables provided in an embodiment of the present application;
[0056] Figure 6 It is a structural schematic diagram of an indoor gas concentration prediction device for dynamically selecting environmental variables provided in an embodiment of the present application;
[0057] Figure 7 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0059] While the non-dispersive infrared sensor system measures the gas concentration value, its coupled measurement device measures environmental variables including temperature, flow rate, pressure, etc., and the above environmental variables have different degrees of influence on the gas concentration prediction. If the measurement system is selected without screening to obtain all environmental variables to jointly predict the gas concentration, it will increase computing resources and reduce the prediction accuracy. In addition, at different prediction intervals, the degree of influence of environmental variables on gas concentration is different. Although existing studies have taken into account the differential influence of environmental variables in predicting gas concentration, they have not dynamically screened environmental variables in the process of building prediction models, so that environmental variables participate in gas concentration prediction with the same weight, reducing prediction accuracy. Therefore, it is crucial to realize feature extraction of environmental variables to improve prediction accuracy. The coupling effect of multidimensional data makes the gas concentration sequence highly complex. It is crucial to realize data decoupling and feature representation for the construction of gas concentration prediction model.
[0060] The embodiment of the present application decouples the seasonal characteristics and trend characteristics in the environmental variables and the target gas concentration variables, and then constructs a prediction model to process the decoupled seasonal characteristics and trend characteristics respectively, and finally integrates the trend characteristic prediction results and the seasonal characteristic prediction results to achieve high-precision prediction of gas concentration. Environmental variables are chaotic because of their time series, so that non-dispersive infrared sensors will produce a large degree of measurement error during the measurement process, and the errors in the input data will seriously affect the prediction accuracy. Therefore, eliminating or reducing the errors in the input data plays an important role in improving the prediction accuracy of gas concentration. In addition, the existing prediction method does not effectively reduce the measurement errors generated when the environmental variables and gas concentrations are collected, thereby limiting the improvement of the prediction accuracy of the model. To this end, the embodiment of the present application proposes a method for predicting indoor gas concentrations by dynamically selecting environmental variables, and dynamically selecting the number and type of environmental variables through the average correlation coefficient of environmental variables to fully capture time series information, thereby achieving accurate gas concentration prediction based on the dynamically selected target environmental variables.
[0061] The following is a detailed description of the indoor gas concentration prediction method for dynamic selection of environmental variables provided in an embodiment of the present application in conjunction with the accompanying drawings.
[0062] Reference Figure 1 As shown, Figure 1 This is a flowchart of the steps of a method for predicting indoor gas concentration by dynamically selecting environmental variables provided in an embodiment of the present application. Figure 1 As shown, the method may include steps S110 to S140:
[0063] Step S110: Calculate the average value of the correlation coefficients between each environmental variable and the target gas concentration to obtain the average correlation coefficient of each environmental variable.
[0064] In the embodiment of the present application, environmental variables refer to variables that have an impact on the prediction of gas concentration, and environmental variables include temperature, humidity, flow rate, and pressure. Different environmental variables have different effects on the prediction accuracy of gas concentration, and the same environmental variable has different effects on the prediction accuracy of gas concentration at different prediction intervals. Therefore, the environmental variables used to predict the gas concentration at different intervals may be different. By calculating the average value of the correlation coefficient between each environmental variable and the target gas concentration, the average correlation coefficient of each environmental variable is obtained. The average correlation coefficient of the environmental variable characterizes the degree of influence of the environmental variable on the gas concentration prediction result, and thus the dynamic selection of environmental variables at different prediction intervals is realized according to the average correlation coefficient of the environmental variable.
[0065] Step S120: sorting the environmental variables according to the size of the average correlation coefficient, and dynamically selecting a target environmental variable for gas concentrations at different prediction intervals from the multiple environmental variables according to the sorting result.
[0066] In the embodiment of the present application, the target environmental variable is an environmental variable that has a great influence on the accuracy of the gas concentration at the prediction interval. After the average correlation coefficient of each environmental variable is calculated in step S110, the average correlation coefficients of each environmental variable are sorted in order from large to small, so as to dynamically select the target environmental variable for different prediction interval gas concentrations from multiple environmental variables according to the sorting result.
[0067] In some embodiments, the environment variables corresponding to the first A average correlation coefficients in the sorting results are selected as the target environment variables, wherein the value of A is flexibly set according to the actual situation. In other embodiments, the environment variables corresponding to the average correlation coefficients in the sorting results that are greater than the average correlation coefficients of the target threshold values are selected as the target environment variables.
[0068] Step S130: using the feature extraction network obtained by contrastive learning, extract trend features and season features from the target environmental variable to obtain trend features and season features.
[0069] In the embodiment of the present application, the feature extraction network refers to a network with trend feature and season feature extraction functions. Trend features and season features respectively represent input time series information of different dimensions. Rich input time series information will improve the accuracy of gas concentration prediction. Specifically, the feature extraction network includes a seasonal feature extraction module and a trend feature extraction module. The seasonal feature extraction module is used to extract features of the target environmental variables to obtain seasonal features; the trend feature extraction module is used to extract features of the target environmental variables to obtain trend features.
[0070] Step S140: input the trend characteristics and the season characteristics into the dual-stream lightweight attention model to perform gas concentration prediction to obtain a gas concentration prediction result.
[0071] In an embodiment of the present application, the dual-stream lightweight attention model includes: a trend flow attention module and a seasonal flow attention module. The trend flow attention module is used to predict gas concentration based on trend characteristics, and the throttling attention module is used to predict gas concentration based on seasonal characteristics.
[0072] Specifically, the trend characteristics and the seasonal characteristics are input into the dual-stream lightweight attention model for gas concentration prediction, including: inputting the trend characteristics into the trend stream attention module for processing to obtain the trend stream gas concentration prediction result; inputting the seasonal characteristics into the seasonal stream attention module for processing to obtain the seasonal stream gas concentration prediction result; thereby performing weighted summation on the trend stream gas concentration prediction result and the seasonal stream gas concentration prediction result to obtain the gas concentration prediction result.
[0073] In summary, the method provided in the embodiment of the present application takes into account the influence of environmental variables on the prediction accuracy of gas concentration at different prediction intervals. For the prediction of gas concentration at different prediction intervals, the number and type of environmental variables are dynamically selected through the average correlation coefficient of the environmental variables to fully capture the time series information, thereby achieving accurate gas concentration prediction based on the dynamically selected target environmental variables. In addition, the trend characteristics and seasonal characteristics respectively characterize the input time series information of different dimensions, so the gas concentration prediction is performed based on the trend characteristics and seasonal characteristics of the target environmental variables, further improving the accuracy of the gas concentration prediction results. In this way, a gas concentration prediction method that can accurately predict long time intervals is realized.
[0074] The present application is described in detail below in conjunction with the above-mentioned implementation steps.
[0075] In an optional embodiment, calculating the average value of the correlation coefficient between each environmental variable and the target gas concentration to obtain the average correlation coefficient of each environmental variable includes steps A1 to A3:
[0076] Step A1: Calculate the correlation coefficients of different offset intervals based on the environmental variable sequence and the target gas concentration sequence.
[0077] Step A2: Calculate the average of the correlation coefficients of multiple groups of environmental variables at different offset intervals to obtain the average correlation coefficient of the environmental variables.
[0078] Step A3: According to the above steps, the average correlation coefficient of each environmental variable is calculated in turn to obtain the average correlation coefficient of each environmental variable.
[0079] In the embodiment of the present application, for each set of environmental variables corresponding to each environmental variable, the correlation coefficients of different offset intervals of each set of environmental variables are calculated by the method of step A1, and then the average value of the correlation coefficients of different offset intervals of the multiple sets of environmental variables is calculated according to step A2 to obtain the average correlation coefficient of the environmental variable. The average correlation coefficient of the environmental variable is calculated for each environmental variable through the above steps A1 to A2.
[0080] For example, the calculation of the average correlation coefficient of the environmental variables is expressed as:
[0081] ,
[0082] in, Represents the correlation coefficient of different offset intervals, that is, the gas concentration series and the environmental variable series The correlation coefficient between them; N represents the data length of each group of environmental variables; Indicates the length of the offset interval; represents the time series of environmental variables; represents the target gas concentration time series, Indicates the offset interval Target gas concentration value at ; Indicates the first set of environment variable sequences The average correlation coefficient of Indicates Set environment variable sequence The average correlation coefficient of Indicates Set environment variable sequence The average correlation coefficient of; m is the number of groups of environmental variable sequences; represents the sequence of environmental variables sorted by the size of the average correlation coefficient. Represents a sorting function.
[0083] For example, Figure 2 This is a heat map of correlation coefficients between an environmental variable and target gas concentration at different offset intervals provided in an embodiment of the present application. Figure 2 The correlation coefficients between m groups of environmental variables and target gas concentrations at different offset times are shown. Figure 2 (a) to (e) are heat maps of the correlation coefficients between the five environmental variables of temperature, humidity, pressure, flow velocity and direction (flow direction) and the target gas sequence. Figure 2 Each row from (a) to (e) has 30 correlation coefficients. The time offset between adjacent correlation coefficients is 24 hours. Each group of time series is offset 30 times, and 30 correlation coefficients can be obtained.
[0084] Figure 2 There are 20 rows of data in (a) to (e), representing 20 sampling sequences extracted from the collected data. Then, 20 sets of environmental variables and corresponding target gas concentration value time series are randomly selected from each environmental variable and the correlation coefficients are calculated respectively, and a correlation coefficient heat map with a dimension of 20×30 is obtained. Figure 2 (f) in the figure is the average value (i.e., the average correlation coefficient) of 20 correlation coefficients obtained by offsetting the same length when 20 time series are selected for the five environmental variables of temperature, humidity, pressure, flow rate, and direction. Figure 2 Each row of (f) in the figure has 30 correlation coefficient values, which represent the average correlation coefficients of each set of sample data after 30 shifts. Figure 2 (f) in the figure has 5 rows of data, representing 5 environmental variables.
[0085] like Figure 2 As shown, the correlation coefficients between different environmental variables and target gas concentrations show obvious differences at different offset intervals. Figure 2 (a) shows that the high correlation area between temperature and target gas concentration is mainly concentrated in the offset range of 5-15 and 25-30 . Figure 2 (b) shows that the high correlation area between humidity and target gas concentration is mainly concentrated in the offset range of 0-6 and 17-26 . Figure 2 (c) and (e) show that there is a large correlation between pressure and direction and target gas concentration at different offset intervals, but the level of this correlation is greatly affected by the sampling sequence, and there is no obvious consistent high correlation value range, that is, the high correlation area is relatively scattered. Figure 2 (d) in the figure shows that the high correlation area between flow rate and target gas concentration is greatly affected by the sampling sequence, and the high correlation interval is relatively scattered. Therefore, when predicting gas concentrations at different intervals, the selection of environmental variables should show differences as the prediction interval changes. Based on the above analysis, it can be concluded that: the target environmental variable selection method for different prediction intervals (different offset intervals).
[0086] For example, the target environment variable selection for different prediction intervals is expressed as:
[0087] ,
[0088] in, , , , , They represent the five environmental variables of temperature, humidity, pressure, direction (flow direction) and flow velocity collected at the same time. It represents the types and number of environmental variables selected for different prediction intervals, and n represents the length of the offset interval.
[0089] In an optional embodiment, the feature extraction network includes: an encoder, a seasonal feature extraction module and a trend feature extraction module; the feature extraction network is trained according to the following steps B1 to B4:
[0090] Step B1: Encode the sample target environmental variables and the sample target gas concentration by the encoder to obtain a label sample, and encode and perform data enhancement processing on the sample target environmental variables and the sample target gas concentration to obtain a comparison sample.
[0091] In the embodiment of the present application, the dynamically selected sample target environmental variables and sample target gas concentrations are used as raw data, and the raw data are encoded using an encoder, and the encoded raw data are used as label samples. The sample target environmental variables and sample target gas concentrations are encoded and data enhanced to construct comparison samples, and the label samples and the corresponding comparison samples are used as comparison learning sample pairs.
[0092] Specifically, encoding and data enhancement processing are performed on the sample target environmental variables and the sample target gas concentration to obtain a comparison sample, including: encoding and data enhancement processing are performed on the sample target environmental variables and the sample target gas concentration according to a data enhancement processing method to obtain a comparison sample, and the data enhancement processing method includes: scaling processing, offset processing and noise addition processing.
[0093] Among them, scaling processing refers to: scaling the overall time series data according to the scaling factor size to simulate the systematic deviation of the data acquisition equipment. The scaling factor is a random sampling in the Gaussian distribution. Offset processing means: offsetting the time series data as a whole according to the offset factor to simulate the dynamic changes of the systematic deviation of the data acquisition equipment. The offset factor is a random sampling in the Gaussian distribution. Adding noise processing means adding white noise to the data at each moment of the time series, and the distribution of the white noise with Gaussian distribution satisfies , simulates random perturbations in the input data.
[0094] For example, the data augmentation process is expressed as:
[0095] ,
[0096] in, represents the data obtained after enhancement processing, represents the data before enhancement processing, represents the scaling factor, represents the offset factor, Represents white noise.
[0097] Furthermore, the method also includes: putting the label sample and the comparison sample into a sample set as a comparison learning sample pair; after the current training is completed, obtaining a comparison learning sample pair for the next training from the sample set, and the data enhancement processing method of the comparison sample in the comparison learning sample pair for the next training is different from the data enhancement processing method of the comparison sample in the comparison learning sample pair used for the current training.
[0098] In the embodiment of the present application, in order to ensure the effectiveness of data enhancement, the network parameters in the feature extraction network are trained once after each data enhancement processing method is completed to ensure that the three data enhancement processing methods are used alternately.
[0099] Step B2: extracting seasonal features from the label sample and the comparison sample through the seasonal feature extraction module, and calculating seasonal feature cross entropy loss values according to the extracted seasonal features.
[0100] For example, Figure 3 is a schematic diagram of implementing input variable contrast learning based on data enhancement provided by an embodiment of the present application, such as Figure 3 As shown, the seasonal feature extraction module includes: a Fourier transform module, a linear connection layer and an inverse Fourier transform module.
[0101] Specifically, the seasonal feature extraction module is used to extract seasonal features from the label sample and the comparison sample, and the seasonal feature cross entropy loss value is calculated based on the extracted seasonal features, including: processing the label sample to obtain a first complex vector, and processing the comparison sample to obtain a second complex vector, wherein the first complex vector and the second complex vector constitute seasonal features; calculating amplitude loss and phase loss based on the first complex vector and the second complex vector, and obtaining the seasonal feature cross entropy loss value based on the amplitude loss and the phase loss.
[0102] Among them, the label sample can be represented as a sample label vector , the contrast sample can be represented as the contrast sample vector , so the sample label vector and the comparison sample vector are input into the seasonal feature extraction module for processing to obtain the first complex vector and the second complex vector .
[0103] For example, the seasonal feature cross entropy loss value is expressed as:
[0104] ,
[0105] in, represents the seasonal feature cross entropy loss value, represents the amplitude loss, represents the phase loss, represents the adjustment parameter, represents the first complex vector The amplitude of , represents the second complex vector The amplitude of represents the phase of the first complex vector , , represents the second complex vector The phase of , m represents the length of the seasonal feature sequence, and K represents the length of each seasonal feature (i.e., the first complex vector and the second complex vector).
[0106] Step B3: extracting trend features from the label sample and the comparison sample through the trend feature extraction module, and calculating trend feature cross entropy loss values according to the extracted trend features.
[0107] like Figure 3 As shown, the trend feature extraction module includes: L layers of causal convolution and average pooling layers.
[0108] Specifically, through the trend feature extraction module, trend features are extracted for the label sample and the comparison sample, and a trend feature cross entropy loss value is calculated based on the extracted trend features, including: processing the label sample to obtain a third complex vector, and processing the comparison sample to obtain a fourth complex vector, the third complex vector and the fourth complex vector constituting a trend feature; performing trend feature loss calculation based on the third complex vector and the fourth complex vector to obtain a trend feature cross entropy loss value.
[0109] Among them, the label sample can be represented as a sample label vector , the contrast sample can be represented as the contrast sample vector , the sample label vector and comparison sample vector After being processed by the trend feature extraction module, the third complex vector is obtained and the fourth complex vector .
[0110] For example, the trend feature cross entropy loss value is expressed as:
[0111] ,
[0112] in, represents the cross entropy loss value of trend features, represents the adjustment parameter, represents the third complex vector , , represents the fourth complex vector , n represents the total number of samples, T Represents the length of each trend feature (i.e., the third complex vector and the fourth complex vector).
[0113] Step B4: Perform weighted summation on the seasonal feature cross entropy loss value and the trend feature cross entropy loss value to obtain a total loss value, and update the parameters of the encoder, the parameters of the seasonal feature extraction module, and the parameters of the trend feature extraction module according to the total loss value.
[0114] For example, the total loss value is expressed as:
[0115] ,
[0116] in, represents the total loss value, represents the weight of the cross entropy loss value of the trend feature, represents the cross entropy loss value of trend features, Represents the seasonal feature cross entropy loss value.
[0117] In an embodiment of the present application, based on the total loss value, the back propagation method is used to update the parameters of the encoder, the parameters of the seasonal feature extraction module, and the parameters of the trend feature extraction module, and when the training end conditions are met, a trained feature extraction network is obtained.
[0118] Reference Figure 4 As shown, Figure 4 It is a schematic diagram of a dual-stream lightweight attention model provided in an embodiment of the present application. Specifically, the dual-stream lightweight attention model includes: a trend stream attention module and a season stream attention module; and the trend stream attention module and the season stream attention module have the same structure, and the trend stream attention module and the season stream attention module use multi-head sparse self-attention and attention distillation processing.
[0119] In the embodiment of the present application, considering the timeliness of the model training process and the limitation of the deployment location resources, an attention model (Informer) with less precision loss, fewer parameters, and faster training convergence should be selected. Therefore, the multi-head attention mechanism in the traditional attention model is replaced with multi-head sparse self-attention (ProbSparse) and attention distillation processing to reduce the computational complexity of the model.
[0120] Among them, the trend stream attention module and the seasonal stream attention module are respectively composed of two multi-head attention mechanisms, two forward networks and a masked multi-head attention mechanism. When the seasonal features are processed by the seasonal stream attention module, the seasonal features are processed into seasonal feature input (i.e., periodic feature input) and seasonal feature mask input (i.e., periodic feature mask input), the periodic feature input is processed by the multi-head attention mechanism, and the processing result is input into the first forward network, the periodic feature mask input is processed by the masked multi-head attention mechanism, and then the output result of the first forward network and the output result of the masked multi-head attention mechanism are processed by the multi-head attention mechanism, and the processing result is input into the second forward network for processing to obtain the seasonal flow gas concentration prediction result (i.e., the first output vector, the first output vector contains a vector composed of the cross entropy loss function of the concentration values at multiple moments).
[0121] When the trend feature is processed by the trend flow attention module, the trend feature is processed into a trend feature input (i.e., a slowly varying feature input) and a trend feature mask input (i.e., a slowly varying feature mask input), the slowly varying feature input is processed by the multi-head attention mechanism, and the processing result is input into the first forward network, and the slowly varying feature mask input is processed by the masked multi-head attention mechanism; then the output result of the first forward network and the output result of the masked multi-head attention mechanism are processed by the multi-head attention mechanism, and the processing result is input into the second forward network for processing to obtain the slowly varying flow gas concentration prediction result (i.e., the second output vector, the second output vector contains a vector composed of the cross entropy loss function of the concentration values at multiple times).
[0122] Finally, the first output vector and the second output vector are spliced, and the gas concentration prediction result is obtained according to the splicing result.
[0123] In an optional embodiment, the dual-stream lightweight attention model is trained according to the following steps C1 to C5:
[0124] Step C1: extracting features of sample target environmental variables through the feature extraction network to obtain sample trend features and sample seasonal features.
[0125] Step C2: Input the sample trend feature into the trend flow attention module for processing to obtain the sample trend flow gas concentration prediction result.
[0126] Step C3: Input the sample seasonal characteristics into the seasonal flow attention module for processing to obtain the sample seasonal flow gas concentration prediction result.
[0127] Step C4: Calculate the gas concentration loss value according to the sample trend flow gas concentration prediction result and the sample trend flow gas concentration prediction result.
[0128] Step C5: updating the model parameters of the dual-stream lightweight attention model according to the gas concentration loss value.
[0129] In the embodiment of the present application, the sample trend flow gas concentration prediction result is a vector composed of a cross entropy loss function containing concentration values at multiple times, which is the gas concentration prediction value output by the trend flow attention module at different times; similarly, the sample seasonal flow gas concentration prediction result is a vector composed of a cross entropy loss function containing concentration values at multiple times, which is the gas concentration prediction value output by the seasonal flow attention module at different times. Then, the sample trend flow gas concentration prediction and the sample seasonal flow gas concentration prediction results are weighted and summed to obtain the gas concentration loss value.
[0130] For example, the gas concentration loss value is expressed as:
[0131] ,
[0132] Where L represents the gas concentration loss value, is the cross entropy loss value of the trend flow attention module, is the cross entropy loss value of the seasonal flow attention module, is the loss weight of the trend flow attention module. In practical applications, the optimal loss weight can be determined by comparing the effects of multiple groups of different weighted sum weights (i.e., loss weights) on the gas concentration prediction accuracy.
[0133] For example, Figure 5 It is an architecture diagram of an indoor gas concentration prediction method for dynamic selection of environmental variables provided in an embodiment of the present application. The indoor gas concentration prediction method for dynamic selection of environmental variables includes a pre-processing task stage and a task flow stage. In the pre-processing task stage, the average value of the correlation coefficient between each environmental variable (such as flow rate, direction, temperature, humidity and pressure) and the target gas concentration is first calculated to obtain the average correlation coefficient of each environmental variable. Then, the environmental variables are sorted according to the size of the average correlation coefficient, and the target environmental variables for different prediction interval gas concentrations are dynamically selected from multiple environmental variables according to the sorting results. After that, the sample target environmental variables and the sample target gas concentration are encoded by the encoder to construct a sample label, and the sample target environmental variables and the sample target gas concentration are data enhanced and encoded to obtain a comparison sample, and the comparison sample and the sample label are used as a comparison learning sample pair. Features are extracted from the comparison learning sample pair by the seasonal feature extraction module and the trend feature extraction module to obtain sample trend features and sample seasonal features. Finally, the cross entropy of the sample trend features and sample seasonal features are calculated respectively, and the total loss value is obtained by weighted summation. The parameters of the encoder, seasonal feature extraction module and trend feature extraction module are learned by back-propagating the total loss.
[0134] In the task flow stage, the dual-stream lightweight attention model realizes gas concentration prediction and output. The dual-stream lightweight attention model consists of a trend flow attention module and a season flow attention module with the same structure. Taking the trend features and season features extracted in the preprocessing task stage as input, each stream in the dual-stream lightweight attention model inputs the trend features and season features respectively, and the gas concentration loss function output by the dual-stream attention model is weighted and summed to obtain the total loss function of gas concentration prediction. Then, the parameter learning of the dual-stream lightweight attention model is realized through back propagation, in which the weight parameters are selected by experience. When predicting gas concentration, the seasonal flow gas concentration prediction results output by the seasonal flow attention module and the trend flow gas concentration prediction results output by the trend flow attention module are weighted and summed to obtain the gas concentration prediction results.
[0135] The method provided in the embodiment of the present application takes into account the influence of environmental variables on the prediction accuracy of gas concentration at different prediction intervals. For the prediction of gas concentration at different prediction intervals, the number and type of environmental variables are dynamically selected through the average correlation coefficient of the environmental variables to fully capture the time series information, thereby achieving accurate gas concentration prediction based on the dynamically selected target environmental variables. In addition, the trend characteristics and seasonal characteristics respectively characterize the input time series information of different dimensions, so the gas concentration prediction is performed based on the trend characteristics and seasonal characteristics of the target environmental variables, further improving the accuracy of the gas concentration prediction results. In this way, a gas concentration prediction method that can accurately predict long time intervals is realized.
[0136] The present application also provides a device for predicting indoor gas concentration by dynamically selecting environmental variables, referring to Figure 6 As shown, Figure 6 : is a schematic diagram of the structure of an indoor gas concentration prediction device for dynamic selection of environmental variables provided in an embodiment of the present application, the device comprising:
[0137] A calculation module 610 is used to calculate the average correlation coefficient between each environmental variable and the target gas concentration to obtain the average correlation coefficient of each environmental variable;
[0138] A selection module 620, for sorting the environmental variables according to the magnitude of the average correlation coefficient, and dynamically selecting a target environmental variable for different prediction interval gas concentrations from the multiple environmental variables according to the sorting result;
[0139] An extraction module 630 is used to extract trend features and season features of the target environmental variable using a feature extraction network obtained through contrastive learning to obtain trend features and season features;
[0140] The prediction module 640 is used to input the trend characteristics and the seasonal characteristics into the dual-stream lightweight attention model to perform gas concentration prediction and obtain a gas concentration prediction result.
[0141] In an optional embodiment, the calculation module includes:
[0142] A first calculation submodule is used to calculate correlation coefficients of different offset intervals according to the environmental variable sequence and the target gas concentration sequence;
[0143] The second calculation submodule is used to calculate the average value of the correlation coefficients of the multiple groups of environmental variables at different offset intervals to obtain the average correlation coefficient of the environmental variables;
[0144] The third calculation submodule is used to calculate the average correlation coefficient of each environmental variable in turn according to the above steps to obtain the average correlation coefficient of each environmental variable.
[0145] In an optional embodiment, the feature extraction network includes: an encoder, a seasonal feature extraction module and a trend feature extraction module; the device includes a first training module for training the feature extraction network, and the first training module includes:
[0146] A sample module, used to encode the sample target environmental variables and the sample target gas concentration through the encoder to obtain a label sample, and to encode and perform data enhancement processing on the sample target environmental variables and the sample target gas concentration to obtain a comparison sample;
[0147] A first extraction and calculation module, used for extracting seasonal features from the label sample and the comparison sample through the seasonal feature extraction module, and calculating a seasonal feature cross entropy loss value according to the extracted seasonal features;
[0148] A second extraction and calculation module is used to extract trend features from the label sample and the comparison sample through the trend feature extraction module, and calculate the trend feature cross entropy loss value according to the extracted trend features;
[0149] The first updating module is used to perform weighted summation on the seasonal feature cross entropy loss value and the trend feature cross entropy loss value to obtain a total loss value, and update the parameters of the encoder, the parameters of the seasonal feature extraction module, and the parameters of the trend feature extraction module according to the total loss value.
[0150] In an optional embodiment, the seasonal feature extraction module includes: a Fourier transform module, a linear connection layer and an inverse Fourier transform module; the first extraction calculation module includes:
[0151] A first processing module is used to process the label sample to obtain a first complex vector, and to process the comparison sample to obtain a second complex vector, wherein the first complex vector and the second complex vector constitute a seasonal feature;
[0152] The fourth calculation submodule is used to calculate the amplitude loss and the phase loss according to the first complex vector and the second complex vector, and obtain the seasonal characteristic cross entropy loss value according to the amplitude loss and the phase loss.
[0153] In an optional embodiment, the trend feature extraction module includes: L layers of causal convolution and average pooling layer; the second extraction calculation module includes:
[0154] A second processing module is used to process the label sample to obtain a third complex vector, and to process the comparison sample to obtain a fourth complex vector, wherein the third complex vector and the fourth complex vector constitute a trend feature;
[0155] The fifth calculation submodule is used to calculate the trend feature loss according to the third complex vector and the fourth complex vector to obtain a trend feature cross entropy loss value.
[0156] In an optional embodiment, the dual-stream lightweight attention model includes: a trend stream attention module and a season stream attention module; the device includes a second training module for training the dual-stream lightweight attention model, and the second training module includes:
[0157] A first feature extraction module is used to extract features of sample target environmental variables through the feature extraction network to obtain sample trend features and sample season features;
[0158] A first sample prediction module, used for inputting the sample trend feature into the trend flow attention module for processing to obtain a sample trend flow gas concentration prediction result;
[0159] A second sample prediction module is used to input the sample seasonal characteristics into the seasonal flow attention module for processing to obtain a sample seasonal flow gas concentration prediction result;
[0160] A concentration loss calculation module, used for calculating a gas concentration loss value according to the sample trend flow gas concentration prediction result and the sample trend flow gas concentration prediction result;
[0161] The second updating module is used to update the model parameters of the dual-stream lightweight attention model according to the gas concentration loss value.
[0162] In an optional embodiment, the trend stream attention module and the season stream attention module have the same structure, and the trend stream attention module and the season stream attention module use multi-head sparse self-attention and attention distillation processing.
[0163] In an optional embodiment, the sample module includes:
[0164] A first adding processing module is used to encode and perform data enhancement processing on the sample target environmental variables and the sample target gas concentration according to a data enhancement processing method to obtain a comparison sample, wherein the data enhancement processing method includes: scaling processing, offset processing and noise adding processing;
[0165] The device also includes:
[0166] An inserting module, used for inserting the label sample and the comparison sample into a sample set as a comparison learning sample pair;
[0167] An acquisition module is used to obtain, after the current training is completed, comparative learning sample pairs for the next training from the sample set, wherein the data enhancement processing method of the comparative samples in the comparative learning sample pairs for the next training is different from the data enhancement processing method of the comparative samples in the comparative learning sample pairs for the current training.
[0168] The present application also provides an electronic device, referring to Figure 7 , Figure 7 Schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device 700 includes: a memory 710 and a processor 720. The memory 710 and the processor 720 are connected via a bus communication. A computer program is stored in the memory 710. The computer program can be run on the processor 720 to implement the steps of the indoor gas concentration prediction method for dynamic selection of environmental variables described in the embodiment of the present application.
[0169] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0170] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, apparatuses and devices according to the embodiments of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0171] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0172] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0173] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0174] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0175] The above is a detailed introduction to the indoor gas concentration prediction method, device and equipment for dynamic selection of environmental variables provided by the present application. This article uses specific examples to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A method for predicting indoor gas concentration by dynamically selecting environmental variables, characterized in that: The method comprises: Calculate the average value of the correlation coefficient between each environmental variable and the target gas concentration to obtain the average correlation coefficient of each environmental variable; Sorting the environmental variables according to the magnitude of the average correlation coefficient, and dynamically selecting a target environmental variable for predicting gas concentrations at different intervals from the plurality of environmental variables according to the sorting result; Using the feature extraction network obtained by contrastive learning, trend feature extraction and season feature extraction are performed on the target environmental variable to obtain trend features and season features; Inputting the trend characteristics and the seasonal characteristics into a dual-stream lightweight attention model to perform gas concentration prediction to obtain a gas concentration prediction result; The dual-stream lightweight attention model includes: a trend stream attention module and a season stream attention module; the dual-stream lightweight attention model is trained according to the following steps: Extracting features of sample target environmental variables through the feature extraction network to obtain sample trend features and sample seasonal features; Inputting the sample trend feature into the trend flow attention module for processing to obtain a sample trend flow gas concentration prediction result; Inputting the sample seasonal characteristics into the seasonal flow attention module for processing to obtain the sample seasonal flow gas concentration prediction result; Calculating a gas concentration loss value according to the sample trend flow gas concentration prediction result and the sample trend flow gas concentration prediction result; The model parameters of the dual-stream lightweight attention model are updated according to the gas concentration loss value.
2. The indoor gas concentration prediction method of dynamic selection of environmental variables according to claim 1 is characterized in that: Calculate the average correlation coefficient between each environmental variable and the target gas concentration to obtain the average correlation coefficient of each environmental variable, including: According to the environmental variable sequence and the target gas concentration sequence, the correlation coefficients at different offset intervals are calculated; Calculate the average of the correlation coefficients of multiple groups of environmental variables at different offset intervals to obtain the average correlation coefficient of the environmental variables; According to the above steps, the average correlation coefficient of each environmental variable is calculated in turn to obtain the average correlation coefficient of each environmental variable.
3. The indoor gas concentration prediction method with dynamic selection of environmental variables according to claim 1 is characterized in that: The feature extraction network includes: an encoder, a seasonal feature extraction module and a trend feature extraction module; the feature extraction network is trained according to the following steps: Encoding the sample target environmental variables and the sample target gas concentration by the encoder to obtain a label sample, and encoding and data enhancement processing the sample target environmental variables and the sample target gas concentration to obtain a comparison sample; By means of the seasonal feature extraction module, seasonal features are extracted from the label sample and the comparison sample, and a seasonal feature cross entropy loss value is calculated according to the extracted seasonal features; The trend feature extraction module is used to extract trend features from the label sample and the comparison sample, and a trend feature cross entropy loss value is calculated based on the extracted trend features; The seasonal feature cross entropy loss value and the trend feature cross entropy loss value are weightedly summed to obtain a total loss value, and the parameters of the encoder, the parameters of the seasonal feature extraction module, and the parameters of the trend feature extraction module are updated according to the total loss value.
4. The indoor gas concentration prediction method of dynamic selection of environmental variables according to claim 3 is characterized in that: The seasonal feature extraction module includes: a Fourier transform module, a linear connection layer and an inverse Fourier transform module; The seasonal feature extraction module is used to extract seasonal features from the label sample and the comparison sample, and the seasonal feature cross entropy loss value is calculated according to the extracted seasonal features, including: Processing the label sample to obtain a first complex vector, and processing the comparison sample to obtain a second complex vector, wherein the first complex vector and the second complex vector constitute a seasonal feature; According to the first complex vector and the second complex vector, an amplitude loss and a phase loss are calculated, and according to the amplitude loss and the phase loss, a seasonal characteristic cross entropy loss value is obtained.
5. The indoor gas concentration prediction method with dynamic selection of environmental variables according to claim 3 is characterized in that: The trend feature extraction module includes: L layers of causal convolution and average pooling layers; The trend feature extraction module is used to extract trend features from the label sample and the comparison sample, and a trend feature cross entropy loss value is calculated according to the extracted trend features, including: Processing the label sample to obtain a third complex vector, and processing the comparison sample to obtain a fourth complex vector, wherein the third complex vector and the fourth complex vector constitute a trend feature; A trend feature loss is calculated according to the third complex vector and the fourth complex vector to obtain a trend feature cross entropy loss value.
6. The indoor gas concentration prediction method with dynamic selection of environmental variables according to claim 1 is characterized in that: The trend stream attention module and the season stream attention module have the same structure, and the trend stream attention module and the season stream attention module use multi-head sparse self-attention and attention distillation processing.
7. The indoor gas concentration prediction method with dynamic selection of environmental variables according to claim 3 is characterized in that: The sample target environmental variables and the sample target gas concentrations are encoded and data enhanced to obtain a comparison sample, including: According to a data enhancement processing method, the sample target environmental variable and the sample target gas concentration are encoded and data enhanced to obtain a comparison sample, wherein the data enhancement processing method includes: scaling processing, offset processing, and noise addition processing; The method further comprises: Put the label sample and the comparison sample into a sample set as a comparison learning sample pair; After the current training is completed, comparative learning sample pairs for the next training are obtained from the sample set, and the data enhancement processing method of the comparative samples in the comparative learning sample pairs for the next training is different from the data enhancement processing method of the comparative samples in the comparative learning sample pairs used for the current training.
8. An indoor gas concentration prediction device with dynamic selection of environmental variables, characterized in that: The device comprises: A calculation module, used to calculate the average value of the correlation coefficient between each environmental variable and the target gas concentration, and obtain the average correlation coefficient of each environmental variable; A selection module, used for sorting the environmental variables according to the magnitude of the average correlation coefficient, and dynamically selecting a target environmental variable for different prediction interval gas concentrations from a plurality of environmental variables according to the sorting result; An extraction module, used to extract trend features and season features of the target environmental variables using a feature extraction network obtained through contrastive learning, to obtain trend features and season features; A prediction module, used for inputting the trend characteristics and the seasonal characteristics into a dual-stream lightweight attention model to perform gas concentration prediction and obtain a gas concentration prediction result; The dual-stream lightweight attention model includes: a trend stream attention module and a season stream attention module; the device includes a second training module for training the dual-stream lightweight attention model, and the second training module includes: A first feature extraction module is used to extract features of sample target environmental variables through the feature extraction network to obtain sample trend features and sample season features; A first sample prediction module, used for inputting the sample trend feature into the trend flow attention module for processing to obtain a sample trend flow gas concentration prediction result; A second sample prediction module is used to input the sample seasonal characteristics into the seasonal flow attention module for processing to obtain a sample seasonal flow gas concentration prediction result; A concentration loss calculation module, used for calculating a gas concentration loss value according to the sample trend flow gas concentration prediction result and the sample trend flow gas concentration prediction result; The second updating module is used to update the model parameters of the dual-stream lightweight attention model according to the gas concentration loss value.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the indoor gas concentration prediction method with dynamic selection of environmental variables as described in any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Air quality prediction method based on seasonal recurrent neural network
CN113240170A
Construction method of air pollutant concentration seasonal prediction model
CN114741972A
Indoor harmful gas concentration abnormity monitoring data processing method
CN116070163A
Air quality prediction method and system based on potential feature extraction
CN118036817A
KR1022848710000B1
