Air quality prediction method and system based on latent feature extraction

By decomposing air quality time series data into seasonal and trend components and extracting latent features using wavelet transform and Transformer models, the problem of low prediction accuracy in existing technologies is solved, achieving higher air quality prediction accuracy.

CN118036817BActive Publication Date: 2026-01-27SHANDONG YOU INTERNET OF THINGS CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410249185.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-03-05
Publication Date
2026-01-27
Estimated Expiration
2044-03-05

AI Technical Summary

Technical Problem

Existing air quality forecasting methods fail to fully utilize deep latent features when extracting features from seasonal and trend data, resulting in low prediction accuracy when data changes are complex.

Method used

Air quality time series data is decomposed into seasonal and trend components. Latent features are extracted using discrete wavelet transform and Transformer model, and then combined with a linear layer for prediction.

Benefits of technology

It significantly reduced the error in air quality data prediction and improved the accuracy of prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118036817B_ABST
    Figure CN118036817B_ABST
Patent Text Reader

Abstract

The application provides an air quality prediction method and system based on potential feature extraction, and belongs to the technical field of data processing. The prediction method comprises the following steps: performing time series decomposition on air quality time series data to obtain seasonal term data and trend term data; performing discrete wavelet transform on the seasonal term data to obtain a plurality of sub-sequences, performing potential feature extraction on all the obtained sub-sequences to obtain seasonal term potential features, and obtaining trend term potential features according to the trend term data; obtaining trend term prediction data in a future time period through a linear layer, performing inverse wavelet transform on the seasonal term potential features, obtaining seasonal term prediction data in the future time period through a linear layer, and taking the sum of the trend term prediction data and the seasonal term prediction data as an air quality prediction result in the future time period; and the application significantly reduces the error of air quality data prediction and improves the accuracy of air quality prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing technology, and in particular to an air quality prediction method and system based on latent feature extraction. Background Technology

