Classification method based on photon pulse graph neural network and linear calculation implementation method

CN121959153BActive Publication Date: 2026-10-09XIDIAN UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511921866.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-12-18
Publication Date
2026-10-09
Estimated Expiration
2045-12-18

AI Technical Summary

Technical Problem

然而,传统神经网络对时序依赖特征的捕捉不敏感,对动态数据的感知能力与社交分类能力较低,并且,现有电子计算平台的处理速度和可扩展性均较低

Benefits of technology

1)本发明提出一种将脉冲神经网络(SNN)引入图神经网络(GNN)的融合网络架构,通过借助SNN特有的脉冲发放编码与膜电位累积机制,实现了对时序信息的天然化表达与精细化处理,相较于传统依赖静态激活函数的深度神经网络而言,该融合网络架构在动态感知数据(如网络购物行为序列)处理场景中,能够显著提升网络对时序依赖特征的捕捉敏感度,进而有效增强对动态数据感知能力与社交分类任务性能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121959153B_ABST
    Figure CN121959153B_ABST
Patent Text Reader

Abstract

The application discloses a classification method based on a photon pulse graph neural network and a linear calculation implementation method. The photon pulse graph neural network comprises D network layers and a decision output layer, the D network layers are sequentially connected, and the output end of the last network layer is connected with the input end of the decision output layer, and the network structure of each network layer adopts the structure of a pulse neural network. The linear calculation implementation method comprises the following steps: selecting the weight matrix of M network layers of the trained photon pulse graph neural network; loading the weight matrix of each network layer into an MZI network, loading the input signal required when each network layer is linearly calculated into a light source, and then injecting the light source loaded with the input signal into the corresponding MZI network to complete the linear calculation of the input signal and output. The application can significantly improve the capture sensitivity of the network to the time-dependent characteristics, and has higher processing speed, lower power consumption and stronger scalability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of artificial intelligence technology, specifically relating to a classification method and linear calculation implementation method based on a photon pulse graph neural network. Background Technology

[0002] With the scaling up of social media platforms, the accelerated digital transformation of enterprises, the growing demand for public health emergency prevention and control, and the rapid increase in the need for coordinated financial risk supervision, social network analysis systems have become one of the important technologies for quantifying complex relationships and making dynamic decisions. Currently, most social network analysis systems rely on electronic computing platforms to run traditional graph neural networks (GNNs), graph attention networks (GATs), or other machine learning models to process social network data (such as user relationship data, text interaction data, and dynamic behavior data) to complete tasks such as community structure identification, key node location, and public opinion propagation prediction. However, traditional neural networks are not sensitive to capturing time-dependent features, have low perception capabilities for dynamic data and social classification capabilities, and existing electronic computing platforms have low processing speed and scalability. Summary of the Invention

[0003] To address the aforementioned problems in the existing technology, this invention provides a classification method and a linear calculation implementation method based on a photon pulse graph neural network. The technical problem to be solved by this invention is achieved through the following technical solution: This invention provides a classification method based on a photon pulse graph neural network, comprising: Obtain the graph structure data to be processed, wherein the graph structure data to be processed includes: a node feature matrix. and adjacency matrix ; For the adjacency matrix The adjacency matrix is ​​obtained by normalization. ; The normalized adjacency matrix and the node feature matrix The input is fed into a photon pulse graph neural network, which outputs a classification result. The photonic pulse graph neural network includes D network layers and a decision output layer. The output of the d-th network layer is connected to the input of the (d+1)-th network layer, and the output of the D-th network layer is connected to the input of the decision output layer. Each network layer adopts the structure of a spiking neural network. D is a positive integer greater than or equal to 2, and the value of d is from 1 to D-1.

[0004] This invention also provides a linear computation implementation method based on MZI, the method comprising: Obtain the weight matrices of each network layer of the trained photon pulse graph neural network, and select M weight matrices from them; M is a positive integer greater than or equal to 1. The weight matrix of the m-th network layer is loaded into the m-th MZI network. Each MZI network consists of P×P connected MZI units, and each MZI unit represents a weight value. A multi-channel light source with a preset wavelength interval is used as the input signal source. An optical modulator is used to load a pulse signal onto the input signal source so that the input signal required for the linear calculation of the m-th network layer is loaded onto the m-th input signal source, thus obtaining the m-th light source loaded with the input signal. After the m-th light source loaded with the input signal is injected into the injection port of the m-th MZI network through an optical fiber, each MZI unit performs linear calculations on the input signal and outputs the linear calculation results through the output port of the m-th MZI network.

[0005] Compared with the prior art, the beneficial effects of the present invention are as follows: 1) This invention proposes a fusion network architecture that incorporates spiking neural networks (SNNs) into graph neural networks (GNNs). By leveraging the unique pulse firing encoding and membrane potential accumulation mechanism of SNNs, it achieves a natural expression and refined processing of temporal information. Compared with traditional deep neural networks that rely on static activation functions, this fusion network architecture can significantly improve the network's sensitivity to capturing temporal-dependent features in dynamic data processing scenarios (such as online shopping behavior sequences), thereby effectively enhancing the network's ability to perceive dynamic data and its performance in social classification tasks.

[0006] 2) Due to the event-driven nature of spiking neurons, they only fire pulses when the threshold is exceeded. Therefore, the overall computational cost of the network is more sparse. In the future, when deployed on neuromorphic hardware (such as Loihi and TrueNorth), the core advantages of low power consumption and high real-time performance of the hardware can be fully utilized, providing a graph neural network solution with both bio-inspired characteristics and engineering practical value for classification tasks in resource-constrained scenarios.

[0007] 3) In training the proposed photon pulse graph neural network, this invention constructs a simulation mechanism for the bias term through a feature dimension expansion strategy, which enables effective training of the network.

[0008] 4) This invention uses an MZI photonic network structure that is easier to configure to realize the linear calculation of the network layer in the photonic pulse graph neural network, which simplifies the configuration process of the weight matrix in the photonic neural network. Moreover, compared with the existing electronic computing platform, it has higher processing speed, lower power consumption and stronger scalability, and is suitable for the deployment needs of the next generation of high-performance, low-latency social networks.

