## 3 Pruning Methodology
### Pruning Algorithm
During this process, the algorithm scans through each layer (Line 6) and temporarily prunes a small set of filters (\(N_{i+1}\times\alpha_{s}\)) in order to generate the set of candidate pruned models \(\mathcal{W}^{*(i)}\) (Line 9). For each layer, we limit the maximum number of pruning filters to \(N_{i+1}\times\alpha_{max}\) (Line 7) to avoid excessive pruning from a single convolution layer. Similarly, if the current FLOPs reduction rate is in the range from \(\mathcal{P}\times w_{mag}\) to \(\mathcal{P}\) (Line 12), the filter similarity based pruning (Line 13-18) is used to generate set of candidate pruned models. Now, for the current pruning iteration, the pruned model that has minimal accuracy loss among candidates is selected (Line 20) and pruning is made permanent. In order to prevent the large accuracy drop during pruning, after each \(\beta_{\mathcal{P}}\) FLOPs reduction rate, the pruned model will be fine-tuned for a small number of epochs (\(epoch_{ft}\)) (Line 22). Once desired pruning rate is achieved, the pruned model will be retrained for several epochs (\(epoch_{rtend}-epoch_{rtstart}\)) to get the final pruned model (Line 27). ```
0: training data (\(\mathcal{D}\)), pretrained model (\(\mathcal{W}\))
1:Given: target FLOPs reduction rate (\(\mathcal{P}\)), step pruning rate (\(\alpha_{s}\)), max pruning rate (\(\alpha_{max}\)), weighted for magnitude criteria (\(w_{mag}\)), fine-tune FLOPs reduction interval (\(\beta_{\mathcal{P}}\)), number of finetune epochs during pruning (\(epoch_{ft}\)), final retrain start epoch number (\(epoch_{rtstart}\)), final retrain end epoch number (\(epoch_{rtend}\))
2:Initialization:\(\mathcal{W}^{\prime}\leftarrow\mathcal{W}\), \(\mathcal{P}^{\prime}\leftarrow\mathcal{0}\), \(\mathcal{P}^{\prime}_{temp}\gets 0\)
3:Randomly sample dataset \(\mathcal{D}^{\prime}\) from \(\mathcal{D}\)
4:while\(\mathcal{P}^{\prime}<\mathcal{P}\)do
5:if\(\mathcal{P}^{\prime}\leq\mathcal{P}\times w_{mag}\)then
6:for\(i\gets 1\) to L do
7:if\(N^{\prime}_{i+1}\geq N_{i+1}\times\alpha_{max}\)then
8: Calculate magnitude of filters using Equation (1) in \(\mathcal{W}^{\prime(i)}\)
9:\(\mathcal{W}^{*(i)}\leftarrow\text{Prune }N_{i+1}\times\alpha_{s}\) filters with lowest magnitude values
10:endif
11:endfor
12:else
13:for\(i\gets 1\) to L do
14:if\(N^{\prime}_{i+1}\geq N_{i+1}\times\alpha_{max}\)then
15: Calculate similarity score of filters using Equation (5) in \(\mathcal{W}^{\prime(i)}\)
16:\(\mathcal{W}^{*(i)}\leftarrow\text{Prune }N_{i+1}\times\alpha_{s}\) filters with highest similarity scores
17:endif
18:endfor
19:endif
20:\(\mathcal{W}^{\prime}\leftarrow\underset{\mathcal{W}^{\prime(i)}}{\text{arg min}}(Loss(\mathcal{D}^{\prime}|\mathcal{W}^{*(i)})\)
21: Calculate \(\mathcal{P}^{\prime}\) using Equation (6)
22:if\(\mathcal{P}^{\prime}-\mathcal{P}^{\prime}_{temp}\geq\beta_{\mathcal{P}}\)then
23: Fine-tune \(\mathcal{W}^{\prime}\) to recover weights (\(epoch\gets 1\) to \(epoch_{ft}\))
24:\(\mathcal{P}^{\prime}_{temp}\leftarrow\mathcal{P}^{\prime}\)
25:endif
26:endwhile
27:Re-train \(\mathcal{W}^{\prime}\) until convergence (\(epoch\gets epoch_{rtstart}\) to \(epoch_{rtend}\))
28:pruned model (\(\mathcal{W}^{\prime}\))
```  
**Algorithm 1** Algorithm of MSVFP