A multilayer perceptron (MLP) is a feedforward neural network that transforms transaction features through fully connected layers to predict licit or illicit activity. For Bitcoin fraud detection, it treats each transaction independently and provides a practical baseline before models that use graph relationships. section 9.1.4 section 9.5
A feature-only MLP workflow includes:
- Feed each transaction’s 165 features into a fully connected layer producing eight intermediate features. section 9.2.1
- Apply a ReLU activation and dropout, then pass the result to a second fully connected layer producing two class outputs. section 9.2.1
- Train with cross-entropy loss, Adam, learning rate 0.01, weight decay 0.0001, and 1,000 epochs. section 9.2.3
- Evaluate predictions with accuracy and weighted F1, since accuracy alone can conceal performance problems in imbalanced classes. section 9.2.3
Elliptic Bitcoin transaction baseline
A PyTorch MLP can map 165 transaction features to eight hidden features and then two outputs for licit and illicit classes. After training, the demonstrated model reaches 0.9328 test accuracy and a 0.9377 F1 score. These results provide a reference point for graph models that additionally use payment connections. section 9.2.1 section 9.2.3 section 9.5
class MLP(torch.nn.Module):
def __init__(self, hidden_channels):
super().__init__()
torch.manual_seed(12345)
self.lin1 = Linear(dataset.num_features, hidden_channels)
self.lin2 = Linear(hidden_channels, dataset.num_classes)
def forward(self, x):
x = self.lin1(x)
x = x.relu()
x = F.dropout(x, p=0.5, training=self.training)
x = self.lin2(x)
return x
Inspect the compact PyTorch class defining the two linear layers, ReLU activation, dropout, and forward pass. section 9.2.1