[0009] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. Attached Figure Description

[0010] Figure 1 This is a schematic flowchart of a classification method based on a photon pulse graph neural network provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a 2×2 MZI basic unit; Figure 3 This is a schematic diagram of the architecture for implementing community classification based on the KarateClub dataset provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the architecture of an inference device for implementing linear computation of layer 2 provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the PSGNN network processing flow for input data provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the final visualized classification result obtained by the PSGNN network provided in the embodiment of the present invention; Figure 7 This is an exemplary schematic diagram showing the growth of training accuracy and loss as a function of the number of epochs for the PSGNN network provided in this embodiment of the invention. Figure 8 This is a schematic diagram of a control architecture for loading a weight matrix into an MZI network, provided in an embodiment of the present invention. Detailed Implementation

[0011] The present invention will be further described in detail below with reference to specific embodiments, but the implementation of the present invention is not limited thereto.

[0012] Figure 1 This is a flowchart illustrating a classification method based on a photon pulse graph neural network provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method includes: S101. Obtain the graph structure data to be processed, wherein the graph structure data to be processed includes: node feature matrix. and adjacency matrix .

[0013] Here, the graph structure data to be processed is the graph structure data of social networks. Social networks include social networks, public health networks, transportation networks, etc. Therefore, the graph structure data of social networks can be the graph structure data of social networks, public health networks, or transportation networks. The graph structure data is represented as G=(V, E), where V is the set of nodes and E is the set of edges. Each node in the node set has initial feature data, and each edge in the edge set represents whether two corresponding nodes are connected. It can be understood that the graph structure data includes: a node feature matrix composed of the initial feature data of all nodes in the node set. and the adjacency matrix consisting of all the edges in the edge set. For example, when the graph structure data to be processed is the graph structure data of a social network, and the node set is composed of... A set of different users, where the initial feature data for each user is a row matrix representing static attributes such as age, gender, and social information, and dynamic attributes such as the user's social platform usage at each point in time. When, then the node feature matrix yes The matrix, i.e. And, adjacency matrix yes The matrix, and the adjacency matrix elements in Used to represent users and users Does a static relationship exist between them (e.g., are they friends, do they follow each other)? / Used to represent users and users Are there interactions at each point in time, and when When, it indicates the user and users There is a correlation between them, when When, it indicates the user and users There is no correlation between them. For example, when the graph structure data to be processed is the graph structure data of a transportation network, and the node set is composed of... If a set of different traffic intersections is formed, and the initial feature data of each traffic intersection represents the traffic flow, pedestrian flow and other attribute information of the intersection at each time point, then the node feature matrix can represent whether any two traffic intersections are adjacent.

[0014] S102, Adjacency Matrix The adjacency matrix is ​​obtained by normalization. .

[0015] Here, the adjacency matrix can be processed using the GCN algorithm. Normalization processes are performed, such as introducing self-loops and symmetric normalization, to optimize the aggregation weights of node features. Specifically, the adjacency matrix is ​​first... Adding self-loops yields the adjacency matrix with added self-loops. ,in, , Represents the identity matrix, and when the adjacency matrix is... yes When the matrix is, yes The identity matrix is ​​obtained by using the adjacency matrix. Adding self-loops ensures that node features are aggregated; next, the adjacency matrix with added self-loops is calculated. degree matrix Finally, a degree matrix is ​​used. For adjacency matrices with added self-loops Symmetric normalization is performed to obtain the normalized adjacency matrix. ,in, By analyzing the adjacency matrix Normalization can balance the excessive influence of degree nodes on the neighborhood, making feature aggregation more stable.

[0016] S103, normalize the adjacency matrix and node feature matrix The input is fed into a photon pulse graph neural network (PSGNN network) and the output is a classification result. The PSGNN network consists of D network layers and a decision output layer. The output of the d-th network layer is connected to the input of the (d+1)-th network layer, and the output of the D-th network layer is connected to the input of the decision output layer. The network structure of each network layer adopts the structure of an SNN network. D is a positive integer greater than or equal to 2, and the value of d is from 1 to D-1.

[0017] For example, when the graph structure data to be processed is social network graph structure data, and the initial feature data of each user represents static attributes such as the user's age, gender, and social information, the output classification result can be a classification result of user type. When the graph structure data to be processed is social network graph structure data, and the initial feature data of each user represents dynamic attributes such as the user's social platform usage information at each time point, the output classification result can be a classification result of whether the users are friends, which can be used in social recommendation scenarios. As another example, when the graph structure data to be processed is traffic network graph structure data, and the initial feature data of each traffic intersection represents dynamic attributes such as traffic flow and pedestrian flow at each time point, the output classification result can be a classification result of whether there is congestion.

