Skip to main content
. 2026 Aug 2;26(15):4877. doi: 10.3390/s26154877
Algorithm 1 Training Algorithm of SAD-SNN
Input: Dataset D.
Model: Teacher ANN model MANN(x;WANN) with pretrained weights WANN; Student SNN model MSNN(x;WSNN) with initial weights WSNN.
Parameter: Time steps T; Layer alignment set I; Distillation loss weight α; Learning rate η; Training epoch E.
Output: Trained student SNN model MSNN(x;WSNN).
 1: for  epoch=1  to  E  do
 2:     for x, y in D do
 3:         AT=MANN(x); ▹ forward propagation
 4:         AS,y^=MSNN(x);
 5:         AS′=AvgPoolT(AS); ▹ calculate spatial-activation maps
 6:         calculate ST and SS′ based on AT and AS′ using (4);
 7:         calculate Ldistill_SAD based on ST and SS′
 8:                               using layer pairs (l,l′)∈I via (5); ▹ calculate Ldistill_SAD
 9:         calculate task-specific loss based on y and y^; ▹ calculate Ltask
 10:          calculate Ltotal based on Ltask and Ldistill_SAD using (6); ▹ calculate Ltotal
 11:          calculate the gradients ∂Ltotal∂WSNN; ▹ backward propagation
 12:          update WSNN; ▹ update weights
 13:      end for
 14:  end for