Pulse neural network supervised learning method and device, electronic equipment and storage medium
Through deep supervised learning of spiking neural networks in the spatial and temporal domains using artificial neural networks, and utilizing the knowledge of artificial neural networks and contrastive learning techniques, the performance limitations of traditional SNN training methods are solved, achieving faster training convergence and performance improvement.
Patent Information
- Application Number
- CN202411237352.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-03
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-09-03
AI Technical Summary
Traditional spiking neural network (SNN) training methods rely on unsupervised learning or complex transformation strategies, which make it difficult to effectively capture the supervisory information in the data, resulting in limited model performance.
Through artificial neural networks, deep supervised learning of pulse neural networks in spatial and temporal domains is performed, and the knowledge of artificial neural networks is used to adjust the weights and match the features of pulse neural networks. Combined with contrastive learning and knowledge distillation technology, training efficiency and performance are improved.
It significantly improves the convergence efficiency and processing performance of the pulse neural network, reduces the number of training iterations, provides a good starting point, accelerates the learning process, and improves the processing capability of the model.
Smart Images

Figure CN119204117B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of neural networks, and particularly relates to a spiking neural network supervised learning method and device, electronic equipment and a storage medium. BACKGROUND
[0002] In the field of artificial intelligence and neural computing, spiking neural networks (SNNs) have attracted much attention due to their ability to simulate the working mechanism of biological neurons. Compared with traditional artificial neural networks (ANNs), SNNs transmit information through discrete time pulses rather than continuous activation values, which makes them have potential advantages in processing time-dependent data and achieving low-energy computing. Traditional SNN training methods often rely on unsupervised learning or complex conversion strategies, which either fail to effectively capture the supervised information in the data, resulting in limited model performance, or result in poor training effect of SNNs. SUMMARY
[0003] The main purpose of the embodiments of the present application is to propose a spiking neural network supervised learning method and device, electronic equipment and a storage medium, which aims to perform deep supervised learning on the spatial and temporal domains of the spiking neural network through the artificial neural network, and improve the processing performance of the spiking neural network.
[0004] To achieve the above purpose, a first aspect of the embodiments of the present application proposes a spiking neural network supervised learning method, which comprises:
[0005] obtaining a trained artificial neural network and a to-be-trained spiking neural network; wherein the artificial neural network and the spiking neural network have similar network structures;
[0006] extracting network parameter weights of each network layer in the artificial neural network, and adjusting the to-be-trained spiking neural network according to the network parameter weights to obtain an adjusted initial spiking neural network;
[0007] inputting a preset training image sample into the artificial neural network and the spiking neural network respectively, and obtaining a guided output feature and a learning output feature respectively;
[0008] obtaining a first loss value according to the guided output feature and the learning output feature;
[0009] extracting a first temporal feature from the artificial neural network, and extracting a plurality of second temporal features with different time steps from the spiking neural network;
[0010] respectively calculate sample similarity between the first time domain feature and the second time domain feature of different time steps to obtain a second loss value;
[0011] update network parameter weights of each network layer in the initial pulse neural network according to the first loss value and the second loss value.
[0012] In some embodiments, the obtaining a first loss value according to the guide output feature and the learning output feature comprises:
[0013] obtaining a preset first projection network;
[0014] inputting the learning output feature into the first projection network to obtain a converted output feature;
[0015] obtaining a first loss value according to the guide output feature and the converted output feature;
[0016] correspondingly, after the step of adjusting the initial weights according to the first loss value and the second loss value, the method further comprises:
[0017] deleting the first projection network.
[0018] In some embodiments, the obtaining a second loss value by respectively calculating sample similarity between the first time domain feature and the second time domain feature of different time steps comprises:
[0019] obtaining sample types of the first time domain feature and the second time domain feature according to sample labels of the first time domain feature and the second time domain feature;
[0020] respectively calculating sample similarity between the first time domain feature and the second time domain feature of different time steps according to the sample labels to obtain a second loss value.
[0021] In some embodiments, the obtaining a second loss value by respectively calculating sample similarity between the first time domain feature and the second time domain feature of different time steps according to the sample labels comprises:
[0022] obtaining a preset second projection network;
[0023] inputting the second time domain feature into the second projection network to obtain a converted time domain feature;
[0024] respectively calculating sample similarity between the first time domain feature and the converted time domain feature of different time steps according to the sample labels;
[0025] Correspondingly, after the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value, the method further comprises:
[0026] deleting the second projection network.
[0027] In some embodiments, the artificial neural network and the spiking neural network comprise a plurality of intermediate processing layers, and the intermediate processing layers of the artificial neural network and the intermediate processing layers of the spiking neural network correspond to each other; and the step of calculating the sample-to-sample similarity between the first time domain feature and the second time domain feature at different time steps respectively to obtain a second loss value comprises:
[0028] calculating the sample-to-sample similarity between the first time domain feature and the second time domain feature at different time steps extracted by the same intermediate processing layer respectively to obtain a plurality of third loss values;
[0029] obtaining a second loss value according to the plurality of third loss values.
[0030] In some embodiments, before the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value, the method further comprises:
[0031] inputting a preset training image sequence into the spiking neural network to obtain a predicted output feature at each time step;
[0032] performing prediction entropy processing on the predicted output feature at each time step to obtain a fourth loss value;
[0033] calculating the cosine similarity between the predicted output feature and the predicted output feature at other time steps to obtain a fifth loss value;
[0034] obtaining a sixth loss value according to the fourth loss value and the fifth loss value;
[0035] Correspondingly, the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value comprises:
[0036] updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value, the second loss value and the sixth loss value.
[0037] In some embodiments, before the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value, the second loss value and the sixth loss value, the method further comprises:
[0038] According to the preset temperature parameters, the guide output features and the learning output features are softened to obtain guide softened features and learning softened features respectively;
[0039] According to the guide softened features and the learning softened features, a seventh loss value is obtained;
[0040] Correspondingly, the network parameter weights of each network layer in the initial spiking neural network are updated according to the first loss value, the second loss value and the sixth loss value, including:
[0041] The network parameter weights of each network layer in the initial spiking neural network are updated according to the first loss value, the second loss value, the sixth loss value and the seventh loss value.
[0042] To achieve the above object, a second aspect of the embodiment of the present application proposes a spiking neural network supervised learning device, which comprises:
[0043] An acquisition module is configured to acquire a trained artificial neural network and a to-be-trained spiking neural network; wherein the artificial neural network and the spiking neural network have similar network structures;
[0044] A transfer module is configured to extract network parameter weights of each network layer in the artificial neural network, and adjust the to-be-trained spiking neural network according to the network parameter weights to obtain an adjusted initial spiking neural network;
[0045] An output module is configured to input preset training image samples to the artificial neural network and the spiking neural network respectively, and obtain guide output features and learning output features respectively;
[0046] A first calculation module is configured to obtain a first loss value according to the guide output features and the learning output features;
[0047] An extraction module is configured to extract a first time domain feature from the artificial neural network, and extract a plurality of second time domain features of different time steps from the spiking neural network;
[0048] A second calculation module is configured to calculate sample inter-similarity between the first time domain feature and the second time domain features of different time steps respectively to obtain a second loss value;
[0049] A learning module is configured to update the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value.
[0050] To achieve the above object, a third aspect of the embodiments of the present application provides an electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the method of the first aspect when executing the computer program.
[0051] To achieve the above object, a fourth aspect of the embodiments of the present application provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the method of the first aspect.
[0052] The pulse neural network supervised learning method and device, electronic device and storage medium provided by the present application, by obtaining an artificial neural network which has been trained and has stable performance, the structure of the network should be similar to the pulse neural network to be trained, to ensure the feasibility of weight transfer. Extract the network parameter weights of each network layer from the trained artificial neural network. The network parameter weights are directly transferred to the pulse neural network, and the pulse neural network to be trained is adjusted, so as to obtain the adjusted initial pulse neural network. In the above steps, the knowledge accumulated in the training process of the artificial neural network is used to avoid starting from zero to teach and train the pulse neural network. On this basis, the pulse neural network can converge to a better solution faster, reducing the number of iterations in the training process, thereby reducing the workload of training and parameter adjustment, providing a good starting point for the pulse neural network, and speeding up the entire learning process. The preset training image samples are input into the artificial neural network and the pulse neural network respectively. After the artificial neural network processes the input samples, it outputs guiding output features, which will be used as the learning target of the pulse neural network. After the pulse neural network processes the same input samples, it outputs learning output features. According to the guiding output features of the artificial neural network and the learning output features of the pulse neural network, a first loss value is calculated, which reflects the difference between the pulse neural network and the artificial neural network in output features. The knowledge of the artificial neural network can be used to perform spatial deep supervision on the pulse neural network, which can greatly improve the convergence efficiency and performance of the pulse neural network. In addition, the first time domain features are extracted from the artificial neural network, and the second time domain features of multiple different time steps are extracted from the pulse neural network. The sample similarity between the first time domain features and the second time domain features of each time step is calculated respectively to obtain a second loss value, which is used to evaluate the matching degree of the pulse neural network and the artificial neural network in time domain features. According to the first loss value and the second loss value, the network parameter weights of each network layer in the initial pulse neural network are updated to reduce the first loss value and the second loss value. The present application performs deep supervision learning on the spatial domain and time domain of the pulse neural network through the artificial neural network, which improves the processing performance of the pulse neural network. BRIEF DESCRIPTION OF DRAWINGS
[0053] Figure 1 is a flowchart of the pulse neural network supervised learning method provided by the embodiment of the present application;
[0054] Figure 2 is Figure 1 is a flowchart of step S140 in
[0055] Figure 3 is Figure 1 is a flowchart of step S160 in
[0056] Figure 4 is Figure 3 is a flowchart of step S320 in
[0057] Figure 5 is Figure 1 is a flowchart of step S160 in
[0058] Figure 6 is Figure 1 is a flowchart before step S170 in
[0059] Figure 7 is Figure 6 is a flowchart before step S650 in
[0060] Figure 8 is a structural schematic diagram of the pulse neural network supervised learning device provided by the embodiment of the present application;
[0061] Figure 9 is a hardware structural schematic diagram of the electronic device provided by the embodiment of the present application. DETAILED DESCRIPTION
[0062] In order to make the purpose, technical scheme and advantages of the present application clearer, the present application is further described in detail below in combination with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application.
[0063] It should be noted that although the functional modules are divided in the device schematic diagram, and the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a manner different from the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification and claims and the above drawings are used to distinguish similar objects, and do not necessarily describe a specific order or sequence.
[0064] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the embodiments of the present application, and are not intended to limit the present application.
[0065] First, the meanings of several terms involved in the present application are analyzed:
[0066] Artificial Neural Network (ANN): Abstract the network of neurons in the human brain from the perspective of information processing, establish a certain simple model, and form different networks according to different connection modes. In engineering and academic circles, it is also commonly referred to as neural network or neural network. Neural network is an operation model composed of a large number of nodes (or neurons) connected to each other. Each node represents a specific output function, called activation function. The connection between each two nodes represents a weight value for the signal passing through the connection, called weight, which is equivalent to the memory of the artificial neural network. The output of the network depends on the connection mode of the network, the weight value and the excitation function. The network itself is usually an approximation of an algorithm or function in nature, or an expression of a logic strategy.
[0067] Spiking Neural Network (SNN): A new generation of artificial neural network model inspired by biology, belonging to the subset of deep learning, and has strong biological basis support. It contains neuron nodes with time sequence dynamics, synapse structure with steady-state plasticity balance, network loop with specific functions, etc., which highly draws on the local unsupervised (such as pulse time-dependent plasticity, short-term synaptic plasticity, local steady-state regulation, etc.), global weak supervision (such as dopamine reward learning, energy-based function optimization, etc.) biological optimization methods inspired by biology, so it has strong space-time information representation, asynchronous event information processing, network self-organizing learning, etc.
[0068] In the field of artificial intelligence and neural computing, Spiking Neural Network (SNN) has attracted much attention due to its ability to simulate the working mechanism of biological neurons. Compared with traditional Artificial Neural Network (ANN), SNN transmits information through discrete time pulses rather than continuous activation values, which makes them have potential advantages in processing time-dependent data and achieving low-energy computation. Traditional SNN training methods often rely on unsupervised learning or complex conversion strategies, which either fail to effectively capture the supervised information in the data, resulting in limited model performance, or result in poor training effect of SNN.
[0069] Therefore, the embodiments of the present application provide a Spiking Neural Network supervised learning method and device, an electronic device and a storage medium, which aims to perform deep supervised learning on the spatial and temporal domains of the Spiking Neural Network through the Artificial Neural Network, and improve the processing performance of the Spiking Neural Network.
[0070] The recommendation method and device, the electronic device and the storage medium provided by the embodiments of the present application are specifically described by the following embodiments. First, the recommendation method in the embodiments of the present application is described.
[0071] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. The artificial intelligence (AI) is to use a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results.
[0072] The basic technology of artificial intelligence generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The software technology of artificial intelligence mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0073] The pulse neural network supervised learning method provided by the embodiments of the present application can be applied in a terminal, can also be applied in a server end, and can also be software running in the terminal or the server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server end can be configured as an independent physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, can also be configured as a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN, and big data and artificial intelligence platform, etc.; and the software can be an application implementing the pulse neural network supervised learning method, etc., but is not limited to the above forms.
[0074] The application is operable in a multitude of general or special computer system environments or configurations. Examples include personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application can be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, and the like, that perform particular tasks or implement particular abstract data types. The application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules can be located in local and remote computer storage media including memory storage devices.
[0075] It should be noted that in various specific embodiments of the present application, when it is necessary to process relevant data related to the identity or characteristics of the user according to user information, user behavior data, user history data, and user location information, etc., the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards in relevant countries and regions. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the separate permission or separate consent of the user will be obtained through a pop-up window or a jump to a confirmation page, and after obtaining the separate permission or separate consent of the user, the necessary user-related data for enabling the embodiments of the present application to normally operate will be obtained.
[0076] In addition, the pulse neural network supervised learning method of the present application has a wide range of application scenarios. For example, the present application has a wide range of applications in the computer vision market, and performs well in core tasks such as image classification, semantic segmentation, and object detection. In the field of computer vision, efficient image recognition technology is indispensable for many key applications, such as autonomous driving, medical image deep analysis, and various monitoring scenarios. The innovation of this technology lies in creatively integrating knowledge distillation, contrastive learning, and ensemble learning into the training process of the pulse neural network. This move significantly improves the performance and energy efficiency of SNN, bringing a new breakthrough to image recognition technology. In production practice, this technology injects new vitality into the following indispensable application scenarios:
[0077] 1) Object recognition: In the field of intelligent monitoring, security protection, and object tracking, this technology significantly enhances the performance of SNN, further improving the intelligent level of the system.
[0078] 2) Autonomous driving: For autonomous driving technology, high-precision semantic segmentation and object detection are the key to accurately identifying roads, traffic signs, and pedestrians. This technology significantly improves the environmental perception ability and driving safety of autonomous driving systems by enhancing the performance of SNN.
[0079] 3) Industrial quality inspection: In the industrial production process, image classification technology is an important tool for product quality detection, and high-performance models can significantly reduce the occurrence of unqualified products. Therefore, by enhancing the learning ability of SNN, the application potential of SNN can be maximized.
[0080] Please refer to Figure 1 , Figure 1 is an optional flowchart of the pulse neural network supervised learning method provided by the embodiment of the present application, Figure 1 The method in the embodiment of the present application can include but is not limited to steps S110 to S160.
[0081] Step S110: obtaining a trained artificial neural network and a pulse neural network to be trained; wherein the artificial neural network and the pulse neural network have similar network structures.
[0082] Step S120: extracting network parameter weights of each network layer in the artificial neural network, and adjusting the pulse neural network to be trained according to the network parameter weights to obtain an adjusted initial pulse neural network.
[0083] Step S130: inputting a preset training image sample into the artificial neural network and the pulse neural network respectively, and obtaining a guide output feature and a learning output feature respectively.
[0084] Step S140: obtaining a first loss value according to the guide output feature and the learning output feature.
[0085] Step S150: extracting a first time domain feature from the artificial neural network, and extracting a plurality of second time domain features of different time steps from the pulse neural network.
[0086] Step S160: calculating the sample similarity between the first time domain feature and the second time domain features of different time steps respectively to obtain a second loss value.
[0087] Step S170: updating the network parameter weights of each network layer in the initial pulse neural network according to the first loss value and the second loss value.
[0088] The steps S110 to S170 shown in the embodiments of the present application are performed by obtaining an artificial neural network that has been trained and has stable performance. The structure of the network should be similar to the pulse neural network to be trained to ensure the feasibility of weight transfer. The network parameter weights of each network layer are extracted from the trained artificial neural network. The network parameter weights are directly transferred to the pulse neural network to adjust the pulse neural network to be trained, thereby obtaining an adjusted initial pulse neural network. In the above steps, the knowledge accumulated in the training process of the artificial neural network is used to avoid starting from zero to train the pulse neural network. On this basis, the pulse neural network can converge to a better solution more quickly, reducing the number of iterations in the training process and thereby reducing the workload of training and parameter adjustment. The pulse neural network provides a good starting point for the pulse neural network and speeds up the entire learning process. The preset training image samples are input into the artificial neural network and the pulse neural network, respectively. After the artificial neural network processes the input samples, it outputs guiding output features, which will serve as the learning target of the pulse neural network. After the pulse neural network processes the same input samples, it outputs learning output features. According to the guiding output features of the artificial neural network and the learning output features of the pulse neural network, a first loss value is calculated, which reflects the difference between the pulse neural network and the artificial neural network in output features. The depth supervision of the pulse neural network in the spatial domain using the knowledge of the artificial neural network can greatly improve the convergence efficiency and performance of the pulse neural network. In addition, the first time domain features are extracted from the artificial neural network, and the second time domain features of multiple different time steps are extracted from the pulse neural network. The sample similarity between the first time domain features and the second time domain features of each time step is calculated to obtain a second loss value for evaluating the matching degree of the pulse neural network and the artificial neural network in the time domain features. According to the first loss value and the second loss value, the network parameter weights of each network layer in the initial pulse neural network are updated to reduce the first loss value and the second loss value. The present application improves the processing performance of the pulse neural network through the depth supervision learning of the artificial neural network in the spatial domain and the time domain.
[0089] In step S120, since the artificial neural network and the pulse neural network have similar network structures, the network parameter weights of each network layer that have been optimized in the training process of the artificial neural network can be used as an important reference for the initialization of the pulse neural network, which is equivalent to providing an "experienced" starting point for the pulse neural network in the training process, rather than starting from zero to train the pulse neural network. In this way, the pulse neural network can learn useful feature representations more quickly, maintain stable performance improvement in the training process, and improve the training efficiency of the pulse neural network.
[0090] For example, there is a simple artificial neural network that has been trained, which is composed of a first network layer, a second network layer and a third network layer, and each layer has corresponding weights between the connections. This artificial neural network has learned effective weights through a large amount of training data and can well complete a certain task. Now there is a similar structure of the spiking neural network, also contains a first network layer, a second network layer and a third network layer, but the initial weight of the spiking neural network is random and has not been trained. Because the artificial neural network and the spiking neural network have similar network structures, we can map the weight of each layer of the artificial neural network to the weight of the corresponding layer of the spiking neural network, and this mapping is based on the correspondence between the network layers, that is, the network parameter weight of the first network layer of the artificial neural network is mapped to the network parameter weight of the first network layer of the spiking neural network, the network parameter weight of the second data layer of the artificial neural network is mapped to the network parameter weight of the second data layer of the spiking neural network, and so on. The spiking neural network can learn useful feature representation faster, providing a good starting point for the spiking neural network and accelerating the entire learning process.
[0091] In step S140, a first loss value is calculated by the following formula:
[0092] L f =||F s -F t || 2 ;
[0093] Wherein, L f represents the first loss value, F s represents the learning output feature, F t represents the known output feature.
[0094] Please refer to Figure 2 , in some embodiments, step S140 can include but is not limited to steps S210 to S230:
[0095] Step S210: obtaining a preset first projection network.
[0096] Step S220: input the learning output feature into the first projection network to obtain a converted output feature.
[0097] Step S230: obtaining the first loss value according to the guide output feature and the converted output feature.
[0098] Correspondingly, after step S170, the following steps can also be included but are not limited to:
[0099] Step S240: deleting the first projection network.
[0100] In steps S210 to S230, this algorithm uses the same ANN and SNN architectures, but their features differ fundamentally from each other. These differences stem from two main aspects: first, dimensionality mismatch. While the self-architecting strategy ensures consistency in spatial and channel dimensions, SNNs differ from ANNs due to the introduction of the time dimension. Second, there is a mismatch in feature space. SNN features are discrete and sequential, while ANN features are continuous and non-sequential. The first projection network converts the sequential, discrete features of the SNN into continuous, non-sequential features similar to those of the ANN, thereby achieving feature space alignment. This alignment ensures that the loss function fairly evaluates the learning performance of the SNN and promotes the transfer of effective feature knowledge from the ANN to the SNN. By introducing the first projection network, the algorithm can more accurately measure the feature-level differences between the SNN and ANN, thereby guiding the optimization of SNN weights, accelerating SNN training, and improving its training effectiveness, enabling the SNN to more quickly learn useful feature representations. In addition, in order to preserve the integrity of the teacher information, the first projection network is not used to transform the output features of the ANN, but the first projection network is used to transform the output features of the SNN. Specifically, the learning output features are transformed into transformations using the following formula:
[0101]
[0102] Where T is the time step, P is the first projection network, which is a single-layer MLP (Multi-Layer Perceptron) consisting of a 1×1 convolutional layer, followed by a batch normalization layer and a ReLU (Rectified Linear Unit) activation function. represents the guidance output feature at time step t, is the transformation output feature.
[0103] In step S240, after the initial weight adjustment is completed according to the first loss value and the second loss value, that is, after the first loss value and the second loss value both meet the requirements, the first projection network is deleted, that is, the first projection network only exists in the training stage and will be discarded after training, so it will not increase the complexity or parameters of the SNN.
[0104] In the above method, by introducing a spatial deep supervision algorithm based on knowledge distillation and using the knowledge of ANN to perform deep spatial supervision on SNN, the convergence efficiency and performance of SNN can be greatly improved.
[0105] See also Figure 3 It is understood that, in step S160, the following steps may be included but not limited to:
[0106] Step S310: obtaining sample types of the first time domain feature and the second time domain feature according to sample labels of the first time domain feature and the second time domain feature;
[0107] Step S320: calculating sample inter-similarity between the first time domain feature and the second time domain feature of different time steps according to the sample labels, to obtain a second loss value.
[0108] In steps S310 to S320, the features of the artificial neural network are integrated into the time domain contrast space of the SNN, aiming to combine the rich semantic knowledge of the ANN and the ability of the SNN to process time information, and by redefining the positive samples as the representations of the same image at different time steps, the SNN can more effectively capture the inherent temporal correlation in the time information. Combining contrast learning (shortening the distance between positive sample representations and lengthening the distance between positive and negative sample representations) with SNN time domain information to effectively capture the inherent temporal correlation in the time information, this goal is achieved by redefining the positive samples as the representations of the same image at different time steps. Specifically, the second loss value is calculated by the following formula:
[0109]
[0110] Where P(i) is a set of positive sample pairs with the same label as sample i, and |P(i)| is the cardinality of the set P(i). Where I represents the index of all samples in the batch. i , k z i , represent the positive sample pair, and z k represent the features of all other samples in the small batch except the i-th sample. τ is a temperature parameter for controlling the concentration of the distribution. T is the time step, if the default time step of the SNN is 4, when calculating the contrast loss using the above formula, T is changed to 5, that is, the features of the ANN are included.
[0111] Please refer to Figure 4 It can be understood that in step S320, the following steps can be included but are not limited to:
[0112] Step S410: obtaining a preset second projection network;
[0113] Step S420: inputting the second time domain feature into the second projection network to obtain a converted time domain feature;
[0114] Step S430: calculating sample inter-similarity between the first time domain feature and the converted time domain feature of different time steps according to the sample labels, to obtain a second loss value.
[0115] Correspondingly, after step S170, the following steps can also be included, but are not limited to:
[0116] Step S440: deleting the second projection network.
[0117] In steps S410-S430, similar to steps S210-S230 described above, the same ANN and SNN architecture is used in this algorithm, but there are essential differences between the two. First, the dimensions do not match. Although the self-architecture strategy ensures the consistency of the spatial and channel dimensions, the SNN is different from the ANN due to the introduction of the time dimension. Second, the feature spaces do not match. The features of the SNN are discrete and time-sequential, while the features of the ANN are continuous and non-time-sequential. The role of the second projection network is to convert the time-sequential and discrete features of the SNN into continuous and non-time-sequential features similar to the ANN, thereby realizing the alignment of the feature spaces. In addition, the second projection network is different from the first projection network in that it is composed of two layers of MLP.
[0118] In step S440, similar to step S240 described above, after the initial weights are adjusted according to the first loss value and the second loss value, i.e., when the first loss value and the second loss value meet the requirements, the second projection network is deleted. That is, the second projection network only exists in the training stage and will be discarded after training, so it will not increase the complexity or parameters of the SNN.
[0119] Please refer to Figure 5 It can be understood that the artificial neural network and the spiking neural network include multiple intermediate processing layers, and the intermediate processing layers of the artificial neural network and the intermediate processing layers of the spiking neural network correspond to each other. In step S160, the following steps can be included, but are not limited to:
[0120] Step S510: calculating the sample-to-sample similarity between the first time domain features extracted from the same intermediate processing layer and the second time domain features of different time steps, respectively, to obtain multiple third loss values;
[0121] Step S520: obtaining a second loss value according to the multiple third loss values.
[0122] In one embodiment, the SNN model adopts a ResNet architecture with four intermediate processing layers. We extract temporal features from these layers to form data A, the first temporal features. A has the shape [B, T, C, H, W], where B is the number of samples, T is the temporal dimension, C is the number of feature channels, and H and W are the height and width of the feature map, respectively. C, H, and W may vary between stages. For each stage, feature A is processed using a projection module to produce data E. The second projection module consists of two 3x3 convolutional layers to adjust the feature dimensions. Each convolutional layer is followed by batch normalization and a ReLU activation function. Average pooling is performed on the H and W dimensions to reduce the spatial dimensionality, and the C dimension is normalized to standardize the features. After processing, data E has the shape [B, T, C'], where C' is the number of channels after projection. Simultaneously, features are extracted from the corresponding stage of the ANN model, referred to as data F, the second temporal features. The shape of F is [B, C'], which is consistent with the channel dimension of the projected SNN features. The SNN's time-domain features E and the ANN's time-domain features F are concatenated in the time dimension to form the new data G. The shape of D is [B, T+1, C'], where T+1 represents T time steps plus one ANN static feature. The second loss value is calculated using the above formula. This loss function considers the relationship between different time steps and ANN features to complete time-domain deep supervision learning based on contrastive learning. For the four stages of ResNet, the above steps are repeated, and the losses of all stages are then averaged and summed to obtain the final time-domain deep supervision contrastive loss, i.e., the second loss value.
[0123] In the above method, a deep temporal supervision algorithm based on contrastive learning is introduced to deeply supervise the SNN in the temporal domain using contrastive learning technology. First, contrastive learning is extended to the temporal domain of the SNN to model temporal correlations. Second, the features of the ANN are additionally introduced into the contrastive space to further improve the relevance and semantic richness of the SNN's temporal characteristics.
[0124] See also Figure 6 It is understandable that, before step S170, the following steps may also be included but not limited to:
[0125] Step S610: inputting a preset training image sequence into the spiking neural network to obtain predicted output features for each time step;
[0126] Step S620: performing prediction entropy processing on the prediction output features of each time step to obtain a fourth loss value;
[0127] Step S630: Calculate the cosine similarity between the predicted output features of the current time step and the predicted output features of other time steps, and obtain a fifth loss value;
[0128] Step S640: Obtain a sixth loss value according to the fourth loss value and the fifth loss value.
[0129] Correspondingly, in step S170, the following steps can be included but are not limited to:
[0130] Step S650: Update the network parameter weights of each network layer in the initial spiking neural network according to the first loss value, the second loss value, and the sixth loss value.
[0131] In steps S610 to S620, an uncertainty entropy weighted time domain integration strategy is provided. For each time step, the network generates corresponding predicted output features, which reflect the network's understanding and response to the current input image. The predicted output features of each time step are processed by prediction entropy. Prediction entropy is an indicator of the uncertainty of the prediction result. By calculating the entropy value of the predicted output, the confidence level of the network for the current input can be evaluated. A higher entropy value indicates higher uncertainty, while a lower entropy value indicates higher certainty. This targeted training method helps to accurately improve the decision-making quality at each time, thereby further improving the performance upper limit of the SNN. The mathematical expression of the fourth loss value is as follows:
[0132]
[0133]
[0134] wherein, O t is the output of time step t, and C is the number of categories. E t represents the entropy predicted by time step t, which is used as a measure of uncertainty. This weighting scheme ensures that more unreliable (higher uncertainty) predictions in certain time steps contribute more to the loss calculation, thereby optimizing different time points to improve the decision-making ability of the SNN.
[0135] In step S630, the cosine similarity between the predicted output features of the current time step and the predicted output features of other time steps is calculated. A regularization term is introduced to improve the diversity of decisions at different time steps. Cosine similarity is an indicator of the similarity between two vectors. By calculating the similarity of output features at different time steps, the stability and consistency of the network in the time dimension can be evaluated. The mathematical expression of the fifth loss value is as follows:
[0136]
[0137] wherein cos (0 i ,O j ) is the cosine similarity between O i and O j , and N is the total number of comparisons.
[0138] In step S640, different weights can be assigned to the fourth loss value and the fifth loss value, so as to calculate a sixth loss value. In the embodiment of the present application, the sixth loss value is calculated by the following formula:
[0139] L UWL = L' UWL + 0.5 x L s
[0140] wherein L' UWL represents the fourth loss value, L s represents the fifth loss value, and L UWL represents the sixth loss value.
[0141] Further, in step S650, the network parameter weights of each network layer in the initial pulse neural network are updated according to the first loss value, the second loss value and the sixth loss value, so as to reduce the first loss value, the second loss value and the sixth loss value.
[0142] In the above method, the uncertainty entropy time domain weighted integrated supervision algorithm is introduced. The uncertainty degree of the decision of different time steps of SNN is measured by entropy, and different time points are weighted integrated according to the uncertainty degree, so as to optimize different time points. At the same time, a similarity penalty loss is introduced to improve the decision diversity, so as to improve the accuracy of the integrated decision of SNN.
[0143] Before step S650, the following steps can also be included, but are not limited to: Figure 7
[0144] Step S710: softening the guidance output feature and the learning output feature according to a preset temperature parameter, to obtain a guidance softening feature and a learning softening feature, respectively.
[0145] Step S720: obtaining a seventh loss value according to the guidance softening feature and the learning softening feature.
[0146] Correspondingly, in step S650, the following steps can be included, but are not limited to:
[0147] Step S730: updating the network parameter weights of each network layer in the initial pulse neural network according to the first loss value, the second loss value, the sixth loss value and the seventh loss value.
[0148] In steps S710 to S720, in an embodiment, the probability distribution output by the ANN: p_t, shaped as [N, num_class], the probability distribution output by the SNN: p_s, shaped as [T, N, num_class], where T is the number of time steps, N is the batch size, and num_class is the number of classes. The output of the SNN is then averaged in the time dimension to obtain p_s_avg, shaped as [B, num_class], p_s_avg = average(p_s, axis = 0). The outputs of the two models are "softened" using a temperature parameter τ:
[0149] p_t_τ = softmax(p_t / τ)
[0150] p_s_τ = softmax(p_s_avg / τ)
[0151] The seventh loss value is finally calculated by the following formula:
[0152] L l = ττ*K l (p_t_τ||p_s_τ)
[0153] Further, step S730 updates the network parameter weights of each network layer in the spiking neural network according to the first loss value, the second loss value, the sixth loss value, and the seventh loss value, so as to reduce the first loss value, the second loss value, the sixth loss value, and the seventh loss value.
[0154] In addition, a total loss value can be calculated according to the first loss value, the second loss value, the sixth loss value, and the seventh loss value, and the initial weights are adjusted according to the total loss value, and the total loss value is calculated by the following formula:
[0155]
[0156] Wherein, α is the weight value of the sixth loss value, β is the weight value of the first loss value, γ is the weight value of the seventh loss value, and λ is the weight value of the second loss value. The initial weights are adjusted according to the total loss value until the total loss value meets the preset condition.
[0157] In summary, the application combines the spatial domain deep supervision algorithm based on knowledge distillation, the time domain deep supervision algorithm based on contrast learning, and the uncertainty entropy time domain weighted integrated supervision algorithm to alleviate the two challenges of "improving convergence efficiency and performance" and "efficient pulse representation under short time steps" faced by the SNN.
[0158] In the spatial domain deep supervision algorithm based on knowledge distillation, the knowledge of the ANN is used to perform spatial domain deep supervision on the SNN, which can greatly improve the convergence efficiency and performance of the SNN.
[0159] In the time domain deep supervision algorithm based on contrastive learning, the time domain of the SNN is supervised by using the contrastive learning technology. Firstly, the contrastive learning is extended to the time domain of the SNN to model the time domain correlation, and secondly, the features of the ANN are additionally introduced into the contrastive space to further improve the correlation and semantic richness of the SNN time domain characteristics.
[0160] In the time domain weighting ensemble supervision algorithm based on uncertainty entropy, the uncertainty degree of the SNN decision at different time steps is measured by aiming at the entropy, and different time points are weighted and integrated accordingly to optimize the different time points. At the same time, a similarity penalty loss is introduced to improve the decision diversity, thereby improving the accuracy of the integrated decision of the SNN.
[0161] Please refer to Figure 8 The embodiment of the present application also provides a pulse neural network supervised learning device 800, which can realize the above-mentioned pulse neural network supervised learning method. The device comprises:
[0162] The acquisition module 810 is configured to acquire a trained artificial neural network and a pulse neural network to be trained, wherein the artificial neural network and the pulse neural network have similar network structures.
[0163] The transfer module 820 is configured to extract network parameter weights of each network layer in the artificial neural network, and adjust the pulse neural network to be trained according to the network parameter weights to obtain an adjusted initial pulse neural network.
[0164] The output module 830 is configured to input a preset training image sample to the artificial neural network and the pulse neural network respectively, and obtain guided output features and learning output features respectively.
[0165] The first calculation module 840 is configured to obtain a first loss value according to the guided output features and the learning output features.
[0166] The extraction module 850 is configured to extract a first time domain feature from the artificial neural network, and extract a plurality of second time domain features of different time steps from the pulse neural network.
[0167] The second calculation module 860 is configured to calculate a sample similarity between the first time domain feature and the second time domain features of different time steps respectively, and obtain a second loss value.
[0168] The learning module 870 is configured to update the network parameter weights of each network layer in the initial pulse neural network according to the first loss value and the second loss value.
[0169] The specific embodiments of the pulse neural network supervised learning device are basically the same as the specific embodiments of the above-mentioned pulse neural network supervised learning method, and will not be repeated here.
[0170] Specifically, the first calculation module 840 includes:
[0171] The first acquisition unit is configured to acquire a preset first projection network.
[0172] The first conversion unit is configured to input the learning output feature into the first projection network to obtain a converted output feature.
[0173] The first calculation unit is configured to obtain a first loss value according to the guidance output feature and the converted output feature.
[0174] In addition, the pulse neural network supervised learning device 800 further includes a first deletion unit.
[0175] The first deletion unit is configured to delete the first projection network.
[0176] Specifically, the second calculation module 860 includes:
[0177] The classification unit is configured to obtain sample types of the first time domain feature and the second time domain feature according to sample labels of the first time domain feature and the second time domain feature.
[0178] The second calculation unit is configured to calculate sample inter-similarities between the first time domain feature and the second time domain features of different time steps according to the sample labels, to obtain a second loss value.
[0179] Specifically, the second calculation unit includes:
[0180] The second acquisition unit is configured to acquire a preset second projection network.
[0181] The second conversion unit is configured to input the second time domain feature into the second projection network to obtain a converted time domain feature.
[0182] The second calculation unit is configured to calculate sample inter-similarities between the first time domain feature and the converted time domain features of different time steps according to the sample labels, to obtain a second loss value.
[0183] In addition, the pulse neural network supervised learning device 800 further includes a second deletion unit.
[0184] The second deletion unit is configured to delete the second projection network.
[0185] Specifically, the second calculation module 860 includes:
[0186] The third calculation unit is configured to calculate sample inter-similarities between the first time domain features extracted by the same intermediate processing layer and the second time domain features of different time steps, to obtain a plurality of third loss values.
[0187] The fourth calculation unit obtains a second loss value according to the plurality of third loss values.
[0188] Specifically, the pulse neural network supervised learning device 800 further includes:
[0189] The first processing unit inputs a preset training image sequence into the pulse neural network to obtain a predicted output feature of each time step;
[0190] The fifth calculation unit is configured to perform prediction entropy processing on the predicted output feature of each time step to obtain a fourth loss value;
[0191] The sixth calculation unit is configured to calculate a cosine similarity between the predicted output feature and a predicted output feature of another time step to obtain a fifth loss value;
[0192] The seventh calculation unit is configured to obtain a sixth loss value according to the fourth loss value and the fifth loss value;
[0193] The learning module 870 is specifically configured to update network parameter weights of each network layer in the initial pulse neural network according to the first loss value, the second loss value and the sixth loss value.
[0194] Specifically, the pulse neural network supervised learning device 800 further includes:
[0195] The second processing unit is configured to perform softening processing on the guidance output feature and the learning output feature according to a preset temperature parameter to obtain a guidance softening feature and a learning softening feature, respectively.
[0196] The eighth calculation unit is configured to obtain a seventh loss value according to the guidance softening feature and the learning softening feature.
[0197] The learning module 870 is specifically configured to update network parameter weights of each network layer in the initial pulse neural network according to the first loss value, the second loss value, the sixth loss value and the seventh loss value.
[0198] Embodiments of the present application also provide an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor implements the pulse neural network supervised learning method described above when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer, etc.
[0199] Please refer to Figure 9 , Figure 9 The hardware structure of the electronic device of another embodiment is illustrated, which includes:
[0200] The processor 901 can be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is configured to execute related programs to implement the technical solutions provided by the embodiments of the present application.
[0201] The memory 902 can be implemented by a ROM (ReadOnly Memory), a static storage device, a dynamic storage device, or a RAM (Random Access Memory), and the like. The memory 902 can store an operating system and other application programs. When the technical solutions provided by the embodiments of the present application are implemented by software or firmware, the related program codes are stored in the memory 902 and are called and executed by the processor 901 to implement the pulse neural network supervised learning method of the embodiments of the present application.
[0202] The input / output interface 903 is configured to implement information input and output.
[0203] The communication interface 904 is configured to implement the communication interaction between the device and other devices. The communication can be implemented by a wired manner (for example, a USB, a network cable, or the like) or a wireless manner (for example, a mobile network, WIFI, Bluetooth, or the like).
[0204] The bus 905 is configured to transmit information between the components (for example, the processor 901, the memory 902, the input / output interface 903, and the communication interface 904) of the device.
[0205] The processor 901, the memory 902, the input / output interface 903, and the communication interface 904 are connected to each other through the bus 905 to realize the communication connection between the components in the device.
[0206] The embodiments of the present application further provide a computer readable storage medium, which stores a computer program. The computer program is executed by the processor to implement the pulse neural network supervised learning method.
[0207] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. In addition, the memory can include a high-speed random access memory and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory that is remotely arranged with respect to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0208] The pulse neural network supervised learning method, device, electronic equipment and storage medium provided by the embodiments of the present application are described as follows. An artificial neural network that has been trained and has stable performance is obtained. The structure of the network should be similar to the pulse neural network to be trained to ensure the feasibility of weight transfer. The weights of each feature node are extracted from the trained artificial neural network. These weights are directly transferred to the corresponding feature nodes in the pulse neural network as the initial weights of the pulse neural network, which provides a good starting point for the pulse neural network using the knowledge accumulated in the training process of the artificial neural network. The preset training image samples are input into the artificial neural network and the pulse neural network respectively. After the artificial neural network processes the input samples, it outputs guiding output features, which will serve as the learning target of the pulse neural network. After the pulse neural network processes the same input samples, it outputs learning output features. According to the guiding output features of the artificial neural network and the learning output features of the pulse neural network, a first loss value is calculated, which reflects the gap between the pulse neural network and the artificial neural network in output features. The depth supervision of the pulse neural network in the spatial domain using the knowledge of the artificial neural network can greatly improve the convergence efficiency and performance of the pulse neural network. In addition, the first time domain features are extracted from the artificial neural network, and the second time domain features of multiple different time steps are extracted from the pulse neural network. The sample similarity between the first time domain features and the second time domain features of each time step is calculated respectively to obtain a second loss value, which is used to evaluate the matching degree of the pulse neural network and the artificial neural network in the time domain features. According to the first loss value and the second loss value, the initial weights of the pulse neural network are adjusted to reduce the first loss value and the second loss value. The present application improves the processing performance of the pulse neural network through the depth supervision learning of the artificial neural network in the spatial domain and the time domain of the pulse neural network.
[0209] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0210] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation to the embodiments of the present application, and can include more or fewer steps than the figures, or combine certain steps, or different steps.
[0211] The apparatus embodiments described above are merely illustrative, and units described as separate components can or can not be physically separate, i.e., can be located in one place, or can be distributed to multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments.
[0212] Those skilled in the art can understand that all or some of the steps in the above disclosed method, the function modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.
[0213] The terms "first", "second", "third", "fourth" and the like (if any) in the description and the above drawings of the present application are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not necessarily limit to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0214] It should be understood that in the present application, "at least one" means one or more, and "multiple" means two or more. "And / or" is used to describe the association between the associated objects, which means that there can be three relationships, for example, "A and / or B" can represent three cases: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or similar expressions means any combination of these items, including any combination of single or multiple items. For example, at least one of a, b or c can mean a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0215] In several embodiments provided in the present application, it should be understood that the disclosed apparatus and method can be implemented by other manners. For example, the apparatus embodiments described above are merely illustrative, for example, the division of the above units is merely a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units or components shown or discussed can be indirect coupling or communication connection through some interfaces, apparatuses or units, and can be electrical, mechanical or other forms.
[0216] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0217] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0218] If the integrated unit is realized in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part of the prior art that makes a contribution or the whole or part of the technical solutions can be embodied in the form of a software product, which is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method of each embodiment of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various program storage media.
[0219] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, but this does not limit the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.
Claims
1. A pulse neural network supervised learning method, characterized in that: The method comprises: Obtaining a trained artificial neural network and a spiking neural network to be trained; wherein the artificial neural network and the spiking neural network have similar network structures; Extracting network parameter weights of each network layer in the artificial neural network, and adjusting the spiking neural network to be trained according to the network parameter weights to obtain an adjusted initial spiking neural network; Inputting preset training image samples into the artificial neural network and the spiking neural network respectively, and obtaining guidance output features and learning output features respectively; Obtaining a first loss value according to the guidance output feature and the learning output feature; Extracting a first time domain feature from the artificial neural network, and extracting a second time domain feature of a plurality of different time steps from the spiking neural network; respectively calculating inter-sample similarities between the first time domain features and the second time domain features of different time steps to obtain a second loss value; According to the first loss value and the second loss value, the network parameter weights of each network layer in the initial spiking neural network are updated.
2. The spiking neural network supervised learning method according to claim 1, characterized in that Obtaining a first loss value according to the guidance output feature and the learning output feature includes: Obtain a preset first projection network; Inputting the learned output features into the first projection network to obtain transformed output features; Obtaining a first loss value according to the guidance output feature and the conversion output feature; Correspondingly, after the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value, the method further includes: Delete the first projection network.
3. The spiking neural network supervised learning method according to claim 1, wherein: The respectively calculating the inter-sample similarity between the first time domain feature and the second time domain features of different time steps to obtain a second loss value includes: Obtaining, according to the sample labels of the first time-domain feature and the second time-domain feature, the sample types of the first time-domain feature and the second time-domain feature; According to the sample labels, inter-sample similarities between the first time domain features and the second time domain features of different time steps are respectively calculated to obtain a second loss value.
4. The spiking neural network supervised learning method according to claim 3, characterized in that: The step of calculating, based on the sample labels, the inter-sample similarities between the first time domain features and the second time domain features of different time steps to obtain a second loss value includes: Obtain a preset second projection network; Inputting the second time domain feature into the second projection network to obtain a transformed time domain feature; According to the sample labels, respectively calculating the inter-sample similarities between the first time domain features and the converted time domain features of different time steps to obtain a second loss value; Correspondingly, after the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value, the method further includes: Delete the second projection network.
5. The spiking neural network supervised learning method according to claim 1, characterized in that: The artificial neural network and the spiking neural network include multiple intermediate processing layers, and the intermediate processing layers of the artificial neural network correspond to the intermediate processing layers of the spiking neural network; The respectively calculating the inter-sample similarity between the first time domain feature and the second time domain features of different time steps to obtain a second loss value includes: respectively calculating inter-sample similarities between the first time domain features extracted by the same intermediate processing layer and the second time domain features of different time steps to obtain a plurality of third loss values; A second loss value is obtained according to the plurality of third loss values.
6. The spiking neural network supervised learning method according to claim 1, characterized in that Before the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value, the method further includes: Inputting a preset training image sequence into the spiking neural network to obtain predicted output features for each time step; Performing prediction entropy processing on the predicted output feature of each time step to obtain a fourth loss value; Calculate the cosine similarity between the predicted output feature and the predicted output features of other time steps to obtain a fifth loss value; Obtaining a sixth loss value according to the fourth loss value and the fifth loss value; Correspondingly, updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value includes: The network parameter weights of each network layer in the initial spiking neural network are updated according to the first loss value, the second loss value and the sixth loss value.
7. The spiking neural network supervised learning method according to claim 6, characterized in that: Before the step of updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value, the second loss value, and the sixth loss value, the method further includes: Softening the guidance output feature and the learning output feature according to a preset temperature parameter to obtain a guidance softening feature and a learning softening feature, respectively; Obtaining a seventh loss value according to the guided softening feature and the learned softening feature; Correspondingly, updating the network parameter weights of each network layer in the initial spiking neural network according to the first loss value, the second loss value, and the sixth loss value includes: The network parameter weights of each network layer in the initial spiking neural network are updated according to the first loss value, the second loss value, the sixth loss value and the seventh loss value.
8. A pulse neural network supervised learning device, characterized in that The device comprises: An acquisition module, configured to acquire a trained artificial neural network and a spiking neural network to be trained; wherein the artificial neural network and the spiking neural network have similar network structures; a transfer module, configured to extract network parameter weights of each network layer in the artificial neural network, and adjust the spiking neural network to be trained according to the network parameter weights to obtain an adjusted initial spiking neural network; An output module, configured to input preset training image samples into the artificial neural network and the spiking neural network, respectively, and obtain guidance output features and learning output features, respectively; A first calculation module, configured to obtain a first loss value according to the guidance output feature and the learning output feature; an extraction module, configured to extract a first time domain feature from the artificial neural network, and extract a second time domain feature of multiple different time steps from the spiking neural network; A second calculation module is used to respectively calculate the inter-sample similarity between the first time domain feature and the second time domain features of different time steps to obtain a second loss value; A learning module is used to update the network parameter weights of each network layer in the initial spiking neural network according to the first loss value and the second loss value.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the pulse neural network supervised learning method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the pulse neural network supervised learning method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Method for generating spatial-temporal consistency depth map sequence based on convolution neural network
CN106612427A
Training method of spiking neural network
CN114037047A