# A Novel Deep Learning Method for Predicting RNA-Protein Binding Sites
## 2 Materials and Methods
### DiffPool in HPNet  
Various tools can be used to produce graphical representations of RNA secondary structures. Previous studies have employed CNNs or GNNs to aggregate the entire graph information directly, but they ignored the complex hierarchical relationships that may exist between each node. Therefore, this research employed DiffPool for the learning of RNA secondary structure information. DiffPool is a differentiable and end-to-end multilayer GNN model. As shown in Figure 3, in the first layer, structurally adjacent nucleotides within the same double-stranded stem or unpaired loop region were clustered into a single node in the coarsened graph of the next layer. Information extraction and node aggregation were then performed in each layer to produce a coarsening graph for the next layer. By aggregating the multilayer network, a node was obtained that represented the entire graph structure. The layer \(l\) network in this experiment can be expressed as follows:  
\[\text{Z}^{(l)}=\text{GNN}\Big{(}\text{A}^{(l)},\text{X}^{(l)}\Big{)} \tag{4}\]  
\[\text{A}^{(l+1)},\text{X}^{(l+1)}=\text{DiffPool}\Big{(}\text{A}^{(l)},\text{Z} ^{(l)}\Big{)} \tag{5}\]  
where \(A\) is the predicted adjacency matrix and \(\text{A}\in\mathbb{R}^{n\times n}\), \(X\) is the input matrix and \(\text{X}\in\mathbb{R}^{n\times d}\), and \(Z\) represents the features learned by the GNN in the graph and \(\text{Z}\in\mathbb{R}^{n\times d}\)  
Figure 3: Structure diagram of the DiffPool model. In the DiffPool model, nodes of the same color overlaying the previous layer of the graph structure are aggregated into nodes of the same color in the next layer of the graph to form a coarsening graph. DiffPool generally consists of two operations. The first employs two GNNs to extract features and learn the distribution of the node weight matrix, respectively. The distribution of nodes in the next layer is determined according to the node weight matrix. The two GNNs use similar methods. \[Z^{(\mathrm{I})}=\mathrm{GNN}_{\mathrm{l,embed}}\Big{(}\mathrm{A}^{(\mathrm{I}) },\mathrm{X}^{(\mathrm{I})}\Big{)} \tag{6}\]  
\[S^{(\mathrm{I})}=\mathrm{softmax}\Big{(}\mathrm{GNN}_{\mathrm{l,pool}}\Big{(} \mathrm{A}^{(\mathrm{I})},\mathrm{X}^{(\mathrm{I})}\Big{)}\Big{)} \tag{7}\]  
The second operation is the aggregation of nodes according to the node weight matrix, which can be written mathematically as follows:  
\[\mathrm{X}^{(\mathrm{I}+1)}=S^{(\mathrm{I})}{}^{\mathrm{T}}Z^{(\mathrm{I})} \leavevmode\
obreak\ \in\mathbb{R}^{n_{\mathrm{I}+1}\times\mathrm{d}} \tag{8}\]  
\[\mathrm{A}^{(\mathrm{I}+1)}=S^{(\mathrm{I})}{}^{\mathrm{T}}A^{(\mathrm{I})}S^ {(\mathrm{I})}\leavevmode\
obreak\ \in\mathbb{R}^{n_{\mathrm{I}+1}\times n_{\mathrm{I}+1}} \tag{9}\]  
This experiment used a GCN for the initial GNN layer, while GraphSAGE [40] was used for the remaining GNN. The information transfer equation for the GCN algorithm can be expressed as follows. \[H^{(\mathrm{k})}=M\Big{(}A,H^{(\mathrm{k}-1)};W^{(\mathrm{k})}\Big{)}=\mathrm{ ReLU}\bigg{(}\widetilde{D}^{-\frac{1}{2}}\widetilde{A}\widetilde{D}^{-\frac{1}{2}}H^{( \mathrm{k}-1)}W^{(\mathrm{k}-1)}\bigg{)} \tag{10}\]  
where H denotes the input matrix and k denotes the k-th layer network. DiffPool is a non-convex optimization model. Two regularization terms are added to the model to prevent the model from falling into the local minimum, which can be written as follows. \[L_{\mathrm{LP}}=\left\|A^{(\mathrm{I})},S^{(\mathrm{I})}S^{(\mathrm{I})}{}^{ \mathrm{T}}\right\|_{\mathrm{F}} \tag{11}\]  
\[L_{\mathrm{E}}=\frac{1}{n}\sum_{\mathrm{i=1}}^{n}H(S_{\mathrm{i}}) \tag{12}\]  
The first regularization term can assist the link in predicting the target. It minimizes \(L_{\mathrm{LP}}\) and continuously corrects \(S^{(\mathrm{I})}\), ensuring that two highly similar nodes are mapped to the same coarsening node. The second regularization term reduces the uncertainty of the mapping distribution to ensure that each node is assigned to a coarsening node.