Enhancing Efficient Continual Learning with Dynamic Structure
  Development of Spiking Neural Networks
Children possess the ability to learn multiple cognitive tasks sequentially,
which is a major challenge toward the long-term goal of artificial general
intelligence. Existing continual learning frameworks are usually applicable to
Deep Neural Networks (DNNs) and lack the exploration on more brain-inspired,
energy-efficient Spiking Neural Networks (SNNs). Drawing on continual learning
mechanisms during child growth and development, we propose Dynamic Structure
Development of Spiking Neural Networks (DSD-SNN) for efficient and adaptive
continual learning. When learning a sequence of tasks, the DSD-SNN dynamically
assigns and grows new neurons to new tasks and prunes redundant neurons,
thereby increasing memory capacity and reducing computational overhead. In
addition, the overlapping shared structure helps to quickly leverage all
acquired knowledge to new tasks, empowering a single network capable of
supporting multiple incremental tasks (without the separate sub-network mask
for each task). We validate the effectiveness of the proposed model on multiple
class incremental learning and task incremental learning benchmarks. Extensive
experiments demonstrated that our model could significantly improve
performance, learning speed and memory capacity, and reduce computational
overhead. Besides, our DSD-SNN model achieves comparable performance with the
DNNs-based methods, and significantly outperforms the state-of-the-art (SOTA)
performance for existing SNNs-based continual learning methods.
Bing Han, Feifei Zhao, Yi Zeng, Wenxuan Pan, Guobin Shen
Enhancing Efficient Continual Learning with Dynamic Structure Development of Spiking Neural Networks

###### Abstract

Children possess the ability to learn multiple cognitive tasks sequentially, which is a major challenge toward the long-term goal of artificial general intelligence. Existing continual learning frameworks are usually applicable to Deep Neural Networks (DNNs) and lack the exploration on more brain-inspired, energy-efficient Spiking Neural Networks (SNNs). Drawing on continual learning mechanisms during child growth and development, we propose Dynamic Structure Development of Spiking Neural Networks (DSD-SNN) for efficient and adaptive continual learning. When learning a sequence of tasks, the DSD-SNN dynamically assigns and grows new neurons to new tasks and prunes redundant neurons, thereby increasing memory capacity and reducing computational overhead. In addition, the overlapping shared structure helps to quickly leverage all acquired knowledge to new tasks, empowering a single network capable of supporting multiple incremental tasks (without the separate sub-network mask for each task). We validate the effectiveness of the proposed model on multiple class incremental learning and task incremental learning benchmarks. Extensive experiments demonstrated that our model could significantly improve performance, learning speed and memory capacity, and reduce computational overhead. Besides, our DSD-SNN model achieves comparable performance with the DNNs-based methods, and significantly outperforms the state-of-the-art (SOTA) performance for existing SNNs-based continual learning methods.

## 1 Introduction

Children are able to incrementally learn new tasks to acquire new knowledge, however, this is a major challenge for Deep Neural Networks (DNNs) and Spiking Neural Networks (SNNs). When learning a series of different tasks sequentially, DNNs and SNNs forget the previously acquired knowledge and fall into catastrophic forgetting [12]. Despite some preliminary solutions that have recently been proposed for DNNs-based continual learning, there is still a lack of in-depth inspiration from brain continual learning mechanisms and exploration on SNNs-based models.

The studies attempt to address the continual learning problem of DNNs under task incremental learning (recognition within the classes of a known task) and class incremental learning (recognition within all learned classes) scenarios. Related works can be roughly divided into three categories:

**a) Regularization.** Employing maximum a posterior estimation minimizes the changes of important weights [13, 14, 15]. These methods require strong model assumptions, such as the EWC [14] supposing that new weights are updated to local regions of the previous task weights, which are highly mathematical abstractions and poorly biologically plausibility.

**b) Replay and retrospection.** Reviewing a portion of the samples of the old tasks while learning the new task [15, 16, 17], is currently considered as the superior class incremental learning method. The samples of old tasks are stored in additional memory space or generated by additional generation networks, resulting in extra consumption.

**c) Dynamic network structure expansion.** [18, 19] proposed progressive neural networks that extend a new network for each task, causing a linear increase in network scale. To reduce network consumption, a sub-network of the whole is selected for each task using pruning and growth algorithms [11, 12], evolutionary algorithms [16] or reinforcement learning (RL) algorithms [13, 14]. However, these methods require storing a mask for each sub-network, which to some extent amounts to storing a separate network for each task, rather than a brain-inspired overall network capable of performing multiple sequential tasks simultaneously.

To the best of our knowledge, there is little research on SNNs-based continual learning. Spiking neural networks, as third-generation neural networks [15, 16], simulate the information processing mechanisms of
the brain, and thus serve well as an appropriate level of abstraction for integrating inspirations from brain multi-scale biological plasticity to achieve child-like continual learning. The existing HMN algorithm [15] uses a DNN network to decide the sub-network of SNN for each task, and is only applicable to two-layer fully connected networks for the N-MNIST dataset. There is still a lack of SNNs-based continual learning methods that could incorporate in-depth inspiration from the brain's continual learning mechanisms, while achieving comparable performance with DNNs under complex continual learning scenarios.

Structural development mechanisms allow the brain's nervous system to dynamically expand and contract, as well as flexibly allocate and invoke neural circuits for efficient continual learning [11]. Motivated by this, this paper proposes Dynamic Structure Development of Spiking Neural Networks (DSD-SNN) for efficient and adaptive continual learning. DSD-SNN is designed as an SNN architecture that can be dynamically expanded and compressed, empowering a single network to learn multiple incremental tasks simultaneously, overcoming the problem of needing to assign masks to each task faced by DNNs-based continual learning methods. We validate the effectiveness of our proposed model on multiple class incremental learning (CIL) and task incremental learning (TIL) benchmarks, achieving comparable or better performance on MNIST, N-MNIST, and CIFAR-100 datasets. Especially, the proposed DSD-SNN model achieves an accuracy of 77.92% \(\pm\) 0.29% on CIFAR100, only using 37.48% of the network parameters.

The main contributions of this paper can be summarized as follows:

* DSD-SNN dynamically grows new neurons to learn newly arrived tasks, while extremely compressing the network to increase memory capacity and reduce computational overhead.
* DSD-SNN maximally utilizes the previously learned tasks to help quickly adapt and infer new tasks, enabling efficient and adaptive continual learning (no need to identify separate sub-network mask for each task).
* The experimental results demonstrate the remarkable superiority of DSD-SNN model on performance, learning speed, memory capacity and computational overhead compared with the state-of-the-art (SOTA) SNNs-based continual learning algorithms, and comparable performance with DNNs-based continual learning algorithms.

## 2 Related Work

This paper mainly focuses on dynamic network structure expansion algorithms based on structural plasticity, which can be divided into progressive neural networks (PNN) and sub-network selection algorithms. In fact, the existing network structure expansion algorithms are mostly DNNs-based continual learning, with little exploration on SNNs.

**Progressive neural networks.**[17] first proposes the progressive neural network and applies it to multiple continual reinforcement learning tasks. The PNN expands a new complete network for each new task and fixes the networks of the old tasks. In addition, lateral connections are introduced between the networks to effectively leverage the knowledge already learned. PIL [13] extends the PNN to large-scale convolutional neural networks for image classification tasks. However, the PNNs algorithms extremely increase the network storage and computational consumption during continual learning. In contrast, as development matures and cognition improves, the number of brain synapses decreases by more than 50% [10], forming a highly sparse brain structure perfect for continual learning. The PNNs blindly expand the structure causing catastrophic effects in the case of massive sequential tasks.

Sub-network selection algorithm.A part of the network nodes is selected to be activated for a given task. PathNet [10] is first proposed to select path nodes (each node contains a set of neurons) for each task using the genetic algorithm. RPS-Net [14] randomly activates multiple input-to-output paths connected by convolutional blocks, and chooses the highest-performing ones as the final path. In addition, RCL [23] employ additional RL networks to learn the number of neurons required for a new task, while CLEAS [1] uses RL to directly determine the activation and death of each neuron. HMN [15] uses a hybrid network learning framework that uses an ANN modulation network to determine the activation of neurons for a SNN prediction network, but is only applied to small-scale networks for simple scenarios. A sub-network mask learning process based on pruning strategy is proposed by [1], which is applied to CIL combined with the replay strategy. The above algorithms select sub-networks for each task separately, failing to maximize the reuse of acquired knowledge to support new task learning.

To solve this problem, DRE [24] prunes a sparse convolutional feature extractor for each task, and then merges the output of the convolution extractor into the previous tasks. CLNP [18] grows new neurons for a new task based on the old network, and DEN [21] expands when the already learned network is insufficient for the new task, while reusing the existing neurons. These several works require storing an additional sub-network mask for each task, which both increases additional storage consumption and is not consistent with the overall developmental learning process of the brain.

Considering the various limitations of existing works above, the DSD-SNN proposed in this paper, which is a pioneering algorithm on SNNs-based continual learning, enables the capacity of a single network to learn multiple sequential tasks simultaneously, while reusing the acquired knowledge and significantly increasing the memory capacity.

## 3 Method

### Continual Learning Definition

We are expected to sequentially learn \(\Gamma\) tasks, \(\Gamma=\{T_{1},...,T_{N}\}\). Each task \(T_{i}\) takes the form of a classification problem with its own dataset: \(D_{T_{i}}=\{(x_{j},y_{j})\}_{j=1}^{N_{T_{i}}}\), where
\(x_{j}\in\chi,y_{i}\in\{1,...,C_{T_{i}}\}\), \(\chi\) is the input image space, \(N_{T_{i}}\) and \(C_{T_{i}}\) are the number of samples and classes of task \(T_{i}\). For the task incremental learning scenario, \(T_{i}\) is knowable in the testing process, setting requires to optimize:

\[\underset{\theta}{max}\:E_{T_{i}\sim\Gamma}[E_{(x_{j},y_{j})\sim T_{i}}[logp_{ \theta}(y_{j}|x_{j},T_{i})]] \tag{1}\]

where \(\theta\) is the network parameters. When \(T_{i}\) is unknown in testing, more complex class incremental learning scenarios solve the following problems:

\[\underset{\theta}{max}\:E_{T_{i}\sim\Gamma}[E_{(x_{j},y_{j})\sim T_{i}}[logp_ {\theta}(y_{j}|x_{j})]] \tag{2}\]

### DSD-SNN Architecture

The design of the DSD-SNN algorithm is inspired by the dynamic allocation, reorganization, growth, and pruning of neurons during efficient continual learning in the brain. As depicted in Fig. 1, the proposed DSD-SNN model includes three modules (random growth, adaptive pruning, freezing neurons) to accomplish multi-task incremental learning.

Random growth.When a new task is coming, the DSD-SNN model first randomly assigns and grows a portion of untrained empty neurons to form a new pathway. And the new task-related classification neurons are added to the output layer as shown in Fig. 1. Newly grown neurons receive the output of all non-empty neurons of the previous layer (both newly grown neurons and already frozen neurons in the previous tasks). Therefore, all features learned from previous tasks can be captured and reused by the neural pathways of the new task. Then, the DSD-SNN algorithm can take full advantage of the features learned from the previous task to help the new task converge quickly, while the newly grown neurons can also focus on learning features specific to the new task.

Adaptive pruning.During the learning process of the current task, the DSD-SNN algorithm adaptively detects relatively inactive neurons in the current pathway based on synaptic activity and prunes those redundant neurons to save resources. The pruned neurons are re-initialized as empty neurons that can be assigned to play a more important role in future tasks. Pruning only targets those neurons that are newly grown for the current task and does not include neurons that were frozen in the previous tasks. Adaptive pruning can substantially expand the memory capacity of the network to learn and memorize more tasks under a fixed scale.

Freezing neurons.The contributing neurons that are retained after pruning will be frozen, enabling the DSD-SNN model to learn new tasks without forgetting the old tasks. The frozen neurons can be connected to newly grown neurons to provide acquired knowledge. During the training of new

Figure 1: The DSD-SNN model realizes multi-task incremental learning through random growth, adaptive pruning, and freezing of neurons.
task \(T_{i}\), all input synapses of the frozen neuron are no longer updated, only the newly added output synapses to the new neurons can be updated. The DSD-SNN model with neuron growth, pruning, and freezing can memorize previous knowledge and reuse the acquired knowledge to learn new tasks for efficient continual learning.

The deep SNN with multiple convolutional and fully connected layers is constructed to implement task incremental learning and class incremental learning, as shown in Fig. 2. During the training process, we sequentially input training samples of each task and update the synapses newly added to the network. In the testing process, test samples of all learned tasks are fed into our overall multi-task continual learning network, so that a single DSD-SNN model can achieve all tasks without the need to identify separate sub-network mask for each task.

To address more complex class incremental learning, we add a two-layer network as the task classifier. The task classifier receives inputs from the classes outputs of the continual learning network, and outputs which task the current sample belongs to (as in the red box in Fig. 2). According to the inferred task \(\hat{T_{i}}\) obtained from the task classifier, the DSD-SNN model chooses the maximum output class of the \(\hat{T_{i}}\) task in the continual learning network as the predicted class.

### DSD-SNN Computational Details

So far in this section, we have described how our model efficiently and adaptively accomplishes continual learning. We now introduce the detailed growth and pruning scheme that we use throughout this paper.

#### 3.3.1 Neuronal Growth and Allocation

During brain development, neurons and synapses are first randomly and excessively grown and then reshaped based on the external experience [15, 10]. In the DSD-SNN model, the SNN is first initialized to consist of \(N^{l}\) neurons in each layer \(l\). In the beginning, all neurons in the network are unassigned empty neurons \(N_{empty}\). When the new task \(T_{i}\) arrives, we randomly grow \(\rho\%\times N^{l}\) neurons from the empty neurons for each layer, denoted as \(N_{new}\). After training and pruning for task \(T_{i}\), all retained neurons \(N_{new}\) are frozen, added to \(N_{frozen}\).

To better utilize the acquired knowledge, the newly grown neurons \(N_{new}^{l}\) in each layer not only receive the output of the new growth neurons \(N_{new}^{l-1}\) in the previous layer, but also receive the output of the frozen neurons \(N_{frozen}^{l-1}\) in the previous layer, as follows.

\[\{N_{frozen}^{l-1},N_{new}^{l-1}\}\to N_{new}^{l} \tag{3}\]

Where \(\rightarrow\) represents the input connections. For the frozen neurons \(N_{frozen}^{l-1}\), growth does not add input connections to avoid interference with the memory of previous tasks.

Note that we do not assign task labels to frozen and new growth neurons in either the training or testing phase of continual learning. That is, the DSD-SNN algorithm uses the entire network containing all neurons that have learned previous tasks to do prediction and inference. Thus, our model is able to learn multiple sequential tasks simultaneously without storing separate sub-network masks.

#### 3.3.2 Neuronal Pruning and Deactivation

Neuroscience researches have demonstrated that after the overgrowth in infancy, the brain network undergoes a long pruning process in adolescence, gradually emerging into a delicate and sparse network [12, 13, 14]. Among them, input synapses are important factors to determine the survival of neurons according to the principle of "use it or lose it" [15, 16, 17]. For SNN, neurons with input synapse weights close to 0 are more difficult to accumulate membrane potentials beyond the spiking threshold, resulting in firing spikes less and contributing to the outputs less. Therefore, we used the sum of input synapse weights \(S_{i}^{l}\) to assess the importance of neurons \(i\) in the \(l\) layer as in Eq. 4.

\[S_{i}^{l}=\sum_{j=1}^{M_{l-1}}W_{ij} \tag{4}\]

Figure 2: The architecture of the DSD-SNN model.
Where \(W_{ij}\) is the synapse weights from presynaptic neuron \(j\) to postsynaptic neuron \(i\), \(M_{l-1}\) is the number of presynaptic neurons.

During the training of new tasks, we monitor the importance of newly grown neurons \(N_{new}\) and prune redundant neurons whose values of \(S_{i}\) are continuously getting smaller. Here, we define a pruning function as follows:

\[\phi_{P_{i}^{l}}=\alpha*Norm(S_{i}^{l})-\rho_{p} \tag{5}\]

\[P_{i}^{l}=\gamma P_{i}^{l}+e^{-\frac{epoch}{\eta}}\phi_{P_{i}^{l}} \tag{6}\]

Where \(Norm(S_{i}^{l})\) refers to linearly normalize \(S_{i}^{l}\) to 0 \(\sim\) 1. \(\alpha=2\) and \(\rho_{p}\) control the pruning strength. \(\rho_{p}\) includes \(\rho_{c}\) and \(\rho_{f}\) for the convolutional and fully connected layers, respectively. \(P_{i}^{l}\) is initialized to 5. \(\gamma=0.99\) and \(\eta\) controls the update rate as [14]. \(e^{-\frac{epoch}{\eta}}\) decreases exponentially with increasing epoch, which is consistent with the speed of the pruning process in biological neural networks that are first fast, then slow, and finally stable [17, 14].

The pruning functions are updated at each epoch, then we prune neurons with the pruning function \(P_{i}^{l}<0\). We structurally prune channels in the convolutional layer and prune neurons in the fully connected layer, removing their input connections and output connections.

### SNNs Information Transmission

Different from DNNs, SNNs use spiking neurons with discrete 0/1 output, which are able to integrate spatio-temporal information. Specifically, we employ the leaky integrate-and-fire (LIF) neuron model [1] to transmit and memorize information. In the spatial dimension, LIF neurons integrate the output of neurons in the previous layer through input synapses. In the temporal dimension, LIF neurons accumulate membrane potentials from previous time steps via internal decay constants \(\tau\). Incorporating the spatio-temporal information, the LIF neuron membrane potential \(U_{i}^{t,l}\) at time step \(t\) is updated by the following equation:

\[U_{i}^{t,l}=\tau(1-U_{i}^{t-1,l})+\sum_{j=1}^{M_{l-1}}W_{ij}O_{j}^{t,l-1} \tag{7}\]

When the neuronal membrane potential exceeds the firing threshold \(V_{th}\), the neuron fires spike, and its output \(O_{i}^{t,l}\) is equal to 1; Conversely, the neuron outputs 0. The discrete spiking outputs of LIF neurons conserve consumption as the biological brain, but hinder gradient-based backpropagation. To address this problem, [20] first proposed the method of surrogate gradient. In this paper, we use Qgategrad [15] surrogate gradient method with constant \(\lambda=2\) to approximate the spiking gradient, as follows:

\[\frac{O_{i}^{t,l}}{U_{i}^{t,l}}=\begin{cases}0,&|U_{i}^{t,l}|>\frac{1}{\lambda} \\ -\lambda^{2}|U_{i}^{t,l}|+\lambda,&|U_{i}^{t,l}|\leq\frac{1}{\lambda}\end{cases} \tag{8}\]

Overall, We present the specific procedure of our DSD-SNN algorithm as Algorithm 1.

```
Input: Dataset \(D_{T_{i}}\) for each task \(T_{i}\);  Initialize empty network \(Net\);  Constant parameters of growth \(\rho\%\) and pruning \(\rho_{c},\rho_{f}\). Output: Prediction Class in task \(T_{i}\) (TIL) or in all tasks (CIL). for each sequential task \(T_{i}\)do  Growing new neurons to \(Net\) as Eq. 3; for\(epoch=0\); \(epoch<E\); \(epoch++\)do  SNN forward prediction \(Net\) (\(D_{T_{i}}\)) as Eq. 7;  SNN backpropagation to update new connections as Eq. 8;  Assessing importance for newly grown neurons as Eq. 4;  Calculating the neuronal pruning function as Eq. 5 and Eq. 6;  Pruning redundant neurons with \(P_{i}^{l}<0\);  end for  Freezing retained neurons in \(Net\);  end for
```

**Algorithm 1**The DSD-SNN Continual Learning.

## 4 Experiments

### Datasets and Models

To validate the effectiveness of our DSD-SNN algorithm, we conduct extensive experiments and analyses on the spatial MNIST [11], CIFAR100 [21] and neuromorphic temporal N-MNIST datasets [1] based on the brain-inspired cognitive intelligence engine BrainCog [13]. The specific experimental datasets and models are as follows:

* Permuted MNIST: We permute the MNIST handwritten digit dataset to ten tasks via random permutations of the pixels. Each task contains ten classes, divided into 60,000 training samples and 10,000 test samples. As for the SNN model, we use the SNN with two convolutional layers, one fully-connected layer, and the multi-headed output layer.
* Permuted N-MNIST: We randomly permute the N-MNIST ( the neuromorphic capture of MNIST) to ten tasks. And we employ the same sample division and the same SNN structure as MNIST.
* Split CIFAR100: The more complex natural image dataset CIFAR100 is trained in several splits including 10 steps (10 new classes per step), 20 steps (5 new classes per step). SNN model consisting of eight convolutional layers, one fully connected and multi-headed output layer are used to generate the predicted class.

For the task classifier, we use networks containing a hidden layer with 100 hidden neurons for MNIST and N-MNIST, and 500 hidden neurons for CIFAR100. To recognize tasks better, we replay 2000 samples for each task as [12, 13, 14]. Our code is available at [https://github.com/BrainCog-X/BrainCog/tree/main/examples/Structural_Development/DSD-SNN](https://github.com/BrainCog-X/BrainCog/tree/main/examples/Structural_Development/DSD-SNN).
### Comparisons of Performance

As shown in Fig. 2(a), our DSD-SNN model maintains high accuracy with increasing number of learned tasks. This demonstrates that the proposed model overcomes catastrophic forgetting on all MNIST, neuromorphic N-MNIST and more complex CIFAR100 datasets, achieving robustness and generalization capability on both TIL and CIL. To validate the effectiveness of our dynamic structure development module, we compare the learning process of DSD-SNN with other DNNs-based continual learning and transfer them to SNN as Fig. 2(b). The experimental results indicate that DSD-SNN realizes superior performance in learning and memorizing more incremental tasks, exhibiting larger memory capacity compared to the DNNs-based continual learning baselines.

The comparison results of the average accuracy with existing continual learning algorithms based on DNN and SNN are shown in Table 1 and Table 2. In the TIL scenario, our DSD-SNN achieves an accuracy of 97.30% \(\pm\) 0.09% with a network parameter compression rate of 34.38% for MNIST, which outperforms most DNNs-based algorithms such as EWC [17], GEM [14], and RCL [20]. In particular, our algorithm achieves a higher performance improvement of 0.70% over the DEN [21] model (which is also based on growth and pruning). For the temporal neuromorphic N-MNIST dataset, our DSD-SNN algorithm is superior to the existing HMM algorithm which combines SNN with DNN [15]. Meanwhile, our DSD-SNN model achieves 92.69% \(\pm\) 0.57% and 96.94% \(\pm\) 0.05% accuracy in CIL scenarios for MNIST and N-MNIST, respectively.

From Table 2, our DSD-SNN outperforms PathNet [16], DEN [21], RCL [20] and HNET [21], which are also structural extension methods, in both TIL and CIL scenarios for 10 steps CIFAR100. iCaRL [14] and DER++ [22] achieve higher accuracy of 84.20% in TIL scenarios than our 77.92%, but they are inferior in CIL scenarios (51.40% and 55.30%) than our 60.47%. Moreover, the DSD-SNN compresses the network to only 37.48% after learning all tasks, further saving energy consumption. For 20 steps CIFAR100 with more tasks, our DSD-SNN achieves even higher accuracy 81.17% in TIL scenario and has excellent experimental results consistent with 10 steps. To the best of our knowledge, this is the first time that the energy-efficient deep SNNs have been used to solve CIFAR100 continual learning and achieve comparable performance with DNNs.

In summary, the DSD-SNN model significantly outperforms the SNNs-based continual learning model on the N-MNIST dataset. On MNIST and CIFAR100 datasets, the proposed model achieves comparable performance with DNNs-based models and performs well on both TIL and CIL.

### Effects of Efficient Continual Learning

Fig. 4 depicts the performance of the DSD-SNN model for task incremental learning on multiple datasets. The experimental results demonstrate that our SNNs-based model could improve the convergence speed and performance of new tasks during sequential continual learning, possessing the forward transfer capability. The newer tasks achieve higher performance from the beginning for MNIST and CIFAR100 datasets, indicating that the previously learned knowledge is fully utilized to help the new tasks. Also, the new tasks converge to higher performance faster, suggesting that the network has a strong memory capacity to continuously learn and remember new tasks. Similar comparable results can be obtained on the N-MNIST dataset.

### Ablation Studies

**Effects of each component.** To verify the effectiveness of the growth and pruning components in our DSD-SNN model, we compare the number of network parameters (Fig.4(a)) and performance (Fig.4(b)) of DSD-SNN, DSD-SNN without pruning, and DSD-SNN without reused growth during multi-task continual learning. The experimental results show that the number of parameters in the DSD-SNN model fluctuates up and finally stabilizes at 37.48% for CIFAR100, achieving superior accuracy on multi-task continual learning. In contrast,

\begin{table}
\begin{tabular}{c c c} \hline \hline Method & Dataset & Acc \\ \hline EWC [17] & MNIST & 81.60\% \\ GEM [14] & MNIST & 92.00\% \\ DEN [21] & MNIST & 96.60\% \\ RCL [20] & MNIST & 96.60\% \\ CLNP [21] & MNIST & 98.42\(\pm\) 0.04 \% \\
**Our DSD-SNN** & MNIST & **97.30\(\pm\) 0.09 \%** \\ HMN(SNN+DNN) [15] & N-MNIST & 78.18\% \\
**Our DSD-SNN** & N-MNIST & **97.06\% \(\pm\) 0.09 \%** \\ \hline \hline \end{tabular}
\end{table}
Table 1: Accuracy of task incremental learning compared to other works for MNIST and N-MNIST datasets.

Figure 4: During the continual learning process of each task, the changes of accuracy with epochs.

Figure 3: The average accuracy with increasing number of tasks. **(a)** Our DSD-SNN for MNIST, N-MNIST and CIFAR100. **(b)** Comparison of our DSD-SNN with other methods for CIFAR100.
the network scale of the model without pruning rises rapidly and quickly fills up the memory capacity, leading to a dramatic drop in performance after learning six tasks. The above results reveal that the pruning process of DSD-SNN not only reduces the computational overhead but also improves the performance and memory capacity.

For the growth module of DSD-SNN, we eliminate the addition of connections from frozen neurons to verify the effectiveness of reusing acquired knowledge in improving learning for new tasks. From Fig. 4(a) and 4(b), DSD-SNN without reused growth suffers from catastrophic forgetting when there is no additional conservation of sub-network masks. The scale of the non-reused network is very small, and the failure to reuse acquired knowledge significantly degrades the performance of the model on each task. Therefore, we can conclude that reusing and sharing acquired knowledge in our DSD-SNN model achieves excellent forward transfer capability.

**Effects of different parameters.** We analyze the effects of different growing and pruning parameters (the growth scale \(\rho\) and pruning intensity \(\rho_{c},\rho_{f}\)). For the growth parameter \(\rho\), the results are very close in the range of 5-15% for MNIST in Fig. 5(a), as well as in the range of 7.5-15% for CIFAR100 in Fig. 5(b). Only in the larger case, there is a performance degradation in the later learning task (8th task), due to the larger growth scale of the previous task resulting in insufficient space to learn new knowledge in the later tasks.

Fig. 5(c) and 4 describe the effects of pruning strength \(\rho_{c}\), \(\rho_{f}\) on performance. The larger \(\rho_{c},\rho_{f}\), the more convolutional channels and fully connected neurons are pruned. We found that the accuracy is very stable at less than \(\rho_{c}=0.50,\rho_{f}=1.00\) for MNIST and \(\rho_{c}=0.75,\rho_{f}=1.25\) for CIFAR100, but the accuracy declines at larger \(\rho_{c},\rho_{f}\) due to the over-pruning. The DSD-SNN model is more adaptable to pruning parameters on the CIFAR100 dataset because it has a larger parameter space of SNN model. These ablation experiments demonstrate that our DSD-SNN is very robust for different growth and pruning parameters across multiple datasets.

## 5 Conclusion

Inspired by the brain development mechanism, we propose a DSD-SNN model based on dynamic growth and pruning to enhance efficient continual learning. Applied to both TIL and CIL scenarios based on the deep SNN, the proposed model can fully reuse the acquired knowledge to help improve the performance and learning speed of new tasks, and combine with pruning mechanism to significantly reduce the computational overhead and enhance the memory capacity. Our DSD-SNN model belongs to the very few explorations on SNNs-based continual learning. The proposed algorithm surpasses the SOTA performance achieved by SNNs-based continual learning algorithm and achieves comparable performance with DNNs-based continual learning algorithms.

\begin{table}
\begin{tabular}{c c c c c} \hline \hline Method & 10steps TIL Acc (\%) & 10steps CIL Acc (\%) & 20steps TIL Acc (\%) & 20steps CIL Acc (\%) \\ \hline EWC [Kirkpatrick _et al._, 2017] & 61.11 \(\pm\) 1.43 & 17.25 \(\pm\) 0.09 & 50.04 \(\pm\) 4.26 & 4.63 \(\pm\) 0.04 \\ MAS [Aljundi _et al._, 2018] & 64.77 \(\pm\) 0.78 & 17.07 \(\pm\) 0.12 & 60.40 \(\pm\) 1.74 & 4.66 \(\pm\) 0.02 \\ PathNet [Fernando _et al._, 2017] & 53.10 & 18.50 & - & - \\ SI [Zenke _et al._, 2017] & 64.81 \(\pm\) 1.00 & 17.26 \(\pm\) 0.11 & 61.10 \(\pm\) 0.82 & 4.63 \(\pm\) 0.04 \\ DEN [Yoon _et al._, 2018] & 58.10 & - & - & - \\ RCL [Xu and Zhu, 2018] & 59.90 & - & - & - \\ icRL [Rebuffi _et al._, 2017] & 84.20 \(\pm\) 1.04 & 51.40 \(\pm\) 0.99 & 85.70 \(\pm\) 0.68 & 47.80 \(\pm\) 0.48 \\ HNET [Yon _et al._, 2020] & 63.57 \(\pm\) 1.03 & & 70.48 \(\pm\) 0.25 & - \\ DER++ [Yan _et al._, 2021] & 84.20 \(\pm\) 0.47 & 55.30 \(\pm\) 0.10 & 86.60 \(\pm\) 0.50 & 46.60 \(\pm\) 1.44 \\ FOSTER [Wang _et al._, 2022] & - & 72.90 & - & 70.65 \\ DyTox [Douillard _et al._, 2022] & - & 73.66 \(\pm\) 0.02 & - & 72.27 \(\pm\) 0.18 \\
**Our DSD-SNN** & **77.92 \(\pm\) 0.29** & **60.47 \(\pm\) 0.72** & **81.17 \(\pm\) 0.73** & **57.39 \(\pm\) 1.97** \\ \hline \hline \end{tabular}
\end{table}
Table 2: Accuracy comparisons with DNNs-based algorithms for CIFAR100.

Figure 5: Effects of each component. Number of network parameters (**a**) and accuracy (**b**) of our DSD-SNN, non-pruned model and non-reused model for CIFAR100.

Figure 6: The effect of pruning and growth parameters on accuracy in multi-task continual learning.
## Acknowledgements

This work is supported by the National Key Research and Development Program (Grant No. 2020AAA0107800), the Strategic Priority Research Program of the Chinese Academy of Sciences (Grant No. XDB32070100), the National Natural Science Foundation of China (Grant No. 62106261).

## Contribution Statement

B.H. and F.Z are equal contribution and serve as co-first authors. B.H., F.Z. and Y.Z. designed the study. B.H., F.Z. W.P. and G.S.performed the experiments and the analyses. B.H., F.Z. and Y.Z. wrote the paper.