[0018] In this invention, taking D=3 as an example, the first network layer is called layer1, the second network layer is called layer2, and the third network layer is called layer3. Since the network architectures of layers1, layer2, and layer3 are all the same as those of SNN networks, each of layers1, layer2, and layer3 consists of a fully connected layer + a spiking layer (i.e., a Leaky Integrate and Fire (LIF) layer). That is, each neuron in layers1, layer2, and layer3 has a membrane potential threshold. Synaptic weights Membrane potential attenuation coefficient Layers 1, 2, and 3 all possess the characteristics of SNN networks. Therefore, layers 1, 2, and 3 can better extract temporal information and also have the advantage of low energy consumption by leveraging the time-varying characteristics of the membrane potential of spiking neurons. Specifically, layers 1, 2, and 3 can map the features of each node in the node feature matrix to the initial membrane potential of the spiking neuron, and accumulate the membrane potential through synaptic input of temporal events. When the membrane potential exceeds a preset threshold, pulse firing is triggered, realizing the pulse signal encoding of "node spatial features - temporal events." Simultaneously, the pulse transmission efficiency is modulated using graph edge weights, strengthening the temporal information interaction between important related nodes. Layer 1 serves as the perceptual layer and graph pulse coding layer of the PSGNN network proposed in this invention, while layers 2 and 3 serve as the spatiotemporal feature interaction layers of the PSGNN network proposed in this invention. The spatiotemporal feature interaction layers, based on the pulse signal output by layer 1, achieve cross-node spatiotemporal feature aggregation through pulse graph convolution operations. Specifically, the spatiotemporal feature interaction layer introduces a multi-layer cluster of spiking neurons. Each neuron is associated with a graph adjacency matrix. After receiving pulse input from neighboring nodes, it dynamically updates its state based on its own membrane potential (membrane potential accumulation-decay-pulse firing cycle), and passes the aggregated spatiotemporal features to the next layer through pulse propagation. Simultaneously, a time decay factor is introduced to give higher weight to the influence of recent pulses on node states, enhancing the capture of temporal dependencies. Leveraging the event-driven nature of spiking neurons, computation is activated only when the membrane potential exceeds a threshold, achieving sparse feature interaction and reducing redundant overhead. The decision output layer, as the output layer of the PSGNN network proposed in this invention, is a fully connected layer.

[0019] In this invention, the model for each neuron in layer 1 / layer 2 / layer 3 adopts the LIF neuron model, and the update equation for the membrane potential of the LIF neuron model is as follows: ; ; in, Indicates the first Discrete time steps Indicates that the neuron is in the first The membrane potential at discrete time steps Indicates that the neuron is in the first Membrane potential at +1 discrete time step, Indicates the input signal. Represents the membrane potential decay coefficient, 0 < <1; Represents the impulse function. Let represent the activation function, where , This indicates a trimming operation. Specifically, when the membrane potential... When the threshold is exceeded, the neuron releases a pulse and resets the membrane potential to [value missing]. (or approximately 0), thus achieving the so-called discharge process. In the above formula, The smaller the value, the more significant the attenuation; the larger the value, the higher the retention of historical membrane potential. This is due to the pulse function. Since it is inherently non-differentiable, this invention employs an approximate activation function. Alternative This hard jump, and by introducing it in backpropagation This method allows for the calculation of the membrane potential gradient.

[0020] In some embodiments, the above-mentioned S103 is achieved through the following steps: S1031, Normalize the adjacency matrix and node feature matrix After encoding the initial state, input the trained layer1.

[0021] Specifically, the adjacency matrix and node feature matrix Each row of the resulting matrix after multiplication is used as a partial signal after encoding, and all encoded signals are input into the trained layer1.

[0022] S1032, The trained layer 1 utilizes the membrane potential threshold Synaptic weights Membrane potential attenuation coefficient The neurons process the encoded signal and output the resulting pulse signal to the trained layer 2.

[0023] Specifically, the fully connected layer in the trained layer 1 receives the encoded signal and performs a preliminary transformation on the encoded signal using a fully connected structure containing a bias term. The transformed signal is then input into the LIF layer in the trained layer 1. The LIF layer uses a LIF neuron model to convert the input signal into a pulse signal. It should be noted that the entire process is repeated T times (i.e., simulating pulse firing at T time steps) to allow the signal to propagate dynamically in the time dimension. The value of T is set according to actual needs; this invention does not limit it.

[0024] S1033, The trained layer 2 utilizes the membrane potential threshold. Synaptic weights Membrane potential attenuation coefficient The neurons process the pulse signals and output the resulting high-level pulse signals to the trained layer 3.

[0025] S1034, The trained layer 3 utilizes the membrane potential threshold Synaptic weights Membrane potential attenuation coefficient The neurons process the high-level pulse signals and output the updated high-level pulse signals to the decision output layer. It should be noted that the processing principles of layer 2 and layer 3 are the same as those of layer 1, and will not be repeated here.

[0026] Specifically, the first The output of the nth network layer is the nth The output of the -1st network layer is obtained through neighborhood aggregation and linear transformation, and the trained _th ... Each network layer (i.e., the trained layer) The expression for the output signal is as follows: ; in, The value of is from 1 to D. This represents the trained layer. The output signal, This represents the trained layer. The output signal, and when When the value is 1, Representing the node feature matrix , This represents the trained layer. The learnable weight matrix, and, , Represents layer The feature dimensions. This represents an activation function (such as ReLU or Sigmoid) used to introduce non-linear expressive power.

[0027] It should be noted that since the network architectures of layers 1, 2, and 3 are the same as those of SNN networks, the processing principles of layers 1, 2, and 3 on the input data are the same as those of SNN networks. Therefore, this invention will not elaborate further on this.

[0028] S1035, the decision output layer analyzes and transforms the updated high-level pulse signal and outputs the classification result.

[0029] Here, the high-level pulse signals output by the spatiotemporal feature interaction layer are analyzed and transformed to generate the output results for specific tasks. The decision output layer converts the pulse signals into continuous or discrete feature vectors by statistically analyzing the firing frequency, membrane potential peak, or pulse time distribution of spiking neurons within a time window. The final results are then output through task adaptation modules (such as classifiers and regressors), supporting tasks such as classification (e.g., social network user tag classification, abnormal behavior detection) and prediction (e.g., user behavior trend prediction) in dynamic scenarios. The output results can be directly used for decision support in subsequent application systems. Specifically, for each node in the graph structure data to be processed, when there are Q node types to be classified, the decision output layer contains Q neurons, each representing a node type. After the graph structure data to be processed passes through layers 1, 2, and 3 sequentially for processing and data transmission, each neuron in the decision output layer (corresponding to the node type to be classified) generates a "pulse sequence" of length T for that node. This pulse sequence is a numerical sequence composed of 0s and 1s. When the value corresponding to a certain time step is 1, it means that a pulse was generated at that time step, and when the value corresponding to a certain time step is 0, it means that no pulse was generated at that time step. The decision output layer first performs pulse statistics. Specifically, it sums the pulse sequences of length T generated by each neuron to obtain the total number of pulses for each neuron within T time steps. Then, it divides the total number of pulses for each neuron within T time steps by the time step T to obtain the pulse frequency per unit time for each neuron. Next, the decision output layer classifies and predicts the node type of the node based on the magnitude of the pulse frequencies of Q neurons per unit time. The node type corresponding to the neuron with the highest pulse frequency per unit time is the predicted node type. Q is a positive integer greater than or equal to 2.