[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.

[0003] With the acceleration of industrialization and urbanization, air pollution has become increasingly serious, and air quality is one of the main factors affecting public health. Therefore, accurate prediction of air quality conditions helps people cope with extreme weather, facilitates the implementation of more precise measures to improve environmental quality, and promotes sustainable development.

[0004] Air quality data is a typical time series, a set of values ​​arranged according to points in time, and contains information at multiple scales. At shorter time scales, such as hours or days, air quality data may show significant diurnal variation and periodicity, due to changes in human activities, such as transportation and production. At longer time scales, such as seasons or years, air quality values ​​may also show certain regularities; for example, winter heating may lead to increased concentrations of particulate matter in the air, while the high temperatures of summer may lead to increased ozone concentrations.

[0005] The inventors discovered that most existing methods simply preprocess air quality data before making predictions. Although some algorithms take into account the seasonality and trends in air quality data, they do not fully extract deep-seated potential features when extracting seasonal and trend data. When the data changes are complex, they cannot fully utilize the data information, resulting in low prediction accuracy. Summary of the Invention

[0006] To address the shortcomings of existing technologies, this invention provides an air quality prediction method and system based on latent feature extraction. It models seasonal and trend data separately, fully extracts deep latent features at various scales, significantly reduces the error in air quality data prediction, and improves the accuracy of air quality prediction.

[0007] To achieve the above objectives, the present invention adopts the following technical solution:

[0008] In a first aspect, the present invention provides an air quality prediction method based on latent feature extraction.

[0009] An air quality prediction method based on latent feature extraction includes the following process:

[0010] Time series data of air quality are decomposed into seasonal data and trend data.

[0011] The seasonal data is subjected to discrete wavelet transform to obtain multiple subsequences. Latent features are extracted from all the subsequences to obtain the latent features of the seasonal data. The latent features of the trend data are obtained from the trend data.

[0012] The trend prediction data for a certain future time period is obtained through a linear layer. The latent features of the seasonal term are then subjected to inverse wavelet transform. The seasonal prediction data for a certain future time period is obtained through a linear layer. The sum of the trend prediction data and the seasonal prediction data is used as the air quality prediction result for a certain future time period.

[0013] As a further limitation of the first aspect of the present invention, before performing time-series decomposition on the air quality time series data, the following process is also included:

[0014] The K-nearest neighbor algorithm was used to process the missing values ​​in the acquired air quality time series data, and the air quality time series data after missing value processing was used for time series decomposition.

[0015] As a further limitation of the first aspect of the present invention, the air quality time series data is decomposed into time series components, including:

[0016] The air quality time series data is padded at both ends to fit the size of the average pooling window. The tensor of the padded air quality time series data is passed to the average pooling layer. After average pooling, the trend data is obtained. The seasonal data is obtained by subtracting the trend data from the air quality time series data.

[0017] As a further limitation of the first aspect of the present invention, latent feature extraction is performed on all the obtained subsequences to obtain latent features of seasonal terms, including: sending each obtained subsequence into a Transformer containing only an encoder for latent feature extraction.

[0018] As a further limitation of the first aspect of the present invention, obtaining potential features of trend terms based on trend term data includes: using a linear layer to extract potential features from the trend term data.

[0019] As a further limitation of the first aspect of the present invention, the air quality time series data includes data on at least one of soot, total suspended particulate matter, inhalable suspended particulate matter, nitrogen dioxide, sulfur dioxide, carbon monoxide, ozone, and volatile organic compounds.

[0020] Secondly, the present invention provides an air quality prediction system based on latent feature extraction.

[0021] An air quality prediction system based on latent feature extraction includes:

[0022] The time series decomposition module is configured to decompose the air quality time series data into seasonal and trend data.

[0023] The latent feature extraction module is configured to: perform discrete wavelet transform on the seasonal data to obtain multiple subsequences, extract latent features from all the obtained subsequences to obtain the latent features of the seasonal data, and obtain the latent features of the trend data.

[0024] The air quality prediction module is configured to: obtain trend prediction data for a future time period through a linear layer, perform inverse wavelet transform on the latent features of the seasonal term, obtain seasonal prediction data for a future time period through a linear layer, and use the sum of the trend prediction data and the seasonal prediction data as the air quality prediction result for a future time period.

[0025] As a further limitation of the second aspect of the present invention, in the time series decomposition module, the K-nearest neighbor algorithm is used to process the missing values ​​of the acquired air quality time series data, and the air quality time series data after missing value processing is used for time series decomposition.

[0026] As a further limitation of the second aspect of the present invention, the time-series decomposition module performs time-series decomposition on the air quality time-series data, including:

[0027] The air quality time series data is padded at both ends to fit the size of the average pooling window;

[0028] The tensor of the filled air quality time series data is passed to the average pooling layer. After average pooling, the trend data is obtained. The seasonal data is obtained by subtracting the trend data from the air quality time series data.

[0029] As a further limitation of the second aspect of the present invention, in the latent feature extraction module, latent feature extraction is performed on all the obtained sub-sequences to obtain the latent features of the seasonal item, including: sending each obtained sub-sequence into a Transformer containing only an encoder for latent feature extraction.

[0030] As a further limitation of the second aspect of the present invention, in the latent feature extraction module, obtaining the latent features of the trend items based on the trend item data includes: using a linear layer to extract the latent features in the trend item data.

[0031] As a further limitation of the second aspect of the present invention, the air quality time series data in the time series decomposition module includes at least one of smoke, total suspended particulate matter, inhalable suspended particulate matter, nitrogen dioxide, sulfur dioxide, carbon monoxide, ozone and volatile organic compounds.

[0032] Thirdly, the present invention provides a computer-readable storage medium having a program stored thereon, which, when executed by a processor, implements the steps in the air quality prediction method based on latent feature extraction as described in the first aspect of the present invention.

[0033] Fourthly, the present invention provides an electronic device including a memory, a processor, and a program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps in the air quality prediction method based on latent feature extraction as described in the first aspect of the present invention.

[0034] Fifthly, the present invention provides a computer program product comprising a computer program that, when executed by a processor, implements the steps in the air quality prediction method based on latent feature extraction as described in the first aspect of the present invention.

[0035] Compared with the prior art, the beneficial effects of the present invention are:

[0036] 1. This invention innovatively proposes an air quality prediction strategy based on latent feature extraction, which models seasonal and trend data separately, fully extracts deep latent features at various scales, significantly reduces the error of air quality data prediction, and improves the accuracy of air quality prediction.

[0037] 2. This invention innovatively proposes an air quality prediction strategy based on latent feature extraction. From a multi-scale perspective, the seasonal term sequence is transformed into the wavelet domain for analysis, and the original Transformer model is improved by designing a wavelet domain encoder containing only an encoder, which fully extracts deep latent features at various scales and further improves the accuracy of air quality prediction.

[0038] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0039] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.

