## 2 Materials and Methods
### The Self-Attention Mechanism  
In previous work, the attention mechanism has not been widely applied to SNNs, and we have found that in scene segmentation [28], image recognition [29] and other applications. An event camera optical flow and depth estimation framework based on spatial coding and self-attention mechanism has been shown to emphasize on the location of events, there by achieving more accurate results [21]. In our previous work [20], cross-cross attention and temporal-wise attention mechanisms were introduced to connect, pixels and significantly enhance optical flow prediction accuracy. This study combines CBAM with SNNs to improve object detection performance, owing to its effectiveness in capturing feature correlations across different dimensions. The CBAM consists of the channel attention module and the spatial attention module, as illustrated in Figure 4.  
Figure 3: (**a**) A LIF neuron with membrane potential \(V\), membrane time constant \(\tau\), input \(l(t)\) and synaptic weight \(w\). (**b**) The membrane potential \(V\) of the LIF neuron when constant input is received. Increasing or decreasing \(\tau\) will stretch the \(v=f(t)\) curve in the \(t\) direction while increasing or decreasing \(w\) will stretch the \(v=f(t)\) curve in the \(V\) direction. Figure 5 shows the channel attention module, which processes the input feature map by applying both max-pooling and average-pooling operations. For an input feature map with dimensions \((B,C,H,W)\), these pooling operations compress the spatial information of each channel (C) into a single value, resulting in an output of shape \((B,C,1,1)\). This compression captures global spatial information for each channel, aiming to consolidate the feature map's information at the channel level and thereby improve the network's ability to capture relevant features. Overall, the channel attention [25] is computed as:  
\[ \begin{split}\text{M}_{\text{c}}(\text{F})&= \sigma(MLP\big{(}\text{AvgPool}(\text{F})\big{)}+MLP(\text{MaxPool}(\text{F}))) \\ &=\sigma\Big{(}\text{W}_{1}\Big{(}\text{W}_{0}\Big{(}\text{F}_{ \text{avg}}^{\text{c}}\Big{)}+\text{W}_{1}(\text{W}_{0}(\text{F}_{\text{max}}^ {\text{c}}))\Big{)}\end{split}  \tag{4}\]  
where \(\sigma\) denotes the sigmoid function, \(\text{W}_{0}\in\mathbb{R}^{C/r\times C}\), and \(\text{W}_{1}\in\mathbb{R}^{C\times C/r}\). Notably the MLP weights, \(\text{W}_{0}\) and \(\text{W}_{1}\), are shared for both inputs and the ReLU activation function is follows \(\text{W}_{0}\). The spatial attention module (Figure 5) uses average- and max-pooling along the channel axis to process the input feature map. These pooling processes reduce the channel dimension (C) to a single feature map with dimensions \((B,1,H,W)\). This approach combines global channel information into a single channel feature map, reducing the number of parameters and computational complexity while keeping key channel properties. Overall, spatial attention [25] is computed as follows:  
\[ \begin{split}\text{M}_{\text{s}}(\text{F})&= \sigma\Big{(}f^{7\times 7}([\text{AvgPool}(\text{F});\text{MaxPool}(\text{F})]) \Big{)}\\ &=\sigma\Big{(}f^{7\times 7}\Big{(}\Big{[}\text{F}_{\text{avg}}^ {\text{s}};\text{F}_{\text{max}}\Big{]}\Big{)}\Big{)}\end{split}  \tag{5}\]  
where \(\sigma\) denotes the sigmoid function and \(f^{7\times 7}\) represents \(a\) convolution operation with the filter size of \(7\times 7\). \(\text{F}_{\text{avg}}^{\text{s}}\in\mathbb{R}^{1\times H\times W}\) and \(\text{F}_{\text{max}}^{\text{s}}\in\mathbb{R}^{1\times H\times W}\) is the 2D feature map aggregate using two pooling operations. Figure 4: The overview of CBAM. There are two consecutive sub-modules in this module: channel and spatial. The input image is successively passed through the channel attention module (green squares) and the spatial attention module (purple squares), resulting in an refined feature map. Figure 5: A diagram of each attention sub-module.