[0030] To satisfy the dual constraints of "unbiased estimation" and "non-negativity of weights" during training, a simulation mechanism for the bias term needs to be introduced by expanding the feature dimension. Specifically, at each feature input or transformation stage, an additional "bias channel" with a fixed dimension is added to the current feature matrix. The design of this bias channel satisfies two core characteristics: first, all elements in the channel are always 1, that is, for a dimension of... Feature matrix ( For the number of nodes, (Original feature dimension), the expanded feature matrix becomes The newly added column vector ( For all (Established); secondly, assign independent learnable parameters to this deviation channel. Furthermore, this parameter, along with the weight parameters of the original feature dimension, is incorporated into the "non-negativity constraint" optimization. In some embodiments, the training method for the PSGNN network includes S1~S8: S1. Obtain the training dataset. The training dataset contains multiple training samples. Each training sample contains a node feature matrix and an adjacency matrix, and each training sample also has a label matrix. The dimension of the node feature matrix in each training sample is... , representing by The dimension of each node is The matrix formed by the eigenvectors; and All are positive integers greater than 1.

[0031] S2. Add a bias channel with an element always equal to 1 to the node feature matrix of each training sample to reduce the dimension of the node feature matrix of each training sample from... Expand to This yields training samples for each node with its feature matrix expanded to the next dimension.

[0032] For example, for a dimension of Node feature matrix After dimensional expansion, it becomes a dimension of Node feature matrix It should be noted that the dimension of this deviation channel is fixed.

[0033] S3. Initialize the weight matrices of each of the D network layers, and add a column vector to each initialized weight matrix to represent the learnable parameters of the bias channel, so as to obtain the weight matrices of each of the D network layers with bias learnable parameters. Set the constraint condition for each weight matrix with bias learnable parameters to indicate that all elements are non-negative.

[0034] S4. Construct the initial PSGNN network based on the weight matrices of the D network layers, each with learnable bias parameters.

[0035] For example, when D is 3, the initial PSGNN network includes: layer 1, layer 2, and layer 3 with weight matrices having learnable bias parameters, and a decision output layer. Subsequent training iterations adjust the weight matrices of layer 1, layer 2, and layer 3 with their respective learnable bias parameters. The PSGNN network obtained after each training iteration is the PSGNN network consisting of the decision output layer and layers 1, layer 2, and layer 3 with the adjusted weight matrices. The trained PSGNN network is the PSGNN network consisting of the decision output layer and layers 1, layer 2, and layer 3 with the final adjusted weight matrices.

[0036] S5. During the c-th training iteration, select at least one training sample with a node feature matrix expanded by dimension as the training sample for the c-th iteration, and input the training sample for the c-th iteration into the PSGNN network obtained from the (c-1)-th training iteration to obtain the output result of each training sample for the c-th iteration; c is a positive integer greater than or equal to 1; when c is 1, the PSGNN network obtained from the (c-1)-th training iteration is the initial PSGNN network.

[0037] S6. Input the label matrix and output result of the training sample of the cth iteration into the loss function, and calculate the loss value of the cth iteration.

[0038] Here, the loss function is either the cross-entropy loss function or the mean squared error loss function. Since both of these loss functions are existing loss functions, they will not be described in detail here.

[0039] S7. Adjust the network parameters of the PSGNN network obtained from the (c-1)th training based on the loss value of the cth training to obtain the PSGNN network obtained from the cth training.

[0040] Specifically, S7 is implemented through steps S71 to S74: S71. Backpropagation is performed based on the loss value of the cth iteration to update the weight matrix of the PSGNN network obtained from the (c-1)th training iteration, resulting in a preliminarily adjusted PSGNN network.

[0041] It should be noted that the weight matrices of layer 1, layer 2, and layer 3 of the PSGNN network obtained from the (c-1)th training need to be adjusted simultaneously.

[0042] S72. Determine whether the threshold for adjusting the neuron's membrane potential has been reached based on the value of c. Synaptic weights Membrane potential attenuation coefficient conditions.

[0043] For example, whether the threshold for adjusting the neuron's membrane potential has been reached can be determined by judging whether the value of c reaches a preset value. Synaptic weights Membrane potential attenuation coefficient For example, if the preset value is a multiple of 100, then if the size of c is any multiple of 100, it means that the membrane potential threshold of neurons in layer 1, layer 2, and layer 3 needs to be adjusted again. Synaptic weights Membrane potential attenuation coefficient When the value of c is not any integer multiple of 100, it means that the membrane potential thresholds of neurons in layer 1, layer 2, and layer 3 do not need to be adjusted this time. Synaptic weights Membrane potential attenuation coefficient .

[0044] S73. When the conditions for adjusting the neuron threshold, synaptic weight, and membrane potential decay coefficient are met, adjust the membrane potential threshold of neurons in each network layer of the initially adjusted PSGNN network. Synaptic weights Membrane potential attenuation coefficient After adjustments, the PSGNN network obtained from the c-th training iteration is obtained.

[0045] It should be noted that the efficiency of temporal pulse coding can be optimized by adjusting the threshold of neurons, synaptic weights, and membrane potential decay coefficients. The specific settings for adjusting these parameters can be determined according to actual needs, and this invention does not impose any limitations on them.

[0046] S74. When the conditions for adjusting the threshold of neurons, synaptic weights and membrane potential decay coefficients are not met, the initially adjusted PSGNN network is used as the PSGNN network obtained in the cth training.

[0047] S8. Set c=c+1 and return to S5 above to continue execution until the preset conditions are met, then stop training and use the PSGNN network obtained from the last training as the trained PSGNN network.

[0048] Here, the preset condition can be that the difference between the calculated loss value and the previously calculated loss value is less than a preset difference, i.e., loss convergence, or the number of training rounds reaches the maximum. This invention does not limit this.

[0049] The PSGNN network proposed in this invention can jointly model the spatiotemporal features of static graph data or dynamic graph data (such as social network time-series interaction data and dynamic point cloud sequences). While ensuring low-energy computation, it improves the ability to capture temporal dependencies and topological associations, thereby efficiently completing tasks such as classification, prediction, and anomaly detection.

[0050] This invention also provides a linear computation implementation method based on MZI, the method comprising: S201. Obtain the weight matrices of each network layer of the trained PSGNN network, and select M weight matrices from them; M is a positive integer greater than or equal to 1.

[0051] Here, M is a positive integer greater than or equal to 1 and less than or equal to D, and m takes values ​​from 1 to M.

[0052] S202. Load the weight matrix of the m-th network layer into the m-th MZI network. Each MZI network consists of P*P connected MZI units, and each MZI unit represents a weight value.

[0053] Here, MZI is short for Mach-Zehnder Interferometer. Each MZI unit is a 2×2 basic MZI unit, and each 2×2 basic MZI unit integrates four electro-optic phase shifters, two in the inner arm and two in the outer arm. For example, Figure 2 This is a schematic diagram of a 2×2 MZI basic unit. (Example) Figure 2 As shown, BS1 and BS2 are two 3dB (50:50) beam splitters. θ and φ are two phase shifters PS on the inner and outer arms, respectively. The inner PS controls the output power of the MZI basic unit, and the outer PS determines the relative phase of the MZI basic unit output. Each MZI network is composed of P×P 2×2 MZI basic units cascaded and cross-connected. For example, each MZI network is composed of 4×4 or 16×16 2×2 MZI basic units cascaded and cross-connected.

[0054] It should be noted that the size of N is determined by the number of rows in the input signal matrix. For example, when the input signal is in matrix form and the matrix has 4 rows, then N is 4.

[0055] Specifically, the formula for calculating the weight value represented by each MZI unit is as follows: ; in, This indicates the weight value represented by the MZI cell. This represents the input value of the MZI unit. The imaginary unit is used because, in the weight calculation of the MZI unit, the transformation matrix of the MZI is a matrix in the complex field (since the modulation of optical signals involves complex field operations of phase and amplitude). Therefore, the imaginary unit is required. To describe the phase / amplitude relationship of a complex signal. This indicates the phase shift of the electro-optic phase shifter inside the MZI unit, and, by adjusting... The size of the MZI cell controls the weight value it represents. It represents the square of the absolute value.

[0056] S203. Using a multi-channel light source with a preset wavelength interval as the input signal source, a light modulator is used to load a pulse signal onto the input signal source so that the input signal required for the linear calculation of the m-th network layer is loaded onto the m-th input signal source, thus obtaining the m-th light source loaded with the input signal.

[0057] For example, a multi-channel light source with wavelengths spaced 0.5 nm apart can be used as the input signal source.

[0058] S204. After the m-th light source loaded with the input signal is injected into the injection port of the m-th MZI network through the optical fiber, each MZI unit performs linear calculation on the input signal and outputs the linear calculation result through the output port of the m-th MZI network.

[0059] Here, after the m-th light source carrying the input signal is injected into the injection port of the m-th MZI network through an optical fiber, the change in light intensity is achieved through the interference effect within each MZI unit and the coupling effect of the DC coupler, resulting in O= WI The calculation is performed, and the linear calculation result O is output at the output port of the m-th MZI network, where, I It is the input signal of the m-th MZI network. W It is the weight matrix loaded into the m-th MZI network.

[0060] The linear computation method based on MZI provided by this invention can transfer PSGNN network-based models to photonic chip platforms, enabling full-process brain-like classification analysis and reasoning.

[0061] In some embodiments, when performing step S103, the above-described MZI-based linear computation implementation method can be used. The weight matrices of one or two or more or all of the network layers of the trained PSGNN network are preloaded into the corresponding MZI network. When specifically performing step S103, the above-described MZI-based linear computation implementation method is used to quickly realize the linear computation (i.e., matrix multiplication and addition) of the corresponding network layer through the MZI network loaded with the weight matrices of the corresponding network layer.

[0062] The following section further validates the effectiveness of this invention in static graph topology analysis by implementing community classification based on the KarateClub dataset, while also demonstrating the synergistic advantages of "graph structure + pulse timing coding". The KarateClub dataset is a classic benchmark in the field of graph learning, containing 34 members (nodes) of a university karate club and the social interaction relationships (edges) between members. The goal is to detect two potential communities (a split caused by a conflict between the club administrator and the coach) based on the interaction relationships.

[0063] Figure 3 This is a schematic diagram of the architecture used to implement community classification based on the KarateClub dataset. For example... Figure 3 As shown, the KarateClub dataset contains 34 nodes and 78 undirected edges. Each node has no initial features; therefore, one-hot encoding is used to construct the node feature matrix. The adjacency matrix constructed based on the KarateClub dataset is shown below. yes The matrix, node feature matrix yes The matrix, Adjacency matrix Using a 34×34 matrix (corresponding to 34 nodes in the dataset), the social connections among karate club members are precisely characterized by the values ​​(0 or 1) of the matrix elements. Each row and column of the matrix corresponds to a node, and non-zero elements represent direct interaction edges between two nodes. The node feature matrix assigns a 34-dimensional initial feature vector to each node; these features can be considered the basic attributes of the nodes, providing raw data support for subsequent information learning. The adjacency matrix... After normalization, the adjacency matrix can be obtained. and node feature matrix Adjacency matrix and node feature matrix Once the encoding is in its initial state, you can input the code. Figure 3 The PSGNN network shown on the right contains layers 1, 2, and 3. The weight matrix of layer 2 is loaded into the MZI network, and the linear computation of layer 2 is implemented by the inference device containing the MZI network. Figure 3 The lower right side shows a schematic diagram of the inference device containing an MZI network used to implement linear computation of layer 2. The orange dashed box shows the internal structure of an MZI unit. Figure 4 This is a schematic diagram of the inference device architecture used to implement linear computation of layer 2. For example... Figure 4 As shown, when layer 2 performs linear calculations, the input signal required is a matrix consisting of 1 to 4 row matrices. Therefore, the inference device needs to include four MZMs to modulate each row matrix signal onto the light source and send it to the input port of the MZI network. After processing by the MZI network, these four row matrices yield the corresponding linear calculation results O1 to O4. (Continue to refer to...) Figure 3 After the encoded features are processed by the trained PSGNN network, these 34 nodes can be divided into two categories, namely Mr. Hi and Officer communities.

[0064] Figure 5 This is a schematic diagram illustrating the processing flow of the PSGNN network for input data. For example... Figure 5 As shown, the adjacency matrix after normalization of the KarateClub dataset... and node feature matrix After encoding to the initial state, the encoded signal h1[·]~h can be obtained. n [·], when the encoded signal h1[·]~h n [·] After inputting layer1, the fully connected layer in layer1 adopts a fully connected structure that includes a bias term (i.e., Figure 5 The fully connected structure composed of blue nodes (including a bias term) performs an initial transformation on the encoded signal and inputs the transformed signal into the LIF layer in the trained layer 1. The LIF layer uses a LIF neuron model to convert the input signal into a pulse signal. The entire process is repeated T times to simulate the pulse firing process over T time steps. When representing each time step, time step The pulse firing process is as follows: The neuron receives input from its neighborhood: (Aggregating neighborhood membrane potentials via an adjacency matrix); Membrane potential update: (Attenuation + Input Accumulation); Pulse Delivery Judgment: If... ,but (Eject pulse), simultaneously reset membrane potential to ;otherwise The membrane potential remains at its decayed value, where each node is assigned one spiking neuron. The initial membrane potential of a spiking neuron ( (For initializing weights). After processing by layer 1, a pulse signal is generated. Then, layers 2 and 3 process the signal sequentially using the same principle, and the final generated pulse signal, Output of spikes, is output, as shown below. Figure 6 As shown, for each node, the final generated pulse signal is a pulse sequence of length T generated by neuron 0 and neuron 1 respectively, where "1" represents that a pulse was generated at that time step, and "0" represents that no pulse was generated. The decision output layer performs spike statistics and classification prediction based on the pulse sequences of length T generated by neuron 0 and neuron 1. Specifically, the decision output layer counts and sums (sumΣ) the pulse sequences of neuron 0 and neuron 1 respectively, obtaining the total number of pulses m and n of neuron 0 and neuron 1 within T time steps. Then, m and n are divided by T respectively to obtain the pulse frequencies m / T and n / T of neuron 0 and neuron 1 per unit time. Next, the decision output layer classifies the node into two categories based on the magnitude of m / T and n / T. For example, the category corresponding to the neuron with the higher pulse frequency per unit time is the final classification result of the node. Figure 5 For example, the node is categorized as "Officer". For example, Figure 6 It was through Figure 5 The diagram shows a visual representation of the final classification result obtained by the PSGNN network after processing. For example, Figure 7 This is a schematic diagram showing the growth of training accuracy and loss of the PSGNN network with the number of epochs.

[0065] Figure 8 This is a schematic diagram of a control architecture when loading a weight matrix into an MZI network. (Example) Figure 8The FPGA is used to transmit digital signals. An internal DAC (Digital-to-Analog Converter) converts the digital signals into electrical signals (voltage) which are then supplied to the modulator. The modulator modulates the signal onto light. The TC (Temperature Controller) controls the temperature of the chip (the chip containing the MZI network) to prevent overheating and thus suppress phase drift. The MCVS (Modulation Controller Voltage Regulator) applies voltage to the phase shifter in the chip. Changing the voltage alters the phase of the phase shifter, thereby changing the output power, which in turn changes the chip's internal transfer function (transfer matrix) and indirectly alters the chip's weights. The MZM (Modulation Controller) controls the light intensity via electrical signals. The PC (Polarization Controller) adjusts the polarization direction of the light; optimizing the PC maximizes the output light power. The OS (Optimal Operating System) controls the path or disconnection of the light. The 4×4 MZI is used for matrix multiplication and addition (linear calculations). The PM (Power Manager) reads out the chip's output light power.

[0066] Loading the weight matrix into the MZI network involves two steps: Step 1, determining the voltage parameters; Step 2, loading the weight matrix based on the voltage parameters determined in Step 1, and performing linear calculations.

[0067] The specific steps in Step One include: 1. Open "Light Source - Voltage Source - Optical Switch - Optical Power Meter - Multi-channel Voltage Source".

[0068] 2. Preparation: Check the wavelength; voltage 12.1V, current 0.3A; temperature control around 25℃; ensure that the multi-channel voltage source, optical switch, and optical power meter are all programmable; adjust the PC to the maximum chip output power; and apply voltage to each of the four modulators until the PC output power is around 2.5mW (for calibration).

[0069] 3. Run the MATLAB chip training code: The code changes the output power by altering the voltage applied to the phase shifter. After applying the voltage, the four channels of the optical switch are opened sequentially. For example, opening the first channel results in only the first optical input, corresponding to the four outputs of the optical power meter—the first column of the current matrix in this state. Opening the four optical switches sequentially yields four columns of output, resulting in the current 4×4 matrix. The similarity and gradient of the current matrix are calculated against the target matrix. Then, a stochastic parallel gradient descent algorithm (the core algorithm) is used to change the voltage… This process continues, reapplying the voltage to obtain the matrix. (During training, the similarity value is displayed in real-time; therefore, training can be manually stopped when the similarity reaches the required level.)

[0070] 4. Finally, save the trained weights, voltage parameters, etc.

[0071] Specifically, the steps of the Stochastic Parallel Gradient Descent (SPGD) algorithm include: 1) Initialization: Set the initial values ​​of control parameters, the number of iterations, etc.

[0072] 2) Random disturbance: Randomly disturb the control parameters to generate new parameter combinations.

[0073] 3) Performance evaluation: Calculate the performance indicators under the new parameter combination.

[0074] 4) Gradient estimation: Estimate the gradient of the control parameters based on the changes in performance indicators.