[0040] Figure 1 A flowchart of the air quality prediction method based on latent feature extraction provided in Embodiment 1 of the present invention;

[0041] Figure 2 This is a flowchart of missing value processing provided in Embodiment 1 of the present invention;

[0042] Figure 3 This is a flowchart of multi-scale analysis (wavelet decomposition) provided in Embodiment 1 of the present invention;

[0043] Figure 4 This is a flowchart of the extraction of latent features for seasonal items provided in Embodiment 1 of the present invention;

[0044] Figure 5 This is a flowchart of the process for extracting latent features of trend items provided in Embodiment 1 of the present invention;

[0045] Figure 6 This is a flowchart of the prediction result output provided in Embodiment 1 of the present invention;

[0046] Figure 7 This is a schematic diagram of the electronic device provided in Embodiment 4 of the present invention. Detailed Implementation

[0047] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0048] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.

[0049] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.

[0050] Example 1:

[0051] like Figure 1 As shown, Embodiment 1 of the present invention provides an air quality prediction method based on latent feature extraction. The technical terms and related concepts involved in this processing scheme will be briefly introduced below, wherein:

[0052] Time series data is data collected at different times to describe how a phenomenon changes over time. This type of data reflects the state or extent of change of a thing or phenomenon over time.

[0053] Wavelet Transform (WT) is a novel transform analysis method that inherits and develops the localization concept of the Short-Time Fourier Transform while overcoming shortcomings such as the window size not changing with frequency. It provides a frequency-varying "time-frequency" window, making it an ideal tool for signal time-frequency analysis and processing. Its main characteristics are its ability to fully highlight certain features of a problem through transformation, its capacity for localized analysis of time (space) and frequency, and its ability to progressively refine the signal (function) at multiple scales through scaling and translation operations, ultimately achieving time subdivision at high frequencies.

[0054] The core idea of ​​the K-Nearest Neighbors algorithm is that if a sample's K nearest neighbors in the feature space mostly belong to a certain class, then the sample also belongs to that class and possesses the characteristics of samples in that class. This method determines the classification decision based solely on the class of its one or a few nearest neighbors, considering only a very small number of neighboring samples.

[0055] Average pooling is a commonly used pooling method in computer vision and deep learning. It performs pooling by calculating the average of all pixel values ​​within a window of the input feature map. This pooling method retains more background information because it calculates the average of the pixel values ​​within the window, rather than retaining only the maximum value like max pooling. Average pooling is often used to reduce the dimensionality of feature maps while preserving useful information, especially when it's important to focus on background details.

[0056] Euclidean distance generally refers to Euclidean metric. In mathematics, Euclidean distance or Euclidean metric is the "ordinary" (i.e., straight-line) distance between two points in Euclidean space. Using this distance, Euclidean space becomes a metric space.

[0057] The Transformer model, proposed by Google, is a deep learning model based on a self-attention mechanism. It's used to process sequential data such as text, speech signals, images, or videos. A key feature of the Transformer model is its parallel computing capability; it can process all input data at once, unlike RNNs which process each word individually. This architecture allows for more parallel computation, thereby reducing training time. The core of the Transformer model is its self-attention mechanism, which assigns a weight to each position in the input sequence and then outputs a vector of these weighted positions.

