An energy-saving green traffic sign classification method based on quantum pulse neural network
By using the QTCAC-SNN model of quantum pulsing neural network, combined with quantum time channel attention encoding and spatiotemporal adaptive membrane residual network, the problems of high energy consumption and low encoding efficiency of traffic sign classification model are solved, and low-power and high-efficiency traffic sign classification is achieved.
Patent Information
- Application Number
- CN202511697394.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2045-11-19
AI Technical Summary
Existing traffic sign classification models suffer from high energy consumption, low coding efficiency, and weak ability to express temporal dynamic features, making it difficult to meet the low power consumption requirements of intelligent vehicles.
A quantum spiking neural network-based approach is adopted, which combines a quantum time channel attention encoding module and a spatiotemporal adaptive membrane residual network with a spiking neural network for traffic sign classification. Image features are extracted using quantum superposition and entanglement properties, and a QTCAC-SNN model is constructed. A hybrid training strategy is then used to optimize the model.
While maintaining high classification accuracy, it significantly reduces the power consumption of neuromorphic hardware, improves traffic sign classification performance, and is suitable for edge computing scenarios of intelligent vehicles.
Smart Images

Figure CN121190888B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the technical field of artificial intelligence and intelligent transportation, and particularly relates to an energy-saving green traffic sign classification method based on a quantum pulse neural network. BACKGROUND
[0002] With the development of intelligent transportation systems, vehicles need to quickly classify traffic signs to achieve safe and efficient autonomous driving decisions. Although traditional convolutional neural networks (CNNs) have good classification performance, they have high computational energy consumption and are difficult to meet the low-power requirements of vehicle-mounted edge devices.
[0003] Spiking neural networks (SNNs) are considered an important direction of green intelligent computing due to their sparse spiking communication mechanism in energy consumption. However, existing SNNs rely on direct encoding schemes in image classification tasks, resulting in a lack of temporal dynamics in the encoded pulse sequence, weak information representation ability, and an inability to fully capture the complex features of traffic signs. Moreover, their performance is limited when faced with complex data sets. Meanwhile, quantum neural networks (QNNs) have great potential in efficient computing due to their quantum superposition and entanglement properties, but the quantum computing environment and traditional SNN architecture differ significantly, making it difficult to directly integrate into the pulse computing framework, and quantum noise can severely affect the accuracy and stability of the model's computing results.
[0004] Therefore, there is an urgent need for a green and energy-saving model that combines quantum computing and SNN characteristics, which can not only improve traffic sign classification performance but also achieve low-power operation on neuromorphic hardware. SUMMARY
[0005] The purpose of the present application is to overcome the shortcomings of existing traffic sign classification models, such as high energy consumption, low encoding efficiency, and weak temporal dynamic feature expression ability, and to provide an energy-saving green traffic sign classification method based on a quantum pulse neural network. While ensuring high classification accuracy, the neuromorphic hardware running energy consumption is significantly reduced, thereby meeting the demand for efficient and low-power traffic sign classification in intelligent vehicle and other edge computing scenarios.
[0006] Technical solution: An energy-saving green traffic sign classification method based on a quantum pulse neural network according to the present application comprises the following steps:
[0007] Step 1, collect traffic sign data sets and initialize the parameters of the traffic sign classification model;
[0008] Step 2, for the static input in the traffic sign data set, copy it to T time steps to construct an initial input image with a time dimension;
[0009] Step 3, pulse signal coding is performed on the initial input image, sequentially passing through the convolution layer Conv, the batch normalization layer BN, and then through the TSA-LIF pulse neuron layer for space-time adaptive reinforcement coding to obtain a reinforced coding result;
[0010] Step 4, feature reinforcement is performed on the reinforced coding result: based on the quantum time channel attention coding QTCAC module, quantum neural networks QNNs are used to extract attention features of the input image in the time dimension and the channel dimension, and the image is coded into a pulse sequence;
[0011] Step 5, a quantum channel attention module QCA is used to extract channel dimension attention features;
[0012] Step 6, a quantum time attention module QTA is used to extract time dimension attention features and fuse them with channel dimension attention features through an attention fusion module AFU;
[0013] Step 7, a QTCAC-SNN model of the fusion quantum time channel attention coding module QTCAC and the space-time adaptive membrane residual network TSA-MS-ResNet is constructed, the QTCAC module is used for image coding, and the TSA-MS-ResNet is used to perform a classification task;
[0014] Step 8, a hybrid training strategy combining quantum neural networks and pulse neural networks is adopted to optimize and train the traffic sign classification model, and the trained model is deployed in the sign classification task to achieve green and efficient computing.
[0015] Further, the parameter initialization setting of the traffic sign classification model in step 1 is as follows: the number of quantum bits, the size of the convolution kernel, the learning rate, the batch size, and the training epoch of the quantum time attention module QTA and the quantum channel attention module QCA are set; wherein the number of quantum bits of QTA is set to be equal to the number of time steps T, and the number of quantum bits of QCA is set to be consistent with the number of channels C.
[0016] Further, step 2 is as follows: for the static input X in the data set, it is copied to T time steps in the time dimension to obtain an initial input image X' containing time features, X' ∈ R 1:T , R represents a real number set; so that the original static data presents dynamic evolution characteristics in the time dimension.
[0017] Further, step 3 specifically includes the following steps:
[0018] Step 3.1, sequentially input the model initial input image X' into the convolution layer Conv and the batch normalization layer BN, the convolution layer is used to extract the feature information of the input data, and the batch normalization layer is used to improve the training efficiency and stability of the model;
[0019] Step 3.2, the feature map processed by the Conv and BN layers is input into the TSA-LIF pulse neuron layer to complete the pulse conversion and strengthening, thereby generating a pulse signal feature, and obtaining the final strengthened encoding output result; the TSA-LIF neuron makes the membrane potential and the input signal independent decay, and the integrated representation of the neuron model and the variable decay is:
[0020] ;
[0021] Wherein, represents the membrane potential of the nth layer at the tth time step, represents the membrane potential decay coefficient, represents the membrane potential constant of the neuron, represents the historical membrane potential of the same layer at the previous time step, and λ represents the input weight coefficient of the neuron, represents the current input signal of the nth neuron at the tth time step; by using and as different variable decay terms to allocate independent learning of time and space decay parameters;
[0022] The spatial decay factor and the time decay factor are defined as follows:
[0023] ;
[0024] represents the input weight coefficient of the nth neuron, represents the membrane potential decay coefficient of the nth layer;
[0025] By independently training the two kinds of learnable decay factors, it is defined that:
[0026] ;
[0027] Wherein the spatial and time decay factors and are independently learned, and share parameters within the same layer but at different time steps, and have different parameters when trained on different layers.
[0028] Further, step 4 specifically comprises the following steps:
[0029] Step 4.1: The repeated input generated by encoding is processed through a max pooling layer (MaxPool) and an average pooling layer (AvgPool) to obtain the time feature vector. and ;
[0030] Step 4.2: Convert the time feature vector and The input is fed into a QNN for feature extraction; angle encoding is used to map the input classical data to the angles of a quantum rotation gate to represent information, and the data is also mapped to the phase information of the quantum state; let... Represent the normalized vector, and then for each classical data... This classical data is encoded into the rotation angle of a qubit using a rotation gate; an angle is applied to each qubit. Revolving door, among which Representing the rotation angle, the resulting quantum state Represented as:
[0031] ;
[0032] By rotating qubits, classical eigenvectors are mapped to a quantum superposition state. For multiple input data, rotation gates are applied sequentially to form a global superposition quantum state, as follows:
[0033] ;
[0034] in, This represents the tensor product operation. Represents n items Tensor product; for angle encoding, the number of qubits used is n=N;
[0035] Step 4.3, Time Feature Vector and After normalization, angle encoding is performed separately to obtain the quantum states. and And perform quantum evolution on the encoded quantum state;
[0036] Step 4.4: Measure the evolved quantum state to obtain the output probability amplitude information corresponding to each time step; the temporal attention weights can be calculated using the measurement results; the quantum state measurement uses observable operators. The expected value is expressed in terms of the following form, and the calculation method is as follows:
[0037] ;
[0038] Where T represents the number of time steps, This represents the right vector quantum superposition state at T time steps. express The left-vector dual state; This represents the expected value obtained from quantum measurement, which uses a Z-basis measurement method; the observable operator corresponding to the Z-basis. Represented as:
[0039] ;
[0040] I represents the identity matrix; Tensor product operation, where Z is the characteristic matrix;
[0041] Step 4.5: The final time attention vector M∈R T Depend on and The results measured after passing through a quantum circuit are combined to integrate time characteristics, and two learnable parameters are introduced. and These are used to balance the information obtained from max pooling and average pooling, respectively, to form the final temporal attention output.
[0042] Furthermore, step 5 specifically includes the following steps:
[0043] Step 5.1: Obtain spatial information of the channel layer using a global pooling layer to map global spatial features to the channel descriptors; the global average pooling operator is the global feature matrix. Represented as:
[0044] ;
[0045] in, Let H be the input image of the c-th channel at time step t, where H represents the number of rows in the matrix, W represents the number of columns in the matrix, and (i,j) represents the element in the i-th row and j-th column.
[0046] Step 5.2: Input the feature map after global average pooling into the quantum neural network QNN for calculation to extract the attention information of each channel at different time steps; before inputting into the QNN, combine the quantum state encoding method used in the quantum temporal attention module QTA to perform quantum state mapping on the feature matrix Z. The overall encoding process is represented as follows:
[0047] ;
[0048] in, U represents the quantum state obtained by quantum encoding the channel features at time step t. encoding (Z) represents the encoding operator that converts the characteristic matrix Z into the corresponding quantum state;
[0049] Step 5.3, measuring the obtained quantum state to obtain the channel attention weight according to the output probability amplitude information of each time step; since the channel feature vectors of each time step are respectively input into the QNN, the measurement is independently performed for each time step, and the measurement result is used to calculate the importance weight of the channel feature at the time step;
[0050] Step 5.4, the whole quantum channel attention extraction process is recorded as a mapping , the whole quantum channel attention extraction process is represented as:
[0051] O ;
[0052] Wherein O∈R T×C is a quantum channel attention matrix, and R is a real number set.
[0053] Further, step 6 is specifically: firstly, the time attention vector and the channel attention vector are fused respectively, and the attention information of the time dimension and the channel dimension is jointly modeled, so that the attention features of the two are integrated on each channel and each spatial position, thereby forming the final multi-dimensional attention fusion result.
[0054] Further, step 7 is specifically: in the encoding stage, a quantum time channel attention encoding scheme QTCAC is adopted, and in the network training stage, a TSA-MS-ResNet architecture with a membrane residual connection structure is introduced; wherein the top layer of the residual connection retains the LIF pulse neuron layer to maintain the sparsity of the pulse signal, and the redundant neurons are removed between the layers to construct a mapping path.
[0055] Further, step 8 specifically includes the following steps:
[0056] Step 8.1, in the training stage of the pulse neural network SNN, a time and channel joint back propagation algorithm STBP is used to train the deep SNN; in the error back propagation process, the last layer of the model is taken as a decoding layer, and the output result is recorded as Q; after the output Q is processed by a softmax layer, it is used to calculate the cross entropy loss function between the label vector Y, and the expression is:
[0057] ;
[0058] Wherein, is the one-hot encoding of the true label, only the correct class is 1, and the rest is 0, n is the total number of classes, e represents the natural constant, q i represents the logit value of the i-th class, q j represents the logit value of the j-th class.
[0059] Step 8.2, in the training phase of the quantum circuit, the loss function L of the quantum neural network QNN QNN In the form of cross-entropy loss, which is expressed as:
[0060] ;
[0061] Wherein, is the expected value of quantum state measurement, obtained by quantum measurement;
[0062] Step 8.3, a hybrid training mechanism of spiking neural network SNN and quantum neural network QNN is adopted to jointly optimize the loss functions of the two, and a total loss function is constructed:
[0063] ;
[0064] In the model training process, by continuously minimizing the total loss function, the parameters of SNN and QNN are optimized synchronously.
[0065] Advantages: compared with the prior art, the present application has the following obvious advantages:
[0066] 1、The model of the present application is divided into a pulse coding phase and a network training phase, the coding phase enhances the dynamic representation of the pulse sequence through QTCAC coding, and the training phase uses the MS-ResNet framework for classification training. When processing complex image classification tasks, the model can exhibit higher performance and lower energy consumption, providing a more effective solution for the development of pulse neural networks in practical applications.
[0067] 2、The multi-dimensional attention mechanism is used to extract and enhance the direct coding results, and a quantum circuit is designed for parallel computation of image data. QTCAC is decoupled from SNN as a preprocessing layer, retains the pulse driving characteristics, and can be deployed on a neuromorphic chip, effectively improving the spatiotemporal dynamics of the pulse sequence, and providing strong support for efficient operation of SNN in complex environments.
[0068] 3、The training method of SNN and QNN is proposed, the characteristics of SNN and QNN are considered comprehensively, a hybrid loss function is designed, the parameters are optimized by continuously minimizing the loss function, which can further improve the model convergence speed and effectively optimize the model performance. In summary, the present application can reduce the energy consumption of the vehicle-mounted device in the traffic sign classification task while maintaining high accuracy, providing a feasible solution for real-time sensing and green computing of intelligent connected vehicles. BRIEF DESCRIPTION OF DRAWINGS
[0069] Figure 1 It is a kind of energy-saving and green traffic sign classification model based on quantum pulse neural network diagram;
[0070] Figure 2 This is a spatiotemporal adaptive spiking neuron (TSA-LIF) model;
[0071] Figure 3 A quantum time attention module and its quantum circuit diagram;
[0072] Figure 4 A diagram of the quantum channel attention module and its quantum circuitry;
[0073] Figure 5 This is a comparison chart of three residual connection schemes during the training phase. Detailed Implementation
[0074] The technical solution of the present invention will be further described below with reference to the accompanying drawings.
[0075] The present invention provides a method for classifying energy-saving and green traffic signs based on quantum pulsing neural networks, comprising the following steps:
[0076] Step 1: Set the initial model parameters. For example... Figure 1 As shown, the model architecture of this invention is as follows: Figure 1 The model consists of two main phases: a pulse coding phase and a model training phase. The pulse coding phase utilizes the Quantum Temporal Channel Attention Coding (QTCAC) module. QTCAC comprises three modules: Quantum Temporal Attention (QTA), Quantum Channel Attention (QCA), and Attention Fusion (AFU). The number of qubits in QTA is set to T (the same as the time step), and the number of qubits in QCA is set to C (the same as the number of channels). The kernel size is 4, the learning rate is 0.1, the batch size is 32, and the epoch count is 300.
[0077] Step 2: For the static input X∈R of the traffic sign dataset C×H×W In this invention, the first layer is designated as the encoding layer. For a static input X in the dataset, it is first copied over T time steps to obtain the initial model input X'∈R with a time dimension. 1:T This allows static data to change dynamically over time, adapting to subsequent processing by the spiking neural network.
[0078] Step 3: Perform direct pulse coding on the image.
[0079] Step 3.1 Pass X' through a convolutional layer (Conv) and a batch normalization layer (BN) in sequence. The Conv layer is used to extract features from the data, and the BN layer can accelerate the training of the model and improve its stability;
[0080] Step 3.2 Input the processed features into the TSA-LIF spiking neuron layer for spatiotemporal adaptive reinforcement coding to obtain a preliminary reinforced spiking code output. For example...Figure 2 The TSA-LIF neuron in the above equation can make the membrane potential and input signal decay independently, and the integration of the neuron model with variable decay can be represented as:
[0081]
[0082] wherein, represents the membrane potential of the nth layer at the tth time step, represents the membrane potential decay coefficient, represents the membrane potential constant of the neuron, represents the historical membrane potential at the previous time step on the same layer, and λ represents the input weight coefficient of the neuron, represents the current input signal of the nth neuron at the tth time step. By using and as different variable decay terms to assign independent learning of time and space decay parameters. The spatial decay factor and the temporal decay factor are defined as follows:
[0083]
[0084] The method of the present application aims to independently train the two learnable decay factors, which are defined as:
[0085]
[0086] wherein the spatial and temporal decay factors and are independently learned and share parameters within the same layer but at different time steps, and have different parameters when trained on different layers;
[0087] Step 4, feature enhancement on direct encoding result. As shown in Figure 1 , by using a quantum time channel attention coding (QTCAC) module, the input image is encoded into a pulse sequence with stronger representation ability by using a quantum neural network (QNN) to extract attention features in the time dimension and the channel dimension; as shown in Figure 3 , which shows a quantum time attention module and its quantum circuit diagram, the QTA module is used to extract attention features in the time dimension, which can capture important features and dynamic changes of data in the time dimension;
[0088] Step 4.1 Repetitive input generated by direct encoding The time feature vector and obtained after the max pooling layer (MaxPool) and the average pooling layer (AvgPool) can be represented as:
[0089]
[0090] Step 4.2 The time feature vector and is input into the QNN for feature extraction. Since classical image data cannot be directly used to train quantum circuits, it is necessary to encode classical data into quantum states through quantum state encoding. The present application adopts angle encoding, the core idea of which is to map classical input data into the angles of quantum rotation gates to represent information, and to efficiently map data into the phase information of quantum states. Assuming represents a normalized vector, then for each classical data , the present application uses a rotation gate (such as gate) to encode the data into the rotation angle of the quantum bit. For example, a gate can be applied to each quantum bit, where represents the rotation angle, and the resulting quantum state can be represented as:
[0091]
[0092] Through the rotation of multiple quantum bits, the entire classical data vector can be mapped into the superposition state of quantum bits. For example, for multiple data points, multiple rotation gates can be applied to form a superposition state, which can be represented as:
[0093]
[0094] where, represents the continuous tensor product of N matrices, represents the n tensor product. For angle encoding, the number of quantum bits used is n = N;
[0095] Step 4.3 The time feature vector and is first normalized, and then the normalized time feature vector is angle encoded to obtain quantum states and :
[0096]
[0097]
[0098] where, R y represents a quantum unitary gate, represents the i-th element in the normalized vector obtained by normalizing the time feature vector The i-th element in the normalized vector obtained after normalization, the encoded quantum state and correspond to the quantum state of the maximum pooling and average pooling time feature vector respectively. Then the encoded quantum state needs to be evolved in quantum, assuming that the unitary transformation of the parameterized quantum circuit is U T , then the quantum state evolved after the quantum circuit and can be represented as:
[0099]
[0100]
[0101] Step 4.4 Measure the evolved quantum state to obtain the output probability amplitude of each time step, which constitutes the distribution of the time attention weight. The quantum state measurement is measured by using the observable operator The measurement expectation value The calculation method can be represented as:
[0102]
[0103]
[0104] T represents the number of time steps, represents the quantum state superposition of T time steps, represents the expectation value obtained by quantum measurement, which is used to represent the importance of input features in time. The measurement of the present application is Z basis measurement, and the operator of Z basis measurement can be represented as:
[0105]
[0106] I represents the unit matrix; represents the tensor product;
[0107] Assuming that the quantum state is evolved in quantum and finally measured to obtain the probability amplitude , the weight distribution at time step t is represented as , then the attention weight of the t-th time step can be represented as . Similarly, assuming that is evolved in quantum and finally measured to obtain the probability amplitude , another set of time attention weights can be obtained.
[0108] Step 4.5 The final time attention vector M ∈ R T is obtained by and The results of the measurements after the quantum circuit jointly constitute, in order to effectively integrate these temporal characteristics, the present application introduces two learnable parameters and Thus balancing max-pooling and average-pooling information, the fused feature is represented as:
[0109]
[0110] Step 4.6 Finally, the time attention vector M∈R T , can be represented as:
[0111]
[0112] Where T is the total time step, represents the attention value of the Tth time step.
[0113] Step 5, extract channel dimension features, such as Figure 4 As shown in the figure, it shows the quantum channel attention module and its quantum circuit diagram.
[0114] Step 5.1 Use global average pooling to extract channel information, which is used to embed global spatial information into channel descriptors, that is, input X∈R T×C×H×W is converted to X'∈R T×C .
[0115] Step 5.2 The feature map after global average pooling is input into the quantum neural network (QNN) for calculation to obtain the attention information of each channel at each time step. Before inputting into QNN, the feature matrix Z needs to be quantum state encoded using the same quantum state encoding scheme as in the quantum time attention module (QTA), assuming that each row of Z represents the channel features of a time step, the present application will quantum state encode the C elements of each row, which can be represented as:
[0116]
[0117]
[0118] Where, represents the quantum state obtained by quantum encoding of the channel features of the tth time step, U encoding (Z) represents quantum state encoding of input Z, and represents the feature matrix of the tth time step, represents the feature matrix of the tth time step, i th channel.
[0119] Step 5.3 Measure the quantum state to obtain the output probability amplitude of each time step to obtain the distribution of channel attention weights. Since the application inputs the channel feature vectors of T time steps into the QNN respectively, the application needs to perform T measurements respectively, and the measurement result of each time can be used to represent the importance of the features input at the current time step on each channel. Assuming that the application measures the quantum evolution result of the t-th time step to obtain the probability amplitude , which represents the weight distribution of the i-th channel at time step t, then the i-th channel attention weight at time step t can be represented as . Then the total channel feature at the t-th time step can be represented as the vector .
[0120] Step 6, fuse the time dimension attention features extracted by the QTA module and the channel dimension attention features extracted by the QCA module using the AFU module; first, broadcast the time attention vector M and the channel attention vector N. Specifically, broadcast the time vector M to a space with a dimension of R T×1×1×1 , so that the attention information in the time dimension can uniformly and comprehensively act on each channel and each spatial position in the subsequent fusion process. Similarly, broadcast the channel attention vector N to R T×C×1×1 . In this way, the channel attention information is fully extended in the time dimension and the channel dimension, laying a foundation for subsequent fusion operations. Then the application fuses the attention of the two dimensions by the following formula:
[0121]
[0122] Where σ(·) and are the Sigmoid function and Hadamard product. Through the above three sub-modules, the application can obtain the functional operation f QTCAU (·) of QTCAU. This functional operation integrates the attention information of the time and channel dimensions.
[0123] Step 7, construct the QTCAC-SNN model of the fusion QTCAC module and the spatio-temporal adaptive membrane residual neural network (TSA-MS-ResNet). As Figure 5As shown, there are three main residual connection methods for existing deep SNNs: Vanilla Shortcut, which makes residual connection between membrane potential and spike, can support spike-driven but cannot achieve identity mapping. Spike-Element-Wise Shortcut makes residual connection between spikes of different layers, can achieve identity mapping, but the spike value can only be an integer, so SEW-SNN is an "integer-driven" SNN, not a spike-driven SNN. Membrane Shortcut (MS) makes residual connection between membrane potentials of spike neuron layers, can achieve spike-driven identity mapping. The application adopts the TSA-MS-ResNet architecture of the spatio-temporal adaptive membrane residual connection, the top of the residual connection retains the spike neuron layer to maintain the sparsity of the spike, and removes the inter-layer LIF to build a clean mapping path, ensures stable gradient propagation, solves the problems of blocked information flow and gradient vanishing in deep SNN. The QTCAC encoding scheme proposed in the application is used in the encoding stage, and the TSA-MS-ResNet architecture of the spatio-temporal adaptive membrane residual connection is used in the network training stage.
[0124] Step 8, the model is trained by using the hybrid training method of QNN and SNN. For network training of SNN, the application trains deep SNN by using the time channel back propagation (STBP). In error back propagation, the application takes the last layer as the decoding layer, and finally outputs Q. The application makes the output pass through a softmax layer, and calculates the cross-entropy loss function between the output Q and the label vector Y.
[0125] For network training of SNN, the application trains deep SNN by using the time channel back propagation (STBP). In error back propagation, the application takes the last layer as the decoding layer, and finally outputs Q. The application makes the output pass through a softmax layer, and calculates the cross-entropy loss function between the output Q and the label vector Y.
[0126]
[0127] wherein, is the one-hot encoding of the true label, only the correct class is 1, and the rest is 0, n is the total number of classes, e represents the natural constant, q i represents the logit value of the i-th class, q j represents the logit value of the j-th class;
[0128] For the training of the QNN quantum circuit, the loss function L QNN The cross-entropy loss function is used, which is represented as:
[0129]
[0130] where, is the expected value of the quantum state measurement, which can be obtained by quantum measurement. The following needs to calculate the gradient of the loss function of QNN through the parameter shift rule. In this way, the partial derivative of each parameter is obtained and fed into the optimizer for optimization.
[0131] The hybrid training method of SNN and QNN proposed in the application combines QNN loss and SNN loss to construct a total loss function as follows:
[0132]
[0133] In the model training process, the parameters of SNN and QNN are optimized synchronously by continuously minimizing the total loss function, so as to realize the joint improvement of the model performance.
Claims
1. A method for classifying energy-saving and green traffic signs based on quantum pulsing neural networks, characterized in that, Includes the following steps: Step 1: Collect the traffic sign dataset and initialize the parameters of the traffic sign classification model; Step 2: For the static input in the traffic sign dataset, copy it to T time steps to construct an initial input image with a time dimension; Step 3: Perform pulse signal encoding on the initial input image, passing it sequentially through the convolutional layer Conv, the batch normalization layer BN, and then through the TSA-LIF spiking neuron layer for spatiotemporal adaptive reinforcement encoding to obtain the reinforcement encoding result; Step 4: Enhance the features of the enhanced encoding results: Based on the quantum time channel attention encoding (QTCAC) module, use quantum neural networks (QNNs) to extract the attention features of the input image in the time and channel dimensions, and encode the image into a pulse sequence; Step 4 specifically includes the following steps: Step 4.1: The repeated input generated by encoding is processed through a max pooling layer (MaxPool) and an average pooling layer (AvgPool) to obtain the time feature vector. and ; Step 4.2: Convert the time feature vector and The input is fed into a QNN for feature extraction; Angle encoding is used to map input classical data into the angles of a quantum rotation gate to represent information, and the data is also mapped into the phase information of the quantum state; let... Represent the normalized vector, and then for each classical data... This classical data is encoded into the rotation angle of a qubit using a rotation gate; an angle is applied to each qubit. Revolving door, among which Representing the rotation angle, the resulting quantum state Represented as: ; By rotating qubits, classical eigenvectors are mapped to a quantum superposition state. For multiple input data, rotation gates are applied sequentially to form a global superposition quantum state, as follows: ; in, This represents the tensor product operation. Represents n items Tensor product; for angle encoding, the number of qubits used is n=N; Step 4.3, Time Feature Vector and After normalization, angle encoding is performed separately to obtain the quantum states. and And perform quantum evolution on the encoded quantum state; Step 4.4: Measure the evolved quantum state to obtain the output probability amplitude information corresponding to each time step; the temporal attention weights can be calculated using the measurement results; the quantum state measurement uses observable operators. The expected value is expressed in terms of the following form, and the calculation method is as follows: ; Where T represents the number of time steps, This represents the right vector quantum superposition state at T time steps. express The left-vector dual state; This represents the expected value obtained from quantum measurement, which uses a Z-basis measurement method; the observable operator corresponding to the Z-basis. Represented as: ; I represents the identity matrix; Tensor product operation, where Z is the characteristic matrix; Step 4.5: The final time attention vector M∈R T Depend on and The results measured after passing through a quantum circuit are combined to integrate time characteristics, and two learnable parameters are introduced. and These are used to balance the information obtained from max pooling and average pooling, respectively, to form the final temporal attention output; Step 5: Extract channel-dimensional attention features using the Quantum Channel Attention Module (QCA); Step 5 specifically includes the following steps: Step 5.1: Obtain spatial information of the channel layer using a global pooling layer to map global spatial features to the channel descriptors; the global average pooling operator is the global feature matrix. Represented as: ; in, Let H be the input image of the c-th channel at time step t, where H represents the number of rows in the matrix, W represents the number of columns in the matrix, and (i,j) represents the element in the i-th row and j-th column. Step 5.2: Input the feature map after global average pooling into the quantum neural network QNN for calculation to extract the attention information of each channel at different time steps; before inputting into the QNN, combine the quantum state encoding method used in the quantum temporal attention module QTA to perform quantum state mapping on the feature matrix Z. The overall encoding process is represented as follows: ; in, U represents the quantum state obtained by quantum encoding the channel features at time step t. encoding (Z) represents the encoding operator that converts the characteristic matrix Z into the corresponding quantum state; Step 5.3: Measure the obtained quantum state to obtain the channel attention weights based on the output probability amplitude information of each time step; since the channel feature vectors of each time step are input into the QNN respectively, each time step is measured independently, and the measurement results are used to calculate the importance weights of the channel features at that time step. Step 5.4: Describe the entire process of quantum channel attention extraction as a mapping. The entire process of attention extraction in a quantum channel can be represented as: O ; Where O∈R T×C This is the quantum channel attention matrix, where R is the set of real numbers; Step 6: Extract time-dimensional attention features using the Quantum Temporal Attention (QTA) module and fuse them with channel-dimensional attention features using the Attention Fusion (AFU) module; Step 7: Construct a QTCAC-SNN model that integrates the quantum time channel attention encoding module QTCAC and the spatiotemporal adaptive membrane residual network TSA-MS-ResNet. Use the QTCAC module for image encoding and use TSA-MS-ResNet to perform classification tasks. Step 8: Use a hybrid training strategy combining quantum neural networks and spiking neural networks to optimize the training of the traffic sign classification model, and deploy the trained model in the sign classification task to achieve green and efficient computation.
2. The energy-saving green traffic sign classification method based on quantum pulsing neural networks according to claim 1, characterized in that, The initialization settings for the traffic sign classification model in step 1 are as follows: set the parameters for the number of qubits, convolution kernel size, learning rate, batch size, and training epochs in the quantum time attention module (QTA) and quantum channel attention module (QCA); wherein, the number of qubits in QTA is set to be equal to the number of time steps T, and the number of qubits in QCA is set to be consistent with the number of channels C.
3. The energy-saving and green traffic sign classification method based on quantum pulsing neural networks according to claim 1, characterized in that, Step 2 specifically involves: for the static input X in the dataset, copying it along the time dimension to T time steps to obtain an initial input image X'∈R containing time features. 1:T R represents the set of real numbers; thus, the original static data exhibits dynamic evolution characteristics in the time dimension.
4. The energy-saving green traffic sign classification method based on quantum pulsing neural networks according to claim 1, characterized in that, Step 3 specifically includes the following steps: Step 3.1: Input the initial input image X' of the model into the convolutional layer Conv and the batch normalization layer BN in sequence. The convolutional layer is used to extract the feature information of the input data, and the batch normalization layer is used to improve the training efficiency and stability of the model. Step 3.2: Input the feature mapping processed by Conv and BN layers into the TSA-LIF spiking neuron layer to complete the spiking conversion and enhancement, thereby generating spiking signal features and obtaining the final enhanced coding output result. TSA-LIF neurons allow membrane potential and input signal to decay independently. The neuron model integrated with variable decay is represented as follows: ; in, This represents the membrane potential of the nth layer at time step t. Indicates the membrane potential decay coefficient. This represents the membrane potential constant of a neuron. This represents the historical membrane potential at a given time step within the same layer, and λ represents the input weighting coefficient of the neuron. This represents the current input signal of the nth neuron at time step t; by using... and Independent learning to assign temporal and spatial decay parameters as different variable decay terms; Define spatial attenuation factor and time decay factor as follows: ; This represents the input weight coefficient of the nth neuron. This represents the attenuation coefficient of the nth layer membrane potential; By independently training two learnable decay factors, the following is defined: ; Among them, spatial and temporal decay factors and They learn independently and share parameters within the same layer but at different time steps, and have different parameters when trained on different layers.
5. The energy-saving green traffic sign classification method based on quantum pulsing neural networks according to claim 1, characterized in that, Step 6 specifically involves: firstly, fusing the temporal attention vector and the channel attention vector separately, jointly modeling the attention information of the temporal and channel dimensions, so that the attention features of both are integrated in each channel and each spatial location, thereby forming the final multidimensional attention fusion result.
6. The energy-saving green traffic sign classification method based on quantum pulsing neural networks according to claim 1, characterized in that, Step 7 specifically involves: adopting the quantum time-channel attention coding scheme QTCAC in the encoding stage, and introducing the TSA-MS-ResNet architecture with membrane residual connection structure in the network training stage; wherein, the top layer of the residual connection retains the LIF spiking neuron layer to maintain the sparsity of the spiking signal, while removing redundant neurons between layers to construct the mapping path.
7. The energy-saving green traffic sign classification method based on quantum pulsing neural networks according to claim 1, characterized in that, Step 8 specifically includes the following steps: Step 8.1: During the training phase of the Spiking Neural Network (SNN), the Temporal and Channel Joint Backpropagation (STBP) algorithm is used to train the deep SNN. During error backpropagation, the last layer of the model is used as the decoding layer, and its output is denoted as Q. The output Q is processed by a softmax layer and then used to calculate the cross-entropy loss function between the output and the label vector Y. Its expression is: ; in, This is a one-hot encoding of the true labels, where only the correct category is assigned a value of 1, and the rest are assigned a value of 0. n is the total number of categories, e represents the natural constant, and q... i Let q represent the logit value of the i-th class. j This represents the logit value of the j-th class; Step 8.2: During the training phase of the quantum circuit, the loss function L of the quantum neural network QNN is... QNN Using the cross-entropy loss form, it is expressed as: ; in, The expected value of the quantum state measurement is obtained through quantum measurement; Step 8.3: Employing a hybrid training mechanism combining Spiking Neural Networks (SNN) and Quantum Neural Networks (QNN), the loss functions of both are jointly optimized to construct the overall loss function: ; During model training, the parameters of SNN and QNN are simultaneously optimized by continuously minimizing the total loss function.
Citation Information
Patent Citations
Image processing method and system based on pure quantum pulse neural network model
CN118628814A
Traffic sign recognition method based on quantum convolutional neural network
CN118762349A