[0075] 5) Update parameters: Update control parameters based on gradient information.

[0076] 6) Iteration: Repeat steps 2)-5) until the termination condition is met.

[0077] Step two includes the following steps: 1. Turn on all devices, and finally turn on the FPGA.

[0078] 2. Preparation: Verify wavelength; voltage 12.1V, current 0.3A; temperature control around 25℃; ensure multi-channel voltage source, optical switch, and optical power meter are all programmable.

[0079] 3. Load the voltage parameters saved in step one onto the chip, which is equivalent to adding weights to the chip.

[0080] 4. Send test data from the FPGA (send all 1s). The PC should remain stationary. Adjust the voltage so that the PC output is around 2.5mW. Then connect the PC output to an oscilloscope and observe the output height, aiming for a height of around 100mV. This step is called extinction ratio adjustment, and it's for higher modulation accuracy and better linear response.

[0081] 5. After alignment, send real data, observe the oscilloscope output, and acquire the output.

[0082] The beneficial effects of this invention are: 1) This invention proposes a fusion network architecture that incorporates spiking neural networks (SNNs) into graph neural networks (GNNs). By leveraging the unique pulse firing encoding and membrane potential accumulation mechanism of SNNs, it achieves a natural expression and refined processing of temporal information. Compared with traditional deep neural networks that rely on static activation functions, this fusion network architecture can significantly improve the network's sensitivity to capturing temporal-dependent features in dynamic data processing scenarios (such as online shopping behavior sequences), thereby effectively enhancing the network's ability to perceive dynamic data and its performance in social classification tasks.