[0058] The air quality prediction method based on latent feature extraction described in this invention specifically includes the following processes:

[0059] S1: After removing missing values ​​from the air quality time series data, perform time series decomposition to obtain seasonal and trend data.

[0060] The air quality time series data can be one or a combination of data from smoke and dust, total suspended particulate matter, inhalable suspended particulate matter, nitrogen dioxide, sulfur dioxide, carbon monoxide, ozone and volatile organic compounds, and can be selected as needed.

[0061] S2: Perform discrete wavelet transform on the seasonal data to obtain multiple subsequences. Extract latent features from all the obtained subsequences to obtain the latent features of the seasonal data. Obtain the latent features of the trend data based on the trend data.

[0062] S3: Obtain trend prediction data for a certain future time period through a linear layer, perform inverse wavelet transform on the latent features of the seasonal term, obtain seasonal prediction data for a certain future time period through a linear layer, and use the sum of the trend prediction data and the seasonal prediction data as the air quality prediction result for a certain future time period.

[0063] In S1, missing value handling specifically includes:

[0064] The original air quality time series data is defined as X={x1,x2,·…·,x N}∈D N Where N is the Nth day, and if the data x on the i-th day is... i If there are missing values, the K-nearest neighbor algorithm is needed to estimate them. This invention can estimate the value of a given time point by calculating the values ​​of other time points x. j The K nearest neighbors are found by Euclidean distance, as shown in equation (1). For each nearest neighbor x j A weight w is calculated based on the distance. j , where d ij Indicates missing value x i and nearest neighbor x j The distances between them and the weights are calculated as shown in equation (2). Finally, the estimated value of the missing value can be calculated based on the weights of the K nearest neighbors. As shown in equation (3), the specific process is as follows: Figure 2 As shown, this method estimates missing values ​​based on the similarity of existing data points, which largely preserves the original structure and relationships of the data. Then, the present invention divides the training set, validation set and test set in a ratio of 6:2:2.

[0065]

[0066]

[0067]

[0068] In S1, the timing decomposition specifically includes:

[0069] Moving average decomposition is a method used in time series analysis, aiming to decompose a time series into different components to better understand its internal structure and patterns. The core idea of ​​this method is to identify and extract these components in the time series by calculating moving averages. This invention decomposes the time series into two components: seasonal and trend components. As shown in equations (4) and (5), where X s X is a seasonal term. t This represents the trend.

[0070] X t =avgPool1d(X) (4);

[0071] X s =XX t (5);

[0072] First, the input data X is padded at both ends of the time series to fit the size of the average pooling window; then, the tensor is passed to the average pooling layer, and the result X after highlighting the trend is returned after average pooling. t AvgPool1d is the average pooling layer, with a kernel size set to 25 and a stride of 1. The trend data X is subtracted from the original sequence X. t The remaining part is the seasonal data X. s .

[0073] In S2, latent feature extraction specifically includes:

[0074] By using a moving average decomposition algorithm, seasonal and trend data were obtained. To better extract the latent features of the data, for the seasonal data, this invention adopts a multi-scale perspective, transforming the original seasonal data X... s Discrete wavelet transform is performed. Wavelet transform is used to process seasonal data, which can transform time-domain data into wavelet-domain data. By decomposing, wavelet coefficients of different scales and frequency bands are obtained, thus providing multi-scale signal analysis, as shown in equations (6) and (7). The wavelet transform process is as follows: Figure 3 As shown.

[0075]

[0076]

[0077] Where cA represents the low-frequency component after wavelet decomposition, cD represents the high-frequency component after wavelet decomposition, and s represents the scale. n In this context, n represents the number of decompositions, L represents the length of the subsequence after n decompositions, and * represents the convolution operation. Each transformation of g and h will result in a convolution with cA. n-1Convolution operations are performed, and after each wavelet transform, the sequence length becomes half of the previous layer. After the wavelet transform, the resulting subsequences are cD1, cD2, cD3, and cA3. Then, each subsequence is fed into a Transformer containing only an encoder for latent feature extraction.

[0078] This invention mainly utilizes the self-attention mechanism in Transformer for encoding. Through this mechanism, the scale information of each refined sequence can be effectively extracted and long-term dependencies can be modeled. In the attention mechanism, firstly, the query matrix Q, key matrix K and value matrix V are obtained through linear transformation. After dot product scaling, the attention score between Q and K is calculated. Then, the attention weight is obtained by using the softmax function, and finally the weighted V is obtained, as shown in Equation (8). The Transformer model uses multiple parallel self-attention mechanisms to form a "multi-head" structure to improve the model's expressive and learning capabilities. This invention concatenates the results of each set of self-attention and performs a linear transformation to obtain the final attention output result, as shown in Equation (9).

[0079]

[0080] MultiHeadAttn(Q,K,V)=Concat(head1,…,head H W O (9);

[0081] FFN(H′)=ReLU(H′W 1 +b 1 W 2 +b 2 (10);

[0082] Among them, head i =Attention(QW i Q ,KW i K VW i V Then, the mapping relationship is learned through the feedforward neural network FFN(·), as shown in equation (10), and the features are further abstracted and combined. H′ is the output of the previous layer. These are trainable parameters. Q, K, and V are common matrices in Transformer models, representing the query matrix, key matrix, and value matrix, respectively. i represents the i-th attention head, W is the weight matrix of the attention output, and O stands for Output. Finally, the extracted latent seasonal features H are obtained. s , Figure 4 This is a flowchart of the model's framework.

[0083] In this invention, Transformer introduces a multi-head self-attention mechanism. Here, the model uses multiple independent self-attention mechanisms, each called a head. Each head learns different relationships and features, and then the outputs of these heads are concatenated or weighted and summarized to obtain the final self-attention representation.

[0084] For trend term data, the trend term describes the overall trend and change of the time series over a long period. Trends are generally relatively easy to identify and model, especially when the time series has a clear trend, such as a gradual increase or decrease over time. The complexity of the trend depends on the nature of the trend itself, and it is usually not necessary to consider multiple periods or frequencies, so only a single linear layer is used to process the latent feature X′. t The extraction is shown in equation (11), and the process is as follows: Figure 5 As shown;

[0085] X′ t =Linear(X) t (11).

[0086] In S3, the generation of air quality prediction results specifically includes:

[0087] According to equation (12), the inverse wavelet transform is performed to obtain the representation in the time domain:

[0088] X′ s =IDWT(H s (12).

[0089] Predicting seasonal data X′ using a linear layer s and trend data X′ t Adding the two parts together yields the final predicted data Y, as shown in equation (13):

[0090] Y = Linear(X′) s )+Linear(X′ t (13);

[0091] Where Y is the prediction result, X′ s , X′ t The process for representing the latent characteristics of seasonal and trend data is as follows: Figure 6 As shown.

[0092] Air quality data is a typical time series data, and its prediction is a regression problem. Therefore, this invention uses several evaluation indicators for regression problems, including: Mean Squared Error (MSE), which is the mean of the squares of the differences between the predicted and actual values. The smaller the MSE, the closer the prediction result is to the actual value. The formula for calculating the MSE is shown in Equation (14); Root Mean Squared Error (RMSE) is the square root of the MSE. Its value, like the MSE, is a standard indicator for measuring prediction error. The formula for calculating the RMSE is shown in Equation (15); Mean Absolute Error (MAE) is the mean of the absolute values ​​of the differences between the predicted and actual values. The smaller the MAE, the closer the prediction result is to the actual value. The formula for calculating the MAE is shown in Equation (16); where y i Let i be the actual value at time i. Let be the predicted value at time i, and n be the prediction length.

[0093]

[0094]

[0095]

[0096] The method of this invention was compared with probabilistic autoregressive networks (DeepAR), long short-term time series networks (LSTNet), and bidirectional long short-term memory networks (Bi-LSTM). The method achieved the lowest values ​​in all three evaluation metrics, outperforming the comparison methods and demonstrating the effectiveness of the method of this invention.

[0097] Example 2:

[0098] Embodiment 2 of the present invention provides an air quality prediction system based on latent feature extraction, comprising:

[0099] The time series decomposition module is configured to perform time series decomposition on the air quality time series data to obtain seasonal data and trend data. The specific operation of the time series decomposition module is the same as step S1 in Example 1, and will not be repeated here.

[0100] The latent feature extraction module is configured to: perform discrete wavelet transform on the seasonal data to obtain multiple subsequences, extract latent features from all the obtained subsequences to obtain latent features of the seasonal data, and obtain latent features of the trend data. The specific operation of the latent feature extraction module is the same as step S2 in Example 1, and will not be repeated here.

[0101] The air quality prediction module is configured to: obtain trend prediction data for a certain future time period through a linear layer, perform wavelet inverse transform on the latent features of the seasonal term, obtain seasonal prediction data for a certain future time period through a linear layer, and use the sum of the trend prediction data and the seasonal prediction data as the air quality prediction result for a certain future time period; the specific operation of the air quality prediction module is the same as step S3 in Example 1, and will not be repeated here.

[0102] It is understood that the aforementioned modules can be individually or entirely merged into one or more other units, or some of these units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The aforementioned units are based on logical functional division. In practical applications, the function of one unit can be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the image processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0103] According to another embodiment of this application, the system described in this embodiment and the image processing method of this application embodiment can be implemented by running a computer program (including program code) capable of performing the steps involved in the corresponding method described in Embodiment 1 on a general-purpose computing device including processing elements and storage elements such as a computer, a central processing unit (CPU), a random access memory (RAM), and a read-only memory (ROM). The computer program can be recorded on, for example, a computer-readable recording medium, loaded into the aforementioned computing device through the computer-readable recording medium, and run therein.

[0104] Example 3:

[0105] This embodiment provides a computer-readable storage medium (Memory), which is a memory device in an electronic device used to store programs and data. It is understood that the computer-readable storage medium here can include both built-in storage media in the electronic device and extended storage media supported by the electronic device. The computer-readable storage medium provides storage space that stores the processing system of the electronic device.

[0106] Furthermore, this storage space also contains one or more instructions suitable for loading and execution by the processor. These instructions can be one or more computer programs (including program code). It should be noted that the computer-readable storage medium here can be high-speed RAM memory or non-volatile memory, such as at least one disk storage device; optionally, it can also be at least one computer-readable storage medium located remotely from the aforementioned processor.

[0107] In one embodiment, the computer-readable storage medium stores one or more instructions; the processor loads and executes one or more instructions stored in the computer-readable storage medium to implement the corresponding steps in the method embodiment described in Embodiment 1 above.

[0108] Example 4:

[0109] Embodiment 4 of the present invention provides an electronic device, which includes a processor 1001, a communication interface 1002, and a computer-readable storage medium 1003. The processor 1001, the communication interface 1002, and the computer-readable storage medium 1003 can be connected via a bus or other means.

[0110] The communication interface 1002 is used to receive and send data. The computer-readable storage medium 1003 can be stored in the memory of the electronic device. The computer-readable storage medium 1003 is used to store computer programs, which include program instructions. The processor 1001 is used to execute the program instructions stored in the computer-readable storage medium 1003.

[0111] The processor 1001 (or CPU (Central Processing Unit)) is the computing and control core of the electronic device. It is suitable for implementing one or more instructions, specifically for loading and executing one or more instructions to realize the process or corresponding function of the method described in Embodiment 1.

[0112] Example 5:

[0113] This embodiment provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the electronic device to perform the method described in Embodiment 1.

[0114] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed in this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0115] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in or transmitted through a computer-readable storage medium. The computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data processing device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

[0116] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. An air quality prediction method based on latent feature extraction, characterized in that, Includes the following processes: Time series data of air quality are decomposed into seasonal data and trend data. The seasonal data is subjected to discrete wavelet transform to obtain multiple subsequences. Latent features are extracted from all the subsequences to obtain the latent features of the seasonal data. The latent features of the trend data are obtained from the trend data. Predicting trend terms by using linear layers to predict latent features of trend terms yields predicted trend term data for a future time period. After performing inverse wavelet transform on the latent features of the seasonal term, the predicted data of the seasonal term for a certain period of time in the future is obtained through linear layer prediction. The sum of the predicted data of the trend term and the predicted data of the seasonal term is used as the air quality prediction result for a certain period of time in the future. The air quality time series data is decomposed into seasonal and trend data, including: The air quality time series data is padded at both ends to fit the size of the average pooling window; The tensor of the filled air quality time series data is passed to the average pooling layer. After average pooling, the trend data is obtained. The seasonal data is obtained by subtracting the trend data from the air quality time series data. Latent feature extraction is performed on all the obtained subsequences to obtain the latent features of the seasonal term, including: feeding each obtained subsequence into a Transformer containing only an encoder for latent feature extraction; Obtaining latent features of trend items from trend item data includes: using a linear layer to extract latent features from trend item data; Air quality time series data include data on at least one of the following: smoke, total suspended particulates, inhalable suspended particulates, nitrogen dioxide, sulfur dioxide, carbon monoxide, ozone, and volatile organic compounds.

2. The air quality prediction method based on latent feature extraction as described in claim 1, characterized in that, Before performing time-series decomposition on the air quality time series data, Includes the following processes: The K-nearest neighbor algorithm was used to process the missing values ​​in the acquired air quality time series data, and the air quality time series data after missing value processing was used for time series decomposition.

3. An air quality prediction system based on latent feature extraction, characterized in that, include: The time series decomposition module is configured to decompose the air quality time series data into seasonal and trend data. The latent feature extraction module is configured to: perform discrete wavelet transform on the seasonal data to obtain multiple subsequences, extract latent features from all the obtained subsequences to obtain the latent features of the seasonal data, and obtain the latent features of the trend data. The air quality prediction module is configured to: obtain trend prediction data for a future time period by predicting the potential features of trend terms through a linear layer; After performing inverse wavelet transform on the latent features of the seasonal term, the predicted data of the seasonal term for a certain period of time in the future is obtained through linear layer prediction. The sum of the predicted data of the trend term and the predicted data of the seasonal term is used as the air quality prediction result for a certain period of time in the future. The air quality time series data is decomposed into seasonal and trend data, including: The air quality time series data is padded at both ends to fit the size of the average pooling window; The tensor of the filled air quality time series data is passed to the average pooling layer. After average pooling, the trend data is obtained. The seasonal data is obtained by subtracting the trend data from the air quality time series data. Latent feature extraction is performed on all the obtained subsequences to obtain the latent features of the seasonal term, including: feeding each obtained subsequence into a Transformer containing only an encoder for latent feature extraction; Obtaining latent features of trend items from trend item data includes: using a linear layer to extract latent features from trend item data; Air quality time series data include data on at least one of the following: smoke, total suspended particulates, inhalable suspended particulates, nitrogen dioxide, sulfur dioxide, carbon monoxide, ozone, and volatile organic compounds.

4. The air quality prediction system based on latent feature extraction as described in claim 3, characterized in that, In the time series decomposition module, the K-nearest neighbor algorithm is used to process missing values ​​in the acquired air quality time series data, and the air quality time series data after missing value processing is used for time series decomposition.

5. A computer-readable storage medium having a program stored thereon, characterized in that, When executed by a processor, the program implements the steps in the air quality prediction method based on latent feature extraction as described in any one of claims 1-2.

6. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the air quality prediction method based on latent feature extraction as described in any one of claims 1-2.

7. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the steps in the air quality prediction method based on latent feature extraction as described in any one of claims 1-2.

Citation Information

Patent Citations

  • Air quality prediction method based on seasonal recurrent neural network

    CN113240170A