This project implements a Graph Neural Network (GNN) using PyTorch Geometric and PyTorch Lightning to solve the TrackML Particle Identification Challenge. The goal is to reconstruct particle tracks by classifying edges between hits in a 3D detector space.
The model has completed training for 5 epochs. Below is the performance summary from the latest validation run:
| Metric | Value | Interpretation |
|---|---|---|
| Accuracy | 54.98% | Percentage of correct edge classifications. |
| Recall | 59.73% | Percentage of real tracks successfully found. |
| Precision | 2.69% | Accuracy of the model when it predicts a "real" track. |
| F1-Score | 5.16% | Harmonic mean of Precision and Recall. |
NOTE : The
val_lossreported asnan. This indicates numerical instability during training which must be addressed to improve results.
A memory-efficient GNN designed to fit within 15GB of VRAM:
-
GNN Layers: 3x
TransformerConvlayers with multi-head attention (2 heads). -
Memory Management: Utilized
16-mixedprecision and gradient accumulation (accumulate_grad_batches=2). -
Graph Construction: KNN-based graph building (
$k=8$ ) to limit the combinatorial explosion of edges.
To move beyond the current 5% F1-score and fix the nan loss, the following strategies should implemented
The nan loss occurs when gradients "explode" or values become too large for the floating-point range.
- Reduce Learning Rate: Lower the current
1e-3to1e-4or5e-5to allow for more stable convergence. - Stricter Gradient Clipping: Change
gradient_clip_valfrom1.0to0.5in the Trainer. - Layer Normalization: Add
torch.nn.LayerNormbetween theTransformerConvlayers to keep feature scales consistent.
In TrackML, "Fake" edges outnumber "Real" edges by roughly 1000:1. The model currently over-predicts tracks, resulting in low Precision.
- Weighted Loss: Use
BCEWithLogitsLoss(pos_weight=torch.tensor([50.0])). This forces the model to treat missing a real track as a much larger error than misclassifying a fake one. - Hard Negative Mining: Train only on a subset of the most "