[0083] 2) Due to the event-driven nature of spiking neurons, they only fire pulses when the threshold is exceeded. Therefore, the overall computational cost of the network is more sparse. In the future, when deployed on neuromorphic hardware (such as Loihi and TrueNorth), the core advantages of low power consumption and high real-time performance of the hardware can be fully utilized, providing a graph neural network solution with both bio-inspired characteristics and engineering practical value for classification tasks in resource-constrained scenarios.

[0084] 3) In training the proposed photon pulse graph neural network, this invention constructs a simulation mechanism for the bias term through a feature dimension expansion strategy, which enables effective training of the network.

[0085] 4) This invention uses an MZI photonic network structure that is easier to configure to realize the linear calculation of the network layer in the photonic pulse graph neural network, which simplifies the configuration process of the weight matrix in the photonic neural network. Moreover, compared with the existing electronic computing platform, it has higher processing speed, lower power consumption and stronger scalability, and is suitable for the deployment needs of the next generation of high-performance, low-latency social networks.

[0086] 5) This invention is a graph neural network that can be extended to intelligent analysis across all scenarios of social networks. Based on the core adaptability of the node association structure of social networks, it uses multi-dimensional data such as user interaction, relationship links, and content preferences as analysis sources. It integrates event-triggered spiking neuron mechanisms with graph structure feature learning and high-order association mining techniques, possessing both strong portability and scenario adaptability and scalability. This framework can adapt to complex scenarios such as multi-source data fusion, heterogeneous networks, and large-scale user clusters. With hardware acceleration, it can meet real-time analysis needs, providing advanced and efficient intelligent analysis solutions for core scenarios such as social recommendation, public opinion management, community operation, and abnormal account detection.

