## 4 Methodology
### Temporal-Frequency Attention Mechanism
As illustrated in Figure 5, we first apply adaptive average pooling to compress information along the frequency and time axes as follows:  
\[\text{X}_{\text{freq}}=\text{AvgPool}_{f}(\text{X}) \tag{1}\]  
\[\text{X}_{\text{time}}=\text{AvgPool}_{t}(\text{X}) \tag{2}\]  
Here, \(X_{\text{freq}}\in\mathbb{R}^{\mathbb{C}\times T\times 1}\) captures aggregated frequency information at each time step while preserving temporal resolution, which facilitates learning dynamic acoustic changes over time. Conversely, \(X_{\text{time}}\in\mathbb{R}^{\mathbb{C}\times 1\times F}\) encodes the spectral characteristics averaged across time, highlighting frequency-domain patterns often associated with specific sound events. This decoupled design enables the model to independently learn attention across time and frequency axes, avoiding the feature blending issues common in traditional 2D attention. It significantly improves the model's ability to extract meaningful patterns from non-stationary and overlapping urban sounds. Subsequently, the temporal and frequency descriptors are passed through axis-specific attention branches, each composed of a two-layer \(1\times 1\) convolutional bottleneck network. The first layer reduces the channel dimension to highlight salient patterns, while the second restores it. The attention weights are computed as follows:  
\[\text{A}_{\text{freq}}=\sigma\Big{(}\text{W}_{f}^{(2)}\cdot\text{ReLU}\Big{(} \text{W}_{f}^{(1)}\cdot\text{X}_{\text{freq}}\Big{)}\Big{)} \tag{3}\]  
\[\text{A}_{\text{freq}}=\sigma\Big{(}\text{W}_{t}^{(2)}\cdot\text{ReLU}\Big{(} \text{W}_{t}^{(1)}\cdot\text{X}_{\text{time}}\Big{)}\Big{)} \tag{4}\]  
where \(\text{A}_{\text{freq}}\in\mathbb{R}^{\mathbb{C}\times T\times 1}\) and \(\text{A}_{\text{time}}\in\mathbb{R}^{\mathbb{C}\times 1\times F}\) represent the learned importance maps along the temporal and frequency dimensions, respectively. Here, \(\sigma\) denotes the Sigmoid activation function. \(\text{W}_{f}^{(1)},\text{W}_{t}^{(1)}\in\mathbb{R}^{\mathbb{C}\times\hat{ \mathbb{F}}}\), and \(\text{W}_{f}^{(2)},\text{W}_{t}^{(2)}\in\mathbb{R}^{\mathbb{C}/r\times C}\) are learnable parameters of the frequency and temporal branches, with r as the channel reduction ratio. The ReLU introduces non-linearity, and Sigmoid normalizes the attention maps to the range [0, 1]. These attention maps, as depicted in the lower part of Figure 5, encode the importance of temporal and spectral regions separately. This enables the model to focus selectively on \"when\" and \"where in the spectrogram crucial acoustic information occurs--enhancing its capability to process complex, overlapping urban sounds. These maps are broadcasted along their respective dimensions and applied to the original input through element-wise multiplication as follows:  
\[X^{\prime}=X\odot A_{\text{freq}}\odot A_{\text{time}} \tag{5}\]  
where \(\odot\) denotes Hadamard product. This operation adaptively enhances salient regions in both temporal and frequency dimensions, enabling the model to focus on important spectro-temporal structures while suppressing background noise. As shown in Figure 5, this dual-branch design ensures that temporal and spectral saliency are independently learned and fused in a parallel manner, reducing mutual interference during training.