# Drug-Target Affinity Prediction Based on Cross-Modal Fusion of Text and Graph
## 2 Methods
### Explicit Prediction Strategy Based on Multi-Head Collaborative Attention
#### 2.3.2 Functional Mechanism  
First, this study introduces a similarity matrix-based interaction modeling mechanism to explicitly quantify the relationships between drug and protein features. Compared to traditional direct concatenation methods, this mechanism captures both local and global interaction patterns between the two types of features by computing their similarities in a multi-dimensional space. Specifically, let the drug features be denoted as \(\mathbf{D}\in\mathbb{R}^{n_{d}\times d}\) and the protein features as, where \(n_{p}\) and \(n_{d}\) represent the feature dimensions of the drug and protein, respectively, and is the embedding dimension of each feature. By mapping both features into the same embedding space, a similarity matrix is constructed, defined as follows:  
\[\text{S}=\text{softmax}\quad\left(\text{DP}^{\top}\right) \tag{5}\]  
where \(\text{DP}^{\top}\in\mathbb{R}^{n_{d}\times n_{p}}\) represents the inner product similarity between drug and protein features, and the \(\text{softmax}(\cdot)\) function ensures row-wise normalization, allowing each row to reflect the interaction weight distribution between a drug and all protein features. This explicit interaction modeling approach enhances the model's ability to capture potential biochemical associations between drug and protein features, providing a solid foundation for subsequent feature fusion.  
Second, the study employs a multi-head collaborative attention mechanism to achieve efficient feature fusion. Unlike traditional direct concatenation methods, the multi-head collaborative attention mechanism extracts deep interaction relationships between features  
Figure 5: Single guided-attention cross-modal fusion module.  
in parallel across multiple subspaces. Specifically, given the similarity matrix, the multi-head attention mechanism performs weighted aggregation of drug and protein features, expressed as follows:  
\[\mathrm{H^{k}}=\mathrm{softmax(S)PW^{k}} \tag{6}\]  
where \(\mathrm{H^{k}}\in\mathbb{R}^{n_{d}\times d_{k}}\) is the representation of drug features generated by the \(k\)-th attention head, \(W^{k}\in\mathbb{R}^{d\times d_{k}}\) is the learnable parameter matrix for the \(k\)-th attention head, and \(d_{k}\) is the output dimension of each head. The outputs of all attention heads are concatenated to form the fused feature representation:  
\[\mathrm{H}=\left[\mathrm{H^{1}};\mathrm{H^{2}};\ldots;\mathrm{H^{K}}\right] \tag{7}\]  
where \(k\) is the number of attention heads. This mechanism extracts deep interaction information from multiple subspaces, mitigating the risk of missing key information in a single attention head and enhancing the model's representational capacity.  
Based on the above mechanisms, the final fused representation is passed to a fully connected layer for drug-protein affinity prediction. This method effectively addresses the limitations of insufficient feature interaction modeling, achieving fine-grained interaction modeling at the feature level while providing robust theoretical support and biological interpretability for prediction.