[0087] It should be noted that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0088] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Furthermore, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0089] In this specification, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. While different embodiments may describe certain measures, this does not mean that these measures cannot be combined to produce a good effect.

[0090] The above description, in conjunction with specific preferred embodiments, provides a further detailed explanation of the present invention. It should not be construed that the specific implementation of the present invention is limited to these descriptions. For those skilled in the art, various simple deductions or substitutions can be made without departing from the concept of the present invention, and all such modifications and substitutions should be considered within the scope of protection of the present invention.

Claims

1. A classification method based on a photon pulse graph neural network, characterized in that, include: Obtain the graph structure data to be processed, wherein the graph structure data to be processed includes: a node feature matrix. and adjacency matrix ; For the adjacency matrix The adjacency matrix is ​​obtained by normalization. ; The normalized adjacency matrix and the node feature matrix The input is fed into a photon pulse graph neural network, which outputs a classification result. The photonic pulse graph neural network includes D network layers and one decision output layer. The output of the d-th network layer is connected to the input of the (d+1)-th network layer, and the output of the D-th network layer is connected to the input of the decision output layer. Each network layer adopts the structure of a spiking neural network. D is a positive integer greater than or equal to 2, and the value of d is from 1 to D-1. The training method for the photon pulse graph neural network includes: S1. Obtain the training dataset, which contains multiple training samples. Each training sample contains a node feature matrix and an adjacency matrix, and each training sample also has a label matrix. The dimension of the node feature matrix in each training sample is... , representing by The dimension of each node is The matrix formed by the eigenvectors; and All are positive integers greater than 1; S2. Add a bias channel with an element always equal to 1 to the node feature matrix of each training sample to reduce the dimension of the node feature matrix of each training sample from... Expand to This yields training samples for each node with its feature matrix expanded to the next dimension. S3. Initialize the weight matrices of each of the D network layers, and add a column vector to each initialized weight matrix to represent the learnable parameters of the bias channel for the bias channel, so as to obtain the weight matrices of each of the D network layers with bias learnable parameters, and set the constraint condition for each weight matrix with bias learnable parameters to represent that all elements are non-negative. S4. Based on the weight matrices of D network layers, each with biased learnable parameters, construct the initial photon pulse graph neural network; S5. During the c-th training iteration, at least one training sample with a node feature matrix expanded by dimension is selected as the training sample for the c-th iteration. The training sample for the c-th iteration is then input into the photonic pulse graph neural network obtained from the (c-1)-th training iteration to obtain the output result of each training sample for the c-th iteration. c is a positive integer greater than or equal to 1. When c is 1, the photonic pulse graph neural network obtained from the (c-1)-th training iteration is the initial photonic pulse graph neural network. S6. Input the label matrix and output result of the training sample of the cth time into the loss function, and calculate the loss value of the cth time. S7. Adjust the network parameters of the photon pulse graph neural network obtained from the (c-1)th training based on the loss value of the cth training to obtain the photon pulse graph neural network obtained from the cth training. S8. Set c=c+1 and return to S5 above to continue execution until the preset conditions are met, then stop training and use the photon pulse graph neural network obtained from the last training as the trained photon pulse graph neural network.

2. The classification method based on photon pulse graph neural network according to claim 1, characterized in that, When D is 3, the normalized adjacency matrix is... and the node feature matrix Input the trained photon pulse map neural network and output the classification results, including: The normalized adjacency matrix and the node feature matrix The initial state is then input into the first trained network layer. The first trained network layer utilizes a membrane potential threshold. Synaptic weights Membrane potential attenuation coefficient The neurons process the encoded signal and output the resulting pulse signal to the trained second network layer; The trained second network layer utilizes a membrane potential threshold. Synaptic weights Membrane potential attenuation coefficient The neurons process the pulse signal and output the resulting high-level pulse signal to the trained third network layer. The trained third network layer utilizes a membrane potential threshold. Synaptic weights Membrane potential attenuation coefficient The neurons process the high-level pulse signal and output the updated high-level pulse signal to the decision output layer. The decision output layer analyzes and transforms the updated high-level pulse signal and outputs the classification result.

3. The classification method based on photon pulse graph neural network according to claim 1, characterized in that, Each network layer contains elements with a membrane potential threshold. Synaptic weights Membrane potential attenuation coefficient Neurons; S7 includes: S71. Backpropagation is performed based on the loss value of the cth iteration to update the weight matrix of the photon pulse graph neural network obtained from the (c-1)th training iteration, thus obtaining the initially adjusted photon pulse graph neural network. S72. Determine whether the conditions for adjusting the neuron's threshold, synaptic weight, and membrane potential decay coefficient have been met based on the value of c. S73. When the conditions for adjusting the neuron threshold, synaptic weight, and membrane potential decay coefficient are met, the membrane potential threshold of the neurons in each network layer of the photon pulse graph neural network that has been initially adjusted is adjusted. Synaptic weights Membrane potential attenuation coefficient Adjustments were made to obtain the photon pulse diagram neural network obtained from the c-th training iteration. S74. When the conditions for adjusting the threshold, synaptic weight, and membrane potential decay coefficient of the neuron are not met, the photon pulse graph neural network that has been initially adjusted is used as the photon pulse graph neural network obtained from the cth training.

4. The classification method based on photon pulse graph neural network according to claim 1, characterized in that, The loss function is either the cross-entropy loss function or the mean squared error loss function.

5. The classification method based on photon pulse graph neural network according to claim 2, characterized in that, The neurons in each network layer use the LIF neuron model, and the update equation for the membrane potential of the LIF neuron model is as follows: ; ; in, Indicates the first Discrete time steps Indicates that the neuron is in the first The membrane potential at discrete time steps Indicates that the neuron is in the first +1 discrete time step membrane potential, Indicates the input signal. Indicates the membrane potential decay coefficient; Represents the impulse function. Let represent the activation function, where , This indicates a cropping operation.

6. The classification method based on photon pulse graph neural network according to claim 1, characterized in that, The trained first The expression for the output signal of each network layer is as follows: ; in, The value of is from 1 to D. Indicates the trained first The output signal of each network layer Indicates the trained first -1 is the output signal of a network layer, and when When the value is 1, Represents the node feature matrix , Indicates the trained first The learnable weight matrix of each network layer This represents the activation function.

7. The classification method based on photon pulse graph neural network according to claim 1, characterized in that, The adjacency matrix After normalization, a normalized adjacency matrix is ​​obtained. ,include: For the adjacency matrix Adding self-loops yields the adjacency matrix with added self-loops. ; Calculate the adjacency matrix with added self-loops. degree matrix ; Using the degree matrix For the adjacency matrix with added self-loops The normalized adjacency matrix is ​​obtained by performing symmetric normalization. .

8. A linear computation method based on MZI, characterized in that, The method includes: Obtain the weight matrices of each network layer of the trained photon pulse graph neural network as described in any one of claims 1 to 7, and select M weight matrices of network layers from them; M is a positive integer greater than or equal to 1; The weight matrix of the m-th network layer is loaded into the m-th MZI network. Each MZI network consists of P×P connected MZI units, and each MZI unit represents a weight value. A multi-channel light source with a preset wavelength interval is used as the input signal source. An optical modulator is used to load a pulse signal onto the input signal source so that the input signal required for the linear calculation of the m-th network layer is loaded onto the m-th input signal source, thus obtaining the m-th light source loaded with the input signal. After the m-th light source loaded with the input signal is injected into the injection port of the m-th MZI network through an optical fiber, each MZI unit performs linear calculations on the input signal and outputs the linear calculation results through the output port of the m-th MZI network.

9. The linear computation method based on MZI according to claim 8, characterized in that, Each MZI unit is a 2×2 MZI basic unit, and each MZI network is composed of P×P 2×2 MZI basic units connected by cascading and cross-connection; each 2×2 MZI basic unit integrates 4 electro-optic phase shifters; the formula for calculating the weight value represented by each MZI unit is as follows: ; in, This represents the weight value represented by the MZI cell. This represents the input value of the MZI unit. Represents the imaginary unit. This indicates the phase shift of the electro-optic phase shifter inside the MZI cell, and... The size of this value is used to control the weight value represented by the MZI cell. It represents the square of the absolute value.

Citation Information

Patent Citations

  • Path planning method and device based on photon pulse reinforcement learning network

    CN120874931A