Views
No views yet
"The Beast" - A 4096-width Deep Residual Network trained on 2x Tesla T4 GPUs with a batch size of 24,576.
| Metric | Score | Notes |
|---|---|---|
| PR-AUC | 0.8163 | Area Under Precision-Recall Curve (Critical for imbalance) |
| ROC-AUC | 0.9746 | Area Under Receiver Operating Characteristic |
| Precision | High | Minimizes false positives (blocking valid cards) |
| Recall | High | Catches the majority of fraud cases |
.pt file provided here is the primary Supervised Classifier).Classifier.pt)Mish (Self Regularized Non-Monotonic).Autoencoder.pt)lr=1e-3 with OneCycleLR Warmup).QuantileTransformer (Output distribution: Normal/Gaussian).BorderlineSMOTE (Ratio 1:1) used during training to force learning of hard decision boundaries.1import torch
2import torch.nn as nn
3import torch.nn.functional as F
4
5# 1. Define the Architecture
6class GaussianNoise(nn.Module):
7 def __init__(self, sigma=0.05):
8 super().__init__()
9 self.sigma = sigma
10 def forward(self, x):
11 if self.training: return x + torch.randn_like(x) * self.sigma
12 return x
13
14class Mish(nn.Module):
15 def forward(self, x): return x * torch.tanh(F.softplus(x))
16
17class ResBlock(nn.Module):
18 def __init__(self, dim, dropout=0.2):
19 super().__init__()
20 self.norm1 = nn.BatchNorm1d(dim)
21 self.act1 = Mish()
22 self.fc1 = nn.Linear(dim, dim)
23 self.drop1 = nn.Dropout(dropout)
24 self.norm2 = nn.BatchNorm1d(dim)
25 self.act2 = Mish()
26 self.fc2 = nn.Linear(dim, dim)
27 self.drop2 = nn.Dropout(dropout)
28 def forward(self, x):
29 res = x
30 x = self.norm1(x)
31 x = self.act1(x)
32 x = self.fc1(x)
33 x = self.drop1(x)
34 x = self.norm2(x)
35 x = self.act2(x)
36 x = self.fc2(x)
37 x = self.drop2(x)
38 return x + res
39
40class ResNetClassifier(nn.Module):
41 def __init__(self, input_dim=62): # Default input dim from engineering
42 super().__init__()
43 self.noise = GaussianNoise(0.05)
44 self.proj = nn.Linear(input_dim, 4096)
45 self.blocks = nn.Sequential(
46 ResBlock(4096, 0.4), ResBlock(4096, 0.4),
47 ResBlock(4096, 0.3), ResBlock(4096, 0.3),
48 ResBlock(4096, 0.2), ResBlock(4096, 0.2)
49 )
50 self.bottleneck = nn.Sequential(
51 nn.BatchNorm1d(4096), Mish(),
52 nn.Linear(4096, 512), Mish()
53 )
54 self.head = nn.Linear(512, 1)
55
56 def forward(self, x):
57 x = self.noise(x)
58 x = self.proj(x)
59 x = self.blocks(x)
60 x = self.bottleneck(x)
61 return self.head(x).squeeze()
62
63# 2. Load the Model
64device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
65model = ResNetClassifier(input_dim=62)
66
67# Download 'Classifier.pt' from this repo
68model.load_state_dict(torch.load("Classifier.pt", map_location=device))
69model.to(device)
70model.eval()
71
72print("✅ Model loaded successfully!")