## 5 Experimentation Process
### Graph Deep Learning  
Both Graph Convolutional Networks (GCNs) and Graph Attention Networks (GATs) have shown excellent performance when applied to traditional supervised learning tasks on cryptocurrency transactions and more specifically on the Elliptic dataset, as stated in previous related works. Following this approach, this section of the experiments aimed to test a recent state-of-the-art model that can leverage the heterogeneous nature of the Elliptic++ dataset. The Heterogeneous Graph Transformer (HGT) [18] is a novel deep learning framework designed for heterogeneous graphs that combines the ideas of conventional GNNs with the Transformer [45] architecture, using different mutual attention mechanisms depending on the graph node type. This complex architecture can be used to manage different attention coefficients and weights for each node type in the Elliptic++ dataset, namely, transactions and wallets. In order to carry out the experiments with this framework, an HGT Binary Classifier model was developed specifically for this case, using a linear transformation that projected the feature vectors into the embedding space and a series of HGT convolutional layers, followed by Leaky ReLU activation functions. Finally, another linear transformation was applied to obtain an output logit. The parameters for this model that were used in the experiment are displayed in Table 2.  
As described in Section 4.3, a mini-batch training strategy was applied to fit the complex architecture of the HGT model into the CUDA device memory. The subgraphs corresponding to each timestep in the dataset were used as individual units for batching. In addition, the feature matrices of both transactions and wallets were normalized in advance. For the training phase, an Adam optimizer was utilized with a custom loss function that aimed to minimize the loss of both transactions and wallets, taking into account a custom parameter, \(\beta\), used to balance both loss functions, as shown in the following formula:  
\[L=\beta\cdot L_{wallet}+(1-\beta)\cdot L_{tnx} \tag{2}\] \begin{table}
\begin{tabular}{l c} \hline \hline
**Model Parameter** & **Value** \\ \hline Embedding dimension & 128 \\ Number of message-passing layers & 2 \\ Number of attention heads & 4 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The parameters for the HGT classifier. Both transaction and wallet loss functions consisted of a binary cross entropy loss with a custom positive weight that helped with the class imbalance. Additionally, to deal with the class imbalance differences between timesteps previously analyzed in Section 5.1, a stratified train/test split strategy was applied to the dataset. All the parameters used during the training phase can be found in Table 3.  
Figure 19 illustrates the evolution of the binary cross entropy loss of both wallets and transactions and the combined loss function throughout the 600 epochs of training. This plot shows an irregular decreasing trend with numerous fluctuations in most loss functions, typical of batch training in which gradients are computed for each batch. Finally, the results of the experiments are displayed in Figures 20 and 21 with the confusion matrices and ROC curves of both wallets and transactions. Additionally, Table 4 summarizes the evaluation metrics of this experiment for both node types in the graph. \begin{table}
\begin{tabular}{l c c c c c c c c} \hline \hline \multirow{2}{*}{**Node Type**} & \multicolumn{2}{c}{**Precision**} & \multicolumn{2}{c}{**Recall**} & \multicolumn{2}{c}{**F1 Score**} & \multirow{2}{*}{**Accuracy**} & \multirow{2}{*}{**ROC-AUC**} \\  & **Licit** & **Illicit** & **Licit** & **Illicit** & **Licit** & **Illicit** & \\ \hline Wallets & 0.94 & 0.23 & 0.92 & 0.27 & 0.93 & 0.25 & 0.87 & 0.812 \\ Transactions & 0.96 & 0.63 & 0.96 & 0.61 & 0.96 & 0.62 & 0.93 & 0.892 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: The performance metrics of the HGT classifier experiment. Figure 19: Loss functions during HGT model training.