## 3 Materials and Methods
### Model Architecture
#### 3.2.2 Bidirectional Cross-Attention for Local Alignment  
To address the inherent challenge of the cross-modal semantic gap in multimodal disaster tweet analysis, we introduce the bidirectional cross-attention (BCA) module. This module is meticulously designed to enable fine-grained, bidirectional semantic alignment between image and text features, leveraging symmetric attention pathways. The comprehensive design and theoretical underpinnings are elaborated as follows:  
1. Fundamental Bidirectional Attention Paradigm The BCA module operates on a dual-flow attention mechanism, which is pivotal for capturing bidirectional semantic associations: Image \(\rightarrow\) Text (I \(\rightarrow\) T) Attention: In this pathway, image features are designated as the Query. The query, encoding the visual semantics, attends to the textual features acting as key and value vectors. By doing so, it seeks to align visual content with textual descriptions, enabling the extraction of textually relevant visual cues. Text \(\rightarrow\) Image (T \(\rightarrow\) I) Attention: Conversely, text features take on the role of Query here, while image features act as Key and Value. This flow facilitates the projection of textual semantics onto the visual domain, allowing for the identification of visually relevant elements corresponding to the text. 2. Multi-Head Attention Architecture for Fine-Grained Interaction A multi-head attention mechanism, featuring 16 attention heads with a head dimension of 48, is employed to dissect and model the fine-grained interactions between image and text features. For the Image \(\rightarrow\) Text (I \(\rightarrow\) T) attention process, let \(v_{i}\in\mathbb{R}^{512}\) denote the image feature vector and \(v_{t}\in\mathbb{R}^{512}\) represent the text feature vector. \(W_{i}^{Q}\in\mathbb{R}^{512\times 768},W_{t}^{K}\in\mathbb{R}^{512\times 768}\), and \(W_{t}^{V}\in\mathbb{R}^{512\times 768}\) are the projection matrices. These \(512\times 768\) matrices transform 512-dimensional inputs into 768-dimensional spaces, which aligns with the multi-head attention setup (16 heads \(\times\) 48 dimensions per head = 768 total dimensions). This transforms the input vectors into the Query, Key, and Value sub-spaces, respectively. The sequential operations are as follows: (a) Query/Key/Value Projection: The initial step involves projecting the input image and text vectors into the attention subspaces (Equation (4)): \[\left\{ \begin{array}{ll}Q_{i}=v_{i}W_{i}^{Q}\\ K_{i}=v_{t}W_{t}^{K}\\ V_{i}=v_{t}W_{t}^{V}\end{array} \right.\] (4) Here, \(Q_{i}\) projects image features to query space, while \(K_{i}\) and \(V_{i}\) map text features to key/value spaces, enabling visual features to \"attend to\" relevant text tokens (e.g., aligning \"flood\" to water regions in images). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Symbol** & **Dimension** & **Description** \\ \hline \(\text{E}_{\text{text}}\) & 49,408 \(\times\) 768 & Text token embedding matrix \\ \(\text{E}_{\text{pos}}\) & 77 \(\times\) 768 & Position encoding matrix \\ \(\text{H}_{0}\) & 77 \(\times\) 768 & Initial text embedding (token + position encoding) \\ Q, K, V & 768 \(\times\) 768 & Query/Key/Value matrices for Transformer multi-head attention \\ A & batch \(\times\) 12 \(\times\) 77 \(\times\) 77 & Attention weight matrix \\ Attn & batch \(\times\) 77 \(\times\) 768 & Output of multi-head attention \\ patch & 49 \(\times\) 768 (7 \(\times\) 7 patches) & Image patch embedding vector \\ text & 512D & Projected text feature vector \\ image & 512D & Projected image feature vector \\ fused & 1024D & Concatenated text-image feature vector \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Variable descriptions of the CLIP model. (b) Multi-Head Reshaping: To enable parallel attention computation across multiple heads, the projected tensors are reshaped. This reshaping operation reorganizes the dimensions to support independent attention calculations for each head (Equation (5)):  
\[\left\{