A peripheral federated continuous learning method based on brain-like spiking neural networks
By employing a brain-like spiking neural network-based edge federated continuous learning approach, and leveraging herding effects and data-driven weighted aggregation algorithms, the problems of limited data and catastrophic forgetting on edge devices are addressed, achieving efficient model training and resource conservation.
Patent Information
- Application Number
- CN202411567332.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2044-11-05
AI Technical Summary
When performing deep model learning on edge devices, there are problems such as limited data and catastrophic forgetting, which makes it difficult to train high-performance models and consumes a lot of resources.
We employ an edge federated continuous learning method based on brain-like spiking neural networks. A global model is distributed from a central server and trained on edge devices. A herding effect sample selection strategy and a data-driven adaptive weighted aggregation algorithm are used to integrate model parameters and generate a global model.
It effectively retains old knowledge, mitigates catastrophic forgetting, reduces communication and computing resource consumption, and improves the learning accuracy and generalization of edge devices.
Smart Images

Figure CN119443208B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning methods, and more particularly to an edge federated continuous learning method based on a brain-like spiking neural network. Background Technology
[0002] In today's digital age, IoT devices are ubiquitous, from smart homes and smart cities to industrial automation. With the rapid increase in the number of terminal devices and the significant improvement in computing power, a new computing model—edge computing—is gradually becoming a key technology to meet the needs of smart IoT applications.
[0003] With the rapid development of IoT technology and the continuous improvement of terminal device hardware capabilities, model training and inference computation on edge devices has become a trend. However, learning deep models on edge devices faces many challenges: (1) The data acquired by a single device is usually limited. Due to regulatory constraints, user privacy and other issues, devices cannot share raw data, making it difficult to train high-performance machine learning models on a single IoT device. (2) Edge computing environments are usually dynamic and changeable. In real-world scenarios, edge computing environments are constantly changing. When traditional neural networks learn new tasks, they need to update the model parameters in the network, which leads to the old knowledge being overwritten by the new knowledge, causing a catastrophic forgetting problem. Summary of the Invention
[0004] The main purpose of this application is to provide an edge federated continuous learning method based on brain-like spiking neural networks, which aims to solve the problem of catastrophic forgetting of old knowledge in existing machine learning methods.
[0005] To achieve the above objectives, this application provides an edge federated continuous learning method based on a brain-like spiking neural network, comprising: a central server distributing a global model to be trained to each edge device; each edge device training the global model using a sample set; wherein, upon receiving a new task, the sample set includes a first sample set and a second sample set, the first sample set including all samples in the dataset corresponding to the new task, and the second sample set being obtained by: deleting samples of each category from the current sample set, selecting samples from the first sample set using a herding effect-based sample selection strategy, and adding them to the current sample set; each edge device uploading the parameters of the trained global model to the central server; the central server using image quality metrics to determine the weights of each edge device participating in aggregation, and using a data-driven adaptive weighted aggregation algorithm to integrate the model parameters of each edge device to generate a global model.
[0006] Optionally, samples of each category in the current sample set are deleted, and a sample selection strategy based on the herding effect is used to select samples from the new dataset and add them to the current sample set to obtain an updated sample set. This includes: deleting samples of each category in the current sample set so that the number of samples of each category in the current sample set reaches a preset number; using the global model to be trained to extract features from samples of each category in the new dataset; determining the average value of the features of each category and using it as the category center of each category; sorting the samples of each category according to the Euclidean distance between each sample and the category center; selecting the closest sample from the sorted samples and adding it to the current sample set; combining the added samples, redetermining the average value of the features of each category and using it as the category center of each category, until the number of samples of each category reaches a preset number to obtain an updated sample set.
[0007] Optionally, the global model is a spiking neural network.
[0008] Alternatively, the spiking neural network employs a stateless Poisson encoder.
[0009] Optionally, the image quality metric is determined based on image sharpness and total number of pulses.
[0010] Optionally, the formula for calculating the image quality index is:
[0011]
[0012] in, and For weight parameters, It is a constant. and These are the normalized values for sharpness and total number of pulses, respectively.
[0013] Optionally, edge devices The formula for calculating the weights involved in the aggregation is:
[0014]
[0015] in, , Edge devices , Average image quality index , Edge devices , edge devices The amount of data.
[0016] Optionally, after generating the global model, the method further includes: determining the accuracy and aggregation rounds of the current global model; if the accuracy or aggregation rounds do not reach a preset threshold, the central server uses the current global model as the global model to be trained, and the central server re-distributes the global model to be trained to each edge device until the accuracy or aggregation rounds reach the preset threshold, thus obtaining the global model.
[0017] To achieve the above objectives, this application also provides an edge federated continuous learning device based on a neuromorphic spiking neural network, characterized in that it includes a central server and multiple edge devices;
[0018] The central server is used to send the global model to be trained to each edge device and to aggregate the model parameters uploaded by the edge devices.
[0019] Edge devices are used to train the global model to be trained using a sample set and upload the trained model parameters to the central server;
[0020] When a new task is received, the sample set includes a first sample set and a second sample set. The first sample set includes all samples in the dataset corresponding to the new task. The second sample set is obtained by deleting samples of each category in the current sample set, selecting samples from the first sample set using a sample selection strategy based on the herding effect, and adding them to the current sample set to obtain the second sample set.
[0021] Compared with the prior art, the beneficial effects of this application are as follows:
[0022] This invention discloses an edge federation continuous learning method based on a neuromorphic spiking neural network. It employs a sample selection strategy based on the herding effect, selecting representative old category samples and storing them in the sample set to retain knowledge from previous tasks and mitigate the catastrophic forgetting problem on edge devices. A data-driven dynamic weighted aggregation method is used to integrate model parameters from different devices, achieving generalization of global model performance across various devices. Introducing spiking neural networks into the edge federation scenario reduces communication and computational resources consumed on edge devices, improving their accuracy in continuous tasks. Attached Figure Description
[0023] Figure 1 This is a flowchart illustrating an edge federated continuous learning method based on a brain-like spiking neural network proposed in this application.
[0024] Figure 2 This is a diagram of a single-layer fully connected spiking neural network structure in an edge federation continuous learning method based on a brain-like spiking neural network, as described in this application.
[0025] Figure 3This is a diagram of the convolutional spiking neural network structure in the edge federation continuous learning method based on a brain-like spiking neural network proposed in this application;
[0026] Figure 4 This is a schematic diagram illustrating the working principle of the LIF neuron model in the edge federation continuous learning method based on a brain-like spiking neural network in this application.
[0027] Figure 5 This is an accuracy comparison chart for Example 1 of a brain-like spiking neural network-based edge federation continuous learning method.
[0028] Figure 6 This is an accuracy comparison chart for Example 2 of an edge federation continuous learning method based on a brain-like spiking neural network;
[0029] Figure 7 This is an accuracy comparison chart for Example 3 of an edge federation continuous learning method based on a brain-like spiking neural network;
[0030] Figure 8 This is a framework diagram of an edge federated continuous learning device based on a neuromorphic spiking neural network. The realization of the objectives, functional features, and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0032] The first embodiment of the present invention provides an edge federated continuous learning method (SNN-Enhanced Edge-FCL) based on a brain-like spiking neural network, such as... Figure 1 As shown, the specific steps include:
[0033] Step S1: Server-side S initializes the global model. The global model is sent to each edge device. ;
[0034] Step S2: The edge device trains the global model using the sample set. When a new task is received, the sample set includes a first sample set and a second sample set. The first sample set includes all samples in the dataset corresponding to the new task. The second sample set is obtained by deleting samples of each category in the current sample set, selecting samples from the first sample set using a sample selection strategy based on the herding effect, and adding them to the current sample set to obtain the second sample set. The first and second sample sets are used together to train the global model.
[0035] For example, the sample can be an image, and the specific steps for obtaining the second sample set are as follows:
[0036] Step S211, when a new task occurs, i.e., at the edge device We obtain a new dataset, namely the first sample set, whose category data is: , Total number of sample categories indivual;
[0037] Step S212, determine the size of the second sample set M. The dataset for each category is labeled as Determine the amount of data for each category in the second sample set M. , , ;
[0038] Step S213, the current sample set contains For each category, delete samples from that category in the current sample set, and retain samples from each category. One sample, ( );
[0039] Step S214: Using the current global model, extract features from all samples of each category in the first sample set to obtain the feature function. ;
[0040] Step S215, the categories of the first sample set include Calculate the average value of the features of each category in the first sample set in turn, and use it as the category center;
[0041]
[0042] Step S216: Sort the samples of each category in the first sample set according to the Euclidean distance between each sample and the category center;
[0043] Step S217: Add the sample corresponding to the nearest Euclidean distance to the dataset for each category. In the meantime, and combining the sample features of that sample, return to step S215, until the dataset for each category is complete. The amount of data is ;
[0044] do:
[0045]
[0046]
[0047] ← ( )
[0048] Step S218: Use the dataset obtained in step S217 The current sample set obtained in step S213 is updated to obtain the second sample set M;
[0049] Step S219: Each edge device performs local training using the second sample set M, updating the model parameters. Send to server .
[0050]
[0051] In this embodiment, a sample selection strategy based on the herding effect is adopted to select representative old category samples and store them in the sample set. This retains the knowledge of old tasks and continues to use it in subsequent tasks. This can optimize the model's memory of old categories while absorbing knowledge of new categories, thus achieving effective continuous learning.
[0052] Furthermore, the global model can be a spiking neural network. Introducing spiking neural networks into the edge federation scenario addresses the challenge of limited device resources in edge network environments, providing strong technical support for realizing the intelligence of edge devices. Spiking neural networks can include single-layer fully connected neural networks and convolutional neural networks, which are trained separately. For example... Figure 2 As shown, a single-layer fully connected neural network includes a flattened layer, a linear layer, and spiking neurons, such as... Figure 3 As shown, a convolutional neural network includes convolutional layers, batch normalization layers, max pooling layers, spiking neurons, flattening layers, and linear layers. The training process is as follows:
[0053] Step S221 involves using a stateless Poisson encoder to perform image sparsification, converting the input signal (i.e., image information) into a discrete pulse sequence to simulate the initial response of a biological visual system to a light signal. In this case, "stateless" means that the encoder does not rely on any previous input or state information when generating pulses; each pulse generation is independent. The conversion formula is:
[0054]
[0055] For the input signal Each element in The encoder independently generates a random number uniformly distributed between 0 and 1. For each ,if If the pulse is generated at the corresponding output position (output 1), then no pulse will be generated (output 0); otherwise, no pulse will be generated.
[0056] Step S222: The linear layer in a single-layer fully connected neural network or the convolutional layer, batch normalization layer, and max pooling layer in a convolutional neural network perform preliminary transformations on the discrete pulse sequence to extract effective information.
[0057] Step S223: The initially transformed pulse sequence is transmitted to the spiking neuron. The neuron's membrane potential changes are simulated by accumulating the input pulse sequence and firing action potentials when a threshold is reached. The specific process is as follows... Figure 4 As shown, The input pulse is transmitted through the synapse to the dendrite, and ultimately processed by the cell body. The cell body's processing formula is as follows:
[0058]
[0059]
[0060]
[0061] in, It is the time step. It is a constant. It is the integration time window; and These represent the membrane potential and the output peak value, respectively. This is the membrane potential, i.e. Figure 5 The latent potential of the cell body. and These are the resting potential and the reset potential. It is the membrane potential threshold. It is the first The weights of each input synapse. Is the first The first input synapse A pulse in The moment when the output peak value is 1 is within this integration time window.
[0062] The specific process is as follows: (1) When the membrane potential Above the threshold At this time, the spiking neuron fires a pulse, and at this time the output potential is... Set to 1, and simultaneously the membrane potential Return to reset potential When the membrane potential Below the threshold At that time, the output potential Keep it at 0;
[0063] (2) Membrane potential at each time stage The update process satisfies the above differential equation, and the derivative of the differential equation is: on the one hand, the membrane potential The value should decrease On the other hand, membrane potential The value should increase by one value, the magnitude of which is related to the neuron's... It relates to each input synapse, and the weight of each input synapse is... The contribution of this synapse to the rise in membrane potential is That is, in In each pulse, if If the input pulse at time t is the output pulse state (i.e., state 1), then one calculation... And accumulate.
[0064] Step S224: Generate pulse output.
[0065] Step S3: Each edge device uploads the trained model parameters to the central server;
[0066] In step S4, the central server determines the image quality index based on the image sharpness and the total number of pulses, uses the image quality index to determine the weight of each edge device participating in the aggregation, and uses a data-driven adaptive weighted aggregation algorithm to integrate the model parameters of each edge device to generate a global model.
[0067] Specifically, in step S41, the central server receives the local models from the edge devices participating in this round of federated training. ;
[0068] Step S42: Calculate the weight of each edge device participating in the aggregation. :
[0069]
[0070] in, , Edge devices , Average image quality index , Edge devices , edge devices The amount of data, , By analyzing the data quality metrics of each image The data quality index for each image is obtained by mean normalization. The calculation formula is as follows:
[0071]
[0072] in, and It is a weighting parameter used to balance the importance of sharpness and the total number of pulses. It is a very small constant to prevent the denominator from being 0. and These are the normalized values for image sharpness and total pulse count, respectively, expressed as image sharpness and total pulse count. and These are the standard deviations of sharpness and total pulse count, respectively.
[0073]
[0074]
[0075] In the formula, and These are the theoretical average values for sharpness and total number of pulses, respectively. and These are the standard deviations of sharpness and total number of pulses, respectively.
[0076]
[0077] in, Represents the Laplace operator. Is the image in position The pixel value.
[0078] Each pixel is determined by its intensity value ( The number of pulses issued ( The image follows a Poisson distribution, and its expected value is proportional to the pixel intensity. The total number of pulses in each image is defined as (…). )for:
[0079]
[0080] in , It is a proportional constant representing the conversion rate from pixel intensity to pulse number.
[0081] Step 43: Perform global aggregation using the Data-Driven Weighted Aggregation Method (DDAWA) to generate a global model. The aggregation formula is as follows:
[0082]
[0083] in These are the edge devices participating in this aggregation. These are the model parameters corresponding to each edge device. They are different tasks.
[0084] In this embodiment, a data-driven dynamic weighted aggregation method is used to integrate model parameters from different devices, thereby achieving the generalization of global model performance across various devices.
[0085] Step S5: Determine the accuracy and number of aggregation rounds of the current global model. If the accuracy or number of aggregation rounds reaches a preset threshold, the process ends. If neither the accuracy nor the number of aggregation rounds reaches the preset threshold, the central server uses the current global model as the global model to be trained and repeats steps S1-S4 until the accuracy or number of aggregation rounds reaches the preset threshold, thus obtaining the global model.
[0086] Example 1
[0087] The method of this invention was experimentally verified using the MNIST dataset, and the results are as follows.
[0088] like Figure 5 As shown, the orange curve depicts the accuracy trend of traditional federated continuous learning during continuous edge federation, while the blue curve shows the accuracy change of the SNN-Enhanced Edge-FCL method. Initially, both methods achieved high accuracy on the first task. However, as the number of tasks increased, especially after the second task, the accuracy of the traditional neural network method showed a gradual decline, significantly decreasing to 20% by the fifth task. In contrast, although the accuracy of the SNN-Enhanced Edge-FCL method of this invention fluctuated as the number of tasks increased, its accuracy quickly recovered and stabilized above 80% after several rounds of global aggregation, maintaining an accuracy of 87% by the fifth task.
[0089] As shown in Table 1, it can be clearly seen that the SNN-Enhanced Edge-FCL method of the present invention has significant advantages over traditional neural network federated continuous learning methods in terms of resource consumption. (1) The number of parameters of the spiking neural network model accounts for only 8% of the number of parameters of the traditional LeNet neural network model, which directly leads to a significant reduction in communication overhead during the federated learning aggregation process. This significant difference means that the amount of parameter transmission of the SNN model is greatly reduced during the aggregation process under the federated learning framework, which significantly reduces communication costs. (2) The spiking neural network has a simple structural design, containing only three layers, and the computational overhead is reduced from millions to tens of thousands, which significantly reduces the computational requirements of edge devices when the model is running. Compared with traditional methods, the SNN-Enhanced Edge-FCL of the present invention not only reduces the amount of data transmitted by the model, but also reduces the computational requirements for running the model on edge devices, thereby improving the efficiency of continuous learning and the overall performance of the model while maintaining privacy protection, providing an economical and efficient solution for federated learning in edge computing environments.
[0090] Table 1 Comparison of Resource Consumption
[0091]
[0092] Example 2
[0093] This embodiment tests a sample selection strategy based on the herding effect during local training of edge devices. Five edge device clients and one central server complete a total of five tasks, with each task consisting of 20 rounds. Figure 6 As shown in b, the present invention adopts a sample selection strategy based on the herding effect to retain representative old data samples of each historical task. It was found that although the test accuracy dropped significantly when first encountering a new task, the test accuracy continued to rise as the global model was continuously aggregated on the new task. After 20 rounds of aggregation on the task 5 central server, the accuracy could reach 84%. Figure 6 Traditional methods without any strategy show good results for the first task, but accuracy declines with each subsequent task. In contrast, the strategy employed in this invention significantly improves the mitigation of catastrophic forgetting of older data and substantially enhances the retention of older tasks.
[0094] Example 3
[0095] The central server uses the data-driven weighted aggregation method proposed in this invention to aggregate the local models of each edge device, and the result is as follows. Figure 7As shown in the figure, the orange curve represents the effect of direct aggregation, while the blue curve represents the effect of aggregation using DDAWA. It was found that when tested on each task, the accuracy of DDAWA was higher than that of direct aggregation, indicating that DDAWA can retain more meaningful knowledge of the models on different edge devices when performing global model aggregation.
[0096] A second embodiment of the present invention provides an edge federated continuous learning device based on a neuromorphic spiking neural network, such as... Figure 8 As shown, the system includes a central server and multiple edge devices. The central server sends a global model to be trained to each edge device and aggregates the model parameters uploaded by the edge devices. The edge devices train the global model using a sample set and upload the trained model parameters to the central server. When a new dataset appears, samples of each category in the current sample set are deleted, and a sample selection strategy based on herding effect is used to select samples from the new dataset and add them to the current sample set to obtain an updated sample set. The updated sample set is then used to train the global model.
[0097] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. A peripheral federated continuous learning method based on a brain-like spiking neural network, characterized in that, include: The central server distributes the global model to be trained to each edge device; Each edge device uses a sample set to train the global model to be trained; When a new task is received, the sample set includes a first sample set and a second sample set. The first sample set includes all samples in the dataset corresponding to the new task. The second sample set is obtained as follows: Delete samples from each category in the current sample set to bring the number of samples from each category in the current sample set to a preset number; the samples are images. The current global model to be trained is used to extract features from samples of each category in the new dataset. Determine the average value of the features for each category and use it as the category center for each category; The samples in each category are sorted according to the Euclidean distance between each sample and the category center; Select the nearest sample from the sorted samples and add it to the current sample set; By combining the added samples, the average value of the features of each category is re-determined and used as the category center of each category until the number of samples in each category reaches a preset number, thus obtaining the second sample set; Each edge device uploads the parameters of the trained global model to the central server; The central server uses image quality metrics to determine the weight of each edge device in the aggregation process, and uses a data-driven adaptive weighted aggregation algorithm to integrate the model parameters of each edge device to generate a global model. The global model is a spiking neural network; The formula for calculating the image quality index is as follows: in, and For weight parameters, It is a constant. and These are the normalized values for sharpness and total number of pulses, respectively. Edge devices The formula for calculating the weights involved in the aggregation is: in, , Edge devices , Average image quality index , Edge devices , edge devices The amount of data.
2. The edge federated continuous learning method based on neuromorphic spiking neural networks according to claim 1, characterized in that, The spiking neural network employs a stateless Poisson encoder.
3. The edge federated continuous learning method based on neuromorphic spiking neural networks according to claim 1, characterized in that, The image quality index is determined based on image sharpness and total number of pulses.
4. The edge federated continuous learning method based on neuromorphic spiking neural networks according to claim 1, characterized in that, After generating the global model, the method further includes: The accuracy and number of aggregation rounds of the current global model are determined. If the accuracy or the number of aggregation rounds does not reach the preset threshold, the central server uses the current global model as the global model to be trained. The central server then re-distributes the global model to be trained to each edge device until the accuracy or the number of aggregation rounds reaches the preset threshold, thus obtaining the global model.
5. An edge federated continuous learning device based on a neuromorphic spiking neural network, characterized in that, Includes a central server and multiple edge devices; The central server is used to send a global model to be trained to each edge device; the global model is a spiking neural network. The edge device is used to train the global model to be trained using a sample set, and upload the trained model parameters to the central server; When a new task is received, the sample set includes a first sample set and a second sample set. The first sample set includes all samples in the dataset corresponding to the new task. The second sample set is obtained by deleting samples of each category in the current sample set so that the number of samples of each category in the current sample set reaches a preset number. The samples are images. The current global model to be trained is used to extract features from samples of each category in the new dataset. Determine the average value of the features for each category and use it as the category center for each category; The samples in each category are sorted according to the Euclidean distance between each sample and the category center; Select the nearest sample from the sorted samples and add it to the current sample set; By combining the added samples, the average value of the features of each category is re-determined and used as the category center of each category until the number of samples in each category reaches a preset number, thus obtaining the second sample set; The central server is also used to determine the weight of each edge device participating in the aggregation using image quality indicators, and to integrate the model parameters of each edge device using a data-driven adaptive weighted aggregation algorithm to generate a global model. The formula for calculating the image quality index is as follows: in, and For weight parameters, It is a constant. and These are the normalized values for sharpness and total number of pulses, respectively. Edge devices The formula for calculating the weights involved in the aggregation is: in, , Edge devices , Average image quality index , Edge devices , edge devices The amount of data.
Citation Information
Patent Citations
An active learning and deep learning combined aluminum material surface defect detection method
CN109886925A
Federal continuous learning method and system based on width network architecture
CN117973562A