An Improved Air Quality Prediction Method Based on Quantum Activation Functions

By constructing an HQCNN-LSTM model based on the QRELU activation function and combining quantum computing and classical computing, the problems of long training time and low accuracy in air quality prediction models are solved, and more efficient air quality prediction is achieved.

CN117787339BActive Publication Date: 2026-11-17CHONGQING NORMAL UNIVERSITY
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311800681.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2026-11-17
Estimated Expiration
2043-12-25

AI Technical Summary

Technical Problem

Existing air quality prediction models, especially hybrid neural network models based on the ReLU activation function, suffer from long training times and low accuracy. Furthermore, the ReLU function can easily lead to permanent neuron death, affecting network updates and prediction accuracy.

Method used

We employ an HQCNN-LSTM model based on the QRELU activation function, combining quantum convolutional layers and classical convolutional layers. By leveraging the superposition and parallel computing capabilities of quantum computing, we extract features from air quality data and utilize the gating mechanism of LSTM for training to optimize the model's prediction accuracy.

Benefits of technology

It improves the accuracy and stability of air quality prediction, solves the neuron death problem caused by the ReLU function, enhances the model's ability to learn local features of air quality, and improves prediction accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117787339B_ABST
    Figure CN117787339B_ABST
Patent Text Reader

Abstract

This invention relates to the field of air quality prediction technology, specifically to an air quality prediction method based on an improved quantum activation function. The method includes: constructing a QRELU-HQCNN-LSTM model; extracting features from time-series data through a combination of quantum convolutional layers and classical Conv layers with ReLU functions; the quantum convolutional layer comprising an RY rotation gate, VQC encoding, and decoding with Pauli-Z gates; combining classical Conv layers with max-pooling layers; each max-pooling layer followed by a dropout layer; flattening the data using a flattening layer and feeding it into a single-layer LSTM for training; and outputting the result through an output layer. In this scheme, to efficiently extract features, a hybrid quantum neural network (HQCNN) is used, and the QRELU activation function is employed to improve accuracy. Furthermore, the LSTM utilizes gate functions to regulate the memory and forgetting of previous data, making it ideal for processing long-term sequence data and improving detection accuracy. This makes the QRELU-HQCNN-LSTM algorithm model suitable for 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 air quality prediction technology, and specifically to an air quality prediction method based on an improved quantum activation function. Background Technology

[0002] Monitoring and predicting air quality is crucial for mitigating air pollution and environmental degradation. However, the sheer volume of data presents both new opportunities and challenges in fully utilizing this data. Air quality is typically influenced by multiple factors, exhibiting stochastic and nonlinear characteristics. Therefore, in-depth research into the patterns of air quality variation and the development of efficient air quality index (AQI) prediction models have become urgent needs for improving prediction accuracy and the effectiveness of air pollution control. Advances in machine learning algorithms and quantum computing offer potential possibilities for creating accurate and precise air quality prediction models. With the continuous advancement of quantum technology, noisy mesoscale quantum computers (NISQs) have begun to handle some relatively complex computational tasks, and in some tasks, their computational power has surpassed that of traditional classical computers. Currently, quantum algorithms primarily focus on the implementation of NISQ devices, providing new directions for research on some classical computational problems.

[0003] Currently, air quality prediction modeling is mainly divided into linear regression models and neural network models. However, linear regression models only have good prediction results for systems with linear relationships. Traditional hybrid neural network models, such as CNN-LSTM neural networks with ReLU activation functions, suffer from slow training time and low accuracy. Due to the superposition of quantum states and parallel computing capabilities, quantum computers have significantly higher computational efficiency than traditional classical computers. Furthermore, combining the advantages of quantum computing and LSTM allows quantum computers to exhibit superior performance. Quantum Machine Learning (QML) is an emerging field that combines the potential of quantum computing with the progress of machine learning in overcoming the limitations of classical computing. When running on quantum hardware, Quantum Machine Learning (QML) not only reduces the computational cost compared to classical algorithms but also finds the global minimum with a higher probability in the solutions sought in machine learning.

[0004] Therefore, the applicant proposed a classical quantum neural network combining the QRELU activation function to address these issues. While the RELU function, compared to the sigmoid function, avoids gradient vanishing during backpropagation, masks negative values, and prevents gradient saturation, it also has its own drawbacks. This is because, according to the formula for updating neural network weights, w1 = w - ηΔw, where w1 is the updated weight, w is the current weight, η represents the learning rate, and Δw represents the gradient of the current parameters obtained by differentiation (generally a positive value). When the learning rate is too large, the ηΔw term becomes very large. When ηΔw is greater than w, the updated weight w1 becomes negative. When the weight becomes negative, the positive value input to the network will be multiplied by the weight, also becoming negative. After passing through RELU, the negative value will output 0. If w has a chance to be updated to a positive value later, there won't be a major problem. However, when the RELU function outputs 0, the derivative of RELU is also 0, which will cause Δw to remain 0, preventing w from being updated and ultimately causing the neuron to permanently die (constantly outputting 0). In summary, when the learning rate is too high, some neurons may die permanently, which is called "dying ReLU", causing the network to be unable to update normally in the later stages. Summary of the Invention

[0005] This invention provides an improved air quality prediction method based on quantum activation functions, which solves the technical problem of low prediction accuracy.

[0006] The basic solution provided by this invention is: an air quality prediction method based on quantum activation function improvement, comprising the following steps:

[0007] Constructing a QRELU-HQCNN-LSTM model: Features are extracted from time series data through a combination of quantum convolutional layers and classical Conv layers with ReLU functions. The quantum convolutional layer consists of three parts: RY rotation gate, VQC encoding, and decoding with Pauli-Z gate. Classical Conv layers are used in combination with max pooling layers. Each max pooling layer is followed by a dropout layer. The data is flattened by a flattening layer and fed into a single-layer LSTM layer for training. The output is then output through the output layer.

[0008] Air quality is predicted based on the QRELU-HQCNN-LSTM model, as detailed below:

[0009] Step 1: Input data;

[0010] Step 2: Data preprocessing;

[0011] Step 3: Send the preprocessed data to the quantum convolutional layer for feature extraction, prepare quantum states, obtain training and test sets, construct a hybrid quantum-classical convolutional neural network and use the QRELU activation function in the convolutional layer, set the batch size, epoch and learning rate, perform unitary transformation on the quantum system, and then integrate all local features to form the overall features through a fully connected layer;

[0012] Step 4: Input the features extracted by HQCNN into LSTM for training;

[0013] Step 5: Calculate the loss value and gradient, and update the parameters based on the gradient and learning rate;

[0014] Step 6: Output the prediction results.

[0015] Furthermore, the kernel size of each max-pooling layer is 2×2, and the stride is equal to 2.

[0016] Furthermore, in step 2, data preprocessing is performed, including missing values, exponential smoothing, and data normalization operations.

[0017] Furthermore, in step 2, the data is preprocessed, including using natural logarithm homogenization.

[0018] The working principle and advantages of this invention are as follows:

[0019] 1. In this scheme, in order to extract features efficiently, HQCNN hybrid quantum neural network is used and QRELU activation function is used to improve accuracy. In addition, LSTM utilizes gate function to regulate the memory and forgetting of previous data, making it an ideal choice for processing long-term sequence data and improving detection accuracy. This makes the QRELU-HQCNN-LSTM algorithm model suitable for air quality prediction.

[0020] 2. This hybrid quantum-classical convolutional computation model consists of two main parts: a quantum computing part and a classical computing part. The quantum computing part includes quantum convolutional layers with parameterized variable quantum circuit design to realize the linear unitary transformation of quantum states. The parameterized variable quantum circuit is utilized to leverage the potential of quantum computing. Next, features from time-series data are extracted through an HQCNN network and trained through an LSTM network to obtain the final output. The final output data format is converted to generate predicted values. In this way, the QRELU activation function enhances the ability of the HQCNN-LSTM neural network to learn the importance of local features of air quality, effectively improving the prediction accuracy of the model.

[0021] This invention enhances the ability of the HQCNN-LSTM neural network to learn the importance of local features of air quality by using the QRELU activation function, effectively improving prediction accuracy and solving the technical problem of low prediction accuracy. Attached Figure Description

[0022] Figure 1 This is a diagram of LSTM cells.

[0023] Figure 2 This is a typical architecture for hybrid quantum-classical neural networks.

[0024] Figure 3 It is a quantum neural network architecture.

[0025] Figure 4 This is a diagram of a convolution circuit.

[0026] Figure 5 This is a common quantum circuit design diagram.

[0027] Figure 6 The activation curve for QReLU.

[0028] Figure 7 This is a diagram of the HQCNN-LSTM architecture.

[0029] Figure 8 This is a diagram of the QRELU-HQCNN-LSTM architecture.

[0030] Figure 9 A bar chart comparing various indicators of different circuits.

[0031] Figure 10 The graph shows the prediction performance curves of CNN-LSTM and QRELU-HQCNN-LSTM.

[0032] Figure 11 A graph comparing the model prediction results.

[0033] Figure 12 Bar chart.

[0034] Figure 13 The prediction results curves of HQCNN-LSTM optimized for different activation functions are shown in the figure.

[0035] Figure 14 For. A histogram showing the ratio of various metrics for different activation functions. Detailed Implementation

[0036] The following detailed explanation illustrates the specific implementation methods:

[0037] Example 1

[0038] Before discussing the embodiments, the applicant discusses the relevant knowledge required to better understand the technical solution.

[0039] 1. Fundamentals of Quantum Machines

[0040] Quantum machines (QC) rely on the assumptions and characteristics of quantum mechanics (i.e., qubits, interference, superposition, and entanglement) for information processing. QC enables solving complex problems better and faster than classical computing. A qubit is a small unit of information processing in a quantum computer, much like a bit in classical computing. A qubit can simultaneously exist in a single state, a zero state, or both, a phenomenon known as linear superposition. A qubit is a state vector in Hilbert space.

[0041]

[0042] Where θ and δ are probability magnitudes represented by complex numbers, |θ 2 |+|δ 2 |=1.

[0043] From a quantum mechanical perspective, any unitary transformation (unitary matrix) can be considered a quantum gate. For this matrix (U) to be unitary, the following condition must be verified:

[0044] UU + =U + U = I,

[0045] Among them, U + Let I be the conjugate transpose of matrix U, and I be the identity matrix. Quantum gates can be classified according to the number of qubits: one-qubit gates, two-qubit gates, and multi-qubit gates. First, the most popular and widely used single-qubit gate is the square root of the Hadamard gate, or NOT gate. The Hadamard gate is used to create a superposition state between two qubits. The Pauli gate is also a single-qubit gate. Second, two-qubit gates operate on 4×4 unitary matrices, such as the controlled NOT and commutation gates. Finally, multi-qubit gates operate on multiple qubits as 2n×2n unitary matrices, such as the Tofoli and commutation gates.

[0046] 2.LSTM

[0047] To address the vanishing or exploding gradient problems common in Recurrent Neural Networks (RNNs), LSTM adds a cell state and three gating units to the RNN structure: a forget gate, an input gate, and an output gate. The cell state is used to store long-term memory, as shown in the attached diagram. Figure 1As shown in the diagram. In LSTM, the forget gate controls the cell to forget the historical hidden unit state with a certain probability, while the input gate handles the neuron's input at the current moment, and the output gate controls the neuron's output at the current moment. Specifically, the current input and the hidden unit state from the last moment enter the cell through the forget gate and input gate, respectively, and together they constitute the cell state. Then, the cell transmits its state along the time axis in channels with minimal information decay, making the cell adept at retaining information over long time spans, i.e., preserving long-term memory; the output gate controls the neuron to selectively output the cell's content at the current moment. The computational formula for the LSTM network is shown below:

[0048]

[0049]

[0050]

[0051]

[0052] c t =f t c t-1 +i t g t ,

[0053] h t =o t tanh(c t ),

[0054] Where W is the weight, b is the bias value, σ is the sigmoid function, and c t-1 It is the final state of the cell, h t-1 It is the hidden cell state at the last moment, x t At the current moment, f t It is the output of the forget gate, i t It is the output of the input gate, o t It is the output of the output gate, c t It is the current cell state, h t It represents the current hidden unit state.

[0055] 3. Hybrid Quantum-Classical Neural Networks

[0056] In HQCNN, a portion of the neural network is made into quantum units. A typical hybrid QNN architecture consists of trainable variable quantum circuits sandwiched between classical input and output neural layers. In this architecture, the quantum circuits act as hidden layers in HQCNN. The quantum part in HQCNN is similar to the original QNN architecture, consisting of two parts: data encoding, which encodes classical data; and trainable variable quantum circuits. An abstract diagram of HQCNN is attached. Figure 2 As shown.

[0057] The classic input layer in the HQCNN architecture is typically used to shrink the input feature space to make it compatible with NISQ devices. The quantum part is similar to QNN, as shown in the appendix. Figure 3 As shown. The classical output layer is typically used for classical post-processing of the measurement results from the quantum part. Furthermore, in HQCNN, the parameters can also be updated classically because the measurements returned from the quantum part are classical values. U(x) is a set of unitary operations dependent on the input data, whose primary responsibility is to efficiently encode the input data into the quantum device. V(θ) is a variable quantum circuit consisting of a set of parameterized gates, which depends on the trainable parameters θ. When measuring the circuit, it is typically post-processed and interpreted as a prediction. of.

[0058] The core idea of ​​the proposed HQCNN model is based on hybrid computation, and the model consists of two main components. First, the quantum part employs a quantum Conv layer. Second, it includes two classical parts with CNN architecture. The structure of the HQCNN model consists of a quantum convolutional layer, followed by a convolutional layer and a rectified linear unit activation function, then two max-pooling layers, and finally connected to a fully connected (FC) layer.

[0059] The quantum convolutional layer aims to implement convolution operations, which play a crucial role in feature extraction and the generation of corresponding feature maps in the proposed model. In this layer, the kernel size and convolution stride are set to be the same to perform fast dimensionality reduction on the generated feature data. Furthermore, they should be modified according to the input data, similar to classic convolutional neural network (CNN) models. After obtaining the quantum state |φ(x)>, a unitary transformation is performed on the quantum state using a quantum convolutional kernel designed with VQC. The |α> convolutional kernel has five training parameters (θ = θ1, θ2, θ3, θ4, θ5), as shown in the appendix. Figure 4 As shown.

[0060] Appendix Figure 4 The circuit diagram shows the use of a convolution kernel to perform a unitary transformation on the qubits corresponding to the convolution window. It's important to note that the quantum convolution window is identical to the classical convolution window, but corresponds to specific qubits. The purpose of repeatedly applying the convolution window to the qubit is to preserve the properties of convolution as much as possible and extract hidden information from the quantum state.

[0061] The algorithm design of quantum circuits is the core of a quantum neural network model. For a quantum neural network, the input data X needs to be encoded into a quantum state. After encoding, a series of quantum gates act on one or more qubits to manipulate the input state, transforming it into another state through entanglement, rotation, etc. X→H is the execution of quantum feature mapping, where H is the Hilbert space, a crucial step in quantum computing. Qubit encoding encodes a data point X... i Encoding into a single qubit, i.e. Where i = 1, 2, 3, ..., N. Quantum encoding will assign x = (x1, x2, ..., x...) to... n ) T The input data is encoded into N qubits, as shown in the following formula:

[0062]

[0063] After classical data is successfully encoded into quantum states, it is necessary to consider using existing qubits or adding auxiliary qubits to design quantum circuits. Virtual quantum comprehension (VQC) is a hybrid quantum-classical approach that utilizes both quantum and classical computing. It is a tunable quantum circuit whose parameters are optimized through an iterative process using a classical computer. These tunable parameters can be viewed as weights in an artificial neural network. Figure 5 This is a common quantum circuit design. As mentioned earlier, the quantum state encoding circuit encodes the classical computer's input x as a quantum system with |φ(x)>. Then, the quantum feature mapping circuit U... θ (|φ(x)>) performs a series of unitary transformations, as shown in the appendix. Figure 5 As shown in (b).

[0064] The VQC, which uses the parameter θ to map quantum characteristics based on quantum states, consists of many quantum gates, as shown in the appendix. Figure 5 As shown in (b). In quantum circuits,

[0065] R(α,β,γ)=R z (α)R y (β)R z (γ) consists of three single-qubit unitary gates, and α, β, γ are parameters that need to be iteratively optimized.

[0066] VQC is widely used as a quantum model for classification tasks and has been shown to generate discrete probability distributions that classical neural networks cannot effectively simulate, and it is also robust to noise to some extent. It is well known that various quantum gates are essentially unitary transformations of quantum states. Therefore, the process of encoding classical data x into an initial quantum state |φ(x)> and operating U using quantum circuits is called VQC. θ(|φ(x)>) with parameter θ is a mapping X. However, this mapping differs from classical function mappings; it occurs between Euclidean and Hilbert spaces. But this mapping can still be understood as similar to f θ (x), similar to classic machine learning.

[0067] 4. Parameterized Circuit Learning Algorithm in Machine Learning

[0068] X classic data i Encoding to quantum state |φ(X) i )>, through quantum circuit U θ (|φ(X i The probability p can be obtained by measuring in the Z direction. ik The string a k .

[0069]

[0070] We hope that the element in {a} corresponds to the true classification result Y. i After each measurement, make it as high as possible. In other words, let any a k ∈{a} satisfies Y i =g(a), the function g(a) is an encoding method whose function is to encode the measured string A into a label Y. i Corresponding to input data X i This leads to more accurate classification predictions. Although it is difficult to obtain the relevant probability distribution directly from quantum circuits, the probability p ik The frequency can be used to estimate n k / N occurrence a k Through multiple measurements. Thus, by converting repeated measurements into quantum circuitry, the bit string group {a} is selected. j Highest total frequency Then the corresponding classification prediction can be obtained and recorded as y. i .

[0071] Therefore, the variable loss function Loss(i) can be constructed as follows:

[0072] Loss(i) = f(y) i (θ),Y i )=p(y i ≠Y i Assume Y has n results and set Y... i =R1, and the other n-1 classes are R2, R3, ..., etc. Then

[0073] p(y i ≠Y i )=p[N i (R1)≤max[Ni (R2),N i (R3),...,N i (R n ),]],

[0074] Let max[N] i (R2),N i (R3),...,N i (R n ),]=N i (R), then there is

[0075]

[0076] Therefore, we can obtain

[0077]

[0078] Therefore, the total cost function can be defined as follows (assuming the number of training sets is T):

[0079]

[0080] Since the total cost function is a function of the parameters θ and the training set {X,Y}, a classical computer can be used to minimize and update the parameters until the termination condition is met. In this way, the training process of the QNN is completed using machine learning on a classical computer.

[0081] 5. QRELU activation function

[0082] Current improvements to ReLU, such as Leaky ReLU, allow for stronger nonlinear outputs. These improvements take into account the existence of small negative values, making the transition from positive to small negative values ​​smoother. While these improvements have made progress to some extent, they do not completely solve the problems inherent in ReLU. Therefore, this proposal suggests a novel activation function—Quantum ReLU. This function, through the two key quantum principles of entanglement and superposition of qubits, allows it to simultaneously possess both positive and negative solutions. By selecting positive solutions to avoid negative solutions, the problem of "near-death ReLU" is eliminated in a quantitative way—that is, by achieving a positive solution while avoiding a negative one. The new Quantum ReLU will be applied to the HQCNN-LSTM neural network to achieve more accurate air quality predictions.

[0083] First, a two-step quantum method is used to quantize and improve ReLU, selecting its positive solution (R(z) = z, The negative solutions of Leaky ReLU (R(z) = α × z) Using α = 0.01 as the starting point for quantization improvement, and applying the principle of quantum entanglement, performing a tensor product on the two candidate state spaces of ReLU and Leaky ReLU yields the following combination of quantum basis solutions:

[0084]

[0085] Therefore, for positive values ​​(z>0), R(z) remains equal to z, but for negative values, the novelty of the entangled solution is increased, resulting in quantum ReLU (QReLU) (see attached). Figure 7 This avoids the "dying ReLU" and mathematically maintains the positiveity of the solution through this new quantum state.

[0086] Although various variants of the ReLU function, such as PReLU, RLE, and ELU, have been proposed for classical deep neural network models, they have not been widely adopted. While these variants attempted to address the "dying ReLU" problem, they failed to completely solve it. Furthermore, the vanishing and exploding gradient problems persist. However, quantum-based ReLU methods hold promise for improving learning and generalization in convolutional neural networks (CNNs), significantly impacting key applications such as feature extraction from data. This proposal aims to develop a novel AF "quantum ReLU" method to address the "dying ReLU" problem. A quantum CNN model was developed based on existing literature, demonstrating how to identify quantum states, but it did not fully resolve the "dying ReLU" problem. Therefore, the new Quantum ReLU will be applied to convolutional neural networks (CNNs) to improve their ability to extract data feature information and will be compared with current standard activation functions (including ReLU). This proposal hypothesizes that introducing the proposed quantum ReLU function into the HQCNN-LSTM model can improve its ability to learn the importance of data features in air quality prediction, thereby achieving more accurate air quality forecasts.

[0087] The following section discusses the specific implementation process of this plan:

[0088] First, construct the QRELU-HQCNN-LSTM algorithm.

[0089] The QRELU-HQCNN-LSTM model structure used in this scheme is shown in the attached figure. Figure 7As shown, features are first extracted from time-series data using a combination of a quantum convolutional layer and a classic Conv layer with a ReLU function. The quantum convolutional layer consists of three parts: an encoding part with RY rotation gates and VQC, and a decoding part with Pauli-Z gates, combined with a classic Conv layer and a max-pooling layer. Each max-pooling layer has a kernel size of (2×2) and a stride of 2, followed by a dropout layer. The data is then flattened by a flattening layer and fed into a single LSTM layer for training. Finally, the output is passed through an output layer.

[0090] Next, predictions are made based on the QRELU-HQCNN-LSTM model.

[0091] This paper introduces a prediction model combining the QRELU activation function and HQCNN-LSTM. To efficiently extract features, a hybrid quantum neural network (HQCNN) is used, and the QRELU activation function can be employed to improve its accuracy. Furthermore, LSTM utilizes gating functions to regulate the memory and forgetting of previous data, making it ideal for processing long-term sequence data and improving detection accuracy. Therefore, the QRELU-HQCNN-LSTM algorithm model is suitable for air quality prediction in this paper. (Appendix) Figure 8 The QRELU-HQCNN-LSTM algorithm process is explained, with the specific stages as follows:

[0092] Step 1: Input data.

[0093] Step 2: Input data preprocessing, including missing values, exponential smoothing, and data normalization.

[0094] Step 3: Send the preprocessed data to the quantum convolutional layer for feature extraction, prepare quantum states, and obtain the training and test sets; construct a hybrid quantum-classical convolutional neural network and use the QRELU activation function in the convolutional layer; set the values ​​of batch size, epoch, and learning rate; perform unitary transformation on the quantum system; and then integrate all local features through a fully connected layer to form the overall features.

[0095] Step 4: Input the features extracted by HQCNN into LSTM for training.

[0096] Step 5: Calculate the loss value and gradient, and update the parameters based on the gradient and learning rate.

[0097] Step 6: End.

[0098] Then, experiments and analysis were conducted (results).

[0099] (1) Data preparation and preprocessing

[0100] The data for this project comes from the Kaggle website, and this dataset contains 18 air quality features for each year from 2014 to 2021. Air quality was predicted using an AQI prediction model by analyzing temperature and climate sample data measured in Shanghai. The raw data includes daily minimum and maximum temperatures, UV index, and heat index. In the experiment, weather conditions from January 1, 2014 to January 30, 2021 were used as the dataset. To evaluate the prediction model, the data was split into training and test sets. The test set included daily weather data from May 7, 2020 to January 30, 2021 to ensure the prediction model could handle a large amount of out-of-sample data. Finally, it is worth mentioning that both the training and test data utilized the natural logarithm to homogenize the variability and stability of the pattern and reduce exponential trends.

[0101] Because air quality data varies in magnitude, the QRELU-HQCNN-LSTM model is highly sensitive to data scale. To avoid issues such as slow model convergence due to large data variations, data normalization is necessary.

[0102]

[0103] (2) Evaluation Indicators

[0104] This scheme selects root mean square error (RMSE), mean absolute error (MAE), and mean absolute percentage error (MAPE) as evaluation metrics to measure the model's predictive performance. The smaller these values, the better the model's predictive performance. The relevant formulas are as follows:

[0105]

[0106]

[0107]

[0108] In the formula, N is the number of samples, y n If it is true, These are the predicted values ​​from the model.

[0109] (3) Performance Analysis

[0110] In this embodiment, the performance of the proposed QRELU-HQCNN-LSTM model was evaluated compared with that of other models such as CNN-LSTM. The hyperparameters of the QRELU-optimized model are shown in Table 1. The model was trained for 300 epochs with a batch size of 256 and a mean squared loss function. All experiments were conducted on a computer with an Intel(R) Core(TM) i7-9750H, 2.60GHz, and GTX1660Ti GPU. All models were built on the Keras 2.2.4 framework, and the code was edited using Juypter Notebook based on Python 3.9.

[0111] Table 1. Values ​​of hyperparameters

[0112] parameter Qrelu Hqcnn-lstm LSTM layer 64 LSTM layer activation function Tanh Learning rate 0.004 Batch size 256 epoch 300 Pooling layer activation function RELU Pooling layer padding Same Optimizer Adam Loss function Rmse Convolution layer activation function QRELU Convolution layer padding Same

[0113] First, the impact of variables on the performance of the QRELU-HQCNN-LSTM algorithm was explored through hierarchical variational circuits. Different variable hierarchical circuit structures exhibit different expressiveness and entanglement capabilities. (See Table 2 and Appendix...) Figure 9 As can be seen, Circuit 3 is the best in all metrics, with RMSE, MAPE, and MAE reaching 0.1335, 0.4548, and 0.0996 respectively. Circuit 1 has the worst RMSE, MAE, and MAPE, while its ability to discover hidden states between information is in between that of Circuit 2 and Circuit 4, suggesting that Circuit 3 has better expressiveness and entanglement. Based on the experiments, Circuit 3 can express good entanglement and performance; therefore, Circuit 3 was chosen as the algorithm for QRELU-HQCNN-LSTM.

[0114] Table 2. Performance metrics comparison of QRELU-HQCNN-LSTM algorithms under different circuit conditions.

[0115] Circuit configuration RMSE MAPE MAE Circuit1 0.1432 0.4788 0.1111 Circuit2 0.1378 0.4651 0.1055 Circuit3 0.1335 0.4548 0.0996 Circuit4 0.1408 0.6405 0.1080

[0116] (4) Experimental comparison

[0117] First, to demonstrate the effectiveness of the QRELU-HQCNN-LSTM algorithm, a detailed comparison and testing were conducted. This algorithm is based on quantum theory and re-optimized upon classical neural networks. Then, the performance of the QRELU-HQCNN-LSTM algorithm under identical conditions and datasets was carefully verified, proving that it does indeed possess certain advantages.

[0118] From the appendix Figure 10The results show the prediction performance of the QRELU-HQCNN-LSTM algorithm under learning conditions. Since the QRELU-HQCNN-LSTM algorithm is an optimized version of CNN-LSTM, a CNN-LSTM model is first built for comparison, with the same number of set units and learning rate. (See attached...) Figure 10 It can be seen that the QRELU-HQCNN-LSTM algorithm can predict air quality more effectively and handle some extreme data, fitting the AQI effectively, while the CNN-LSTM algorithm ignores these specific points. Although it largely conforms to future trends, it is generally not as good as the QRELU-HQCNN-LSTM algorithm.

[0119] To better verify the superiority of the QRELU-HQCNN-LSTM algorithm, a model and its variant CNN-LSTM model were established for comparison. RNN, LSTM, CNN-LSTM, and QRELU-HQCNN-LSTM models were selected for air quality prediction, and their curves are shown in the attached figure. Figure 11 As shown. Due to the data, the model cannot fit well. From the attached... Figure 11 As can be seen, when the data curve shows a significant downward trend, the three models do not fit well. Generally, the QRELU-HQCNN-LSTM model has a higher output curve fit. Except for a few specific points, it can predict most future trends, while the RNN and LSTM algorithms have lower fits than QRELU-HQCNN-LSTM.

[0120] In Table 3 and Appendix Figure 12In the table, RMSE, MAE, and MAPE represent the root mean square error, mean absolute error, and mean absolute percentage error of the prediction, respectively. Table 3 shows that the HQCNN-LSTM model exhibits better performance than the CNN-LSTM model. Specifically, RMSE decreased by 5.00%, MAPE decreased by 17.54%, and MAE decreased by 5.86%. This indicates that quantum entanglement enhances the CNN-LSTM model's ability to extract important local features of the data, thereby improving the model's prediction performance and accuracy. Compared to the HQCNN-LSTM model, the QRELU-HQCNN-LSTM model shows a more significant improvement. Specifically, RMSE decreased by 12.00%, MAPE decreased by 5.62%, and MAE decreased by 19.42%. This indicates that the QRELU-HQCNN-LSTM model is superior in fitting outliers and improves the model's ability to fit and predict the true air quality index. Compared to the CNN-LSTM model, the prediction accuracy of the QRELU-HQCNN-LSTM model is significantly improved. This achievement is attributed to the superior optimization capabilities of the QRELU-HQCNN-LSTM algorithm, which helps the model achieve a better network structure and learning speed. In summary, the model in this example demonstrates higher accuracy in predicting air quality index.

[0121] Table 3 Comparison of Model Prediction Results

[0122] model RMSE MAPE MAE Rnn 0.1783 0.7970 0.1416 Lstm 0.1688 0.7353 0.1380 Cnn-lstm 0.1597 0.6865 0.1313 Qrelu cnn-lstm 0.1581 0.5807 0.1259 HQcnn-lstm 0.1517 0.5111 0.1236 Qrelu HQcnn-lstm 0.1335 0.4549 0.0996

[0123] The impact of activation functions on the performance of the HQCNN-LSTM algorithm was explored, showing that different activation functions exhibit varying performance characteristics when optimizing quantum hybrid neural networks. This embodiment carefully verifies the performance of the QRELU activation function under the same conditions and dataset, demonstrating its advantages and its ability to effectively address the "death problem" of the ReLU function. (The last sentence appears to be incomplete and possibly refers to a separate, unrelated point.) Figure 13 This compares the predicted values ​​and the actual values ​​of the dataset.

[0124] From Table 4 and Appendix Figure 14The data clearly shows that the QRELU activation function exhibits the best performance across all metrics, with RMSE, MAPE, and MAE reaching 0.1335, 0.4549, and 0.0996, respectively. In contrast, the model optimized with the RELU activation function performs the worst in these metrics. Among various activation functions, the QRELU-HQCNN-LSTM model has the highest prediction accuracy, with its predicted values ​​largely matching the actual values. The RRELU-HQCNN-LSTM model is the second most accurate. Compared to the LRELU, RRELU, and PRELU activation functions, the QRELU activation function has a significantly greater impact on improving model performance. This indicates that the QRELU activation function, to some extent, solves the "dying problem" present in traditional activation functions, improves the HQCNN-LSTM model's ability to fit true air quality values, and further enhances the model's accuracy and stability.

[0125] Table 4 Comparison of various performance indicators after optimization with different activation functions

[0126] model RMSE MAPE MAE Lrelu Hqcnn-lstm 0.1491 0.4782 0.1197 Rrelu Hqcnn-lstm 0.1336 0.4874 0.1055 Prelu Hqcnn-lstm 0.1483 0.4797 0.1157 Qrelu HQcnn-lstm 0.1335 0.4549 0.0996

[0127] In summary, this embodiment proposes an HQCNN-LSTM model based on the QRELU activation function for predicting the Air Quality Index (AQI). First, a hybrid quantum-classical convolutional computation model is constructed. Next, the hyperparameters of the HQCNN-LSTM model are optimized using the QRELU activation function. Then, an optimized QRELU-HQCNN-LSTM model is built and trained on an air quality data training set. Finally, the air quality data test set is input into the trained model to obtain the predicted AQI values. Simulation results show that:

[0128] 1) This hybrid quantum-classical convolutional computation model consists of two main parts: a quantum computation part and a classical computation part. The quantum computation part includes quantum convolutional layers with parameterized variable quantum circuit design to realize the linear unitary transformation of quantum states. Here, the parameterized variable quantum circuit is utilized to leverage the potential of quantum computing. Next, features from the time series data are extracted using an HQCNN network and trained using an LSTM network to obtain the final output. The final output data format is converted to generate predicted values. By using the QRELU activation function, the ability of the HQCNN-LSTM neural network to learn the importance of local features of air quality is enhanced, effectively improving the model's prediction accuracy.

[0129] 2) Compared with existing CNN-LSTM, QRELU-CNN-LSTM, LSTM, RNN, HQCNN-LSTM, PRELU-HQCNN-LSTM, LRELU-HQCNN-LSTM, and RRELU-HQCNN-LSTM models, the QRELU-HQCNN-LSTM model demonstrates better prediction accuracy and stability in predicting the air quality index. Using the QRELU-HQCNN-LSTM model can enhance the stability and accuracy of air quality index prediction. In summary, this model provides a stable and effective tool for monitoring key features of air quality. The focus of this approach is to optimize the structure of the air quality index prediction model and improve its prediction accuracy. However, noise present in the air quality dataset may affect the model's ability to extract key features. Therefore, future research will consider further optimizing the model's performance in data denoising and feature construction.

[0130] The above descriptions are merely embodiments of the present invention. Commonly known structures and characteristics are not described in detail here. Those skilled in the art are aware of all common technical knowledge in the field prior to the application date or priority date, are aware of all existing technologies in that field, and have the ability to apply conventional experimental methods prior to that date. Those skilled in the art can, under the guidance of this application, improve and implement this solution in combination with their own capabilities. Some typical known structures or methods should not be obstacles for those skilled in the art to implement this application. It should be noted that those skilled in the art can make several modifications and improvements without departing from the structure of the present invention. These should also be considered within the scope of protection of the present invention, and will not affect the effectiveness of the implementation of the present invention or the practicality of the patent. The scope of protection claimed in this application should be determined by the content of its claims, and the specific embodiments described in the specification can be used to interpret the content of the claims.

Claims

1. An air quality prediction method based on improved quantum activation functions, characterized in that, Including the following steps: A QRELU-HQCNN-LSTM model is constructed: features are extracted from time-series data through a combination of quantum convolutional layers and classical Conv layers with ReLU functions. The quantum convolutional layer consists of three parts: an RY rotation gate, VQC encoding, and decoding with a Pauli-Z gate. The RY rotation gate encodes the input classical time-series data into quantum states. The VQC encoding performs a unitary transformation on the quantum states using a variable quantum circuit with training parameters. The quantum convolutional kernel has 5 training parameters. The kernel performs a unitary transformation on the qubits corresponding to the convolutional window. The quantum convolutional window is consistent with the classical convolutional window and corresponds to the corresponding qubit. The convolutional window repeatedly acts on the qubits and extracts hidden information from the quantum states. The Pauli-Z gate decoding measures the quantum states after the unitary transformation and outputs classical feature maps. Classical Conv layers are used in combination with max pooling layers. Each max pooling layer has a kernel size of 2×2 and a stride of 2. Each max pooling layer is followed by a dropout layer. The data is flattened by a flattening layer and fed into a single-layer LSTM layer for training, and then output through an output layer. Air quality is predicted based on the QRELU-HQCNN-LSTM model, as detailed below: Step 1: Input data; Step 2: Data preprocessing, including missing values, exponential smoothing, data normalization, and uniformization using the natural logarithm; Step 3: Send the preprocessed data to the quantum convolutional layer for feature extraction, prepare quantum states, obtain training and test sets, construct a hybrid quantum-classical convolutional neural network and use the QRELU activation function in the convolutional layer, set the batch size, epoch and learning rate, perform unitary transformation on the quantum system, and then integrate all local features to form the overall features through a fully connected layer; Step 4: Input the features extracted by HQCNN into LSTM for training; Step 5: Calculate the loss value and gradient, and update the parameters based on the gradient and learning rate; Step 6: Output the prediction results.

Citation Information

Patent Citations

  • CNN-LSTM water quality prediction method based on quantum particle swarm optimization

    CN114896885A