Introduction
Graph Neural Networks (GNNs) have become a cornerstone of modern machine learning for structured data. However, their reliability is often compromised when they encounter Out-Of-Distribution (OOD) data—samples that deviate significantly from the training distribution. Detecting these anomalies in an unsupervised manner is critical for safety and robustness in real-world applications like drug discovery and fraud detection.
Current unsupervised OOD detection methods are primarily hindered by two issues. First, real-world graphs often contain significant "noise"—edges or features that do not contribute to the graph's semantic identity. Second, standard data augmentation techniques, such as random edge dropping, can be "harmful" by destroying the very structural patterns the model needs to learn.
SEGO: Structural Entropy Guided Graph Contrastive Learning
To overcome these challenges, we introduce SEGO, a framework that utilizes structural entropy to extract the "substantive information" of a graph. By focusing on the essential skeleton of the data, SEGO builds a cleaner, more robust representation of "normal" (In-Distribution) data.
The Coding Tree Anchor
The central innovation of SEGO is the use of Structural Entropy, a concept from information theory that quantifies the complexity of a graph's structure. By minimizing this entropy, SEGO constructs a hierarchical "coding tree." This tree serves as a denoised abstraction of the graph, preserving essential community structures while filtering out redundant information.
Triplet-View Contrastive Learning
SEGO moves beyond simple dual-view contrastive learning by employing a triplet-view architecture:
- Basic View: The original graph.
- Anchor View: The coding tree, which acts as a structural "ground truth" for the essential features.
- Topological View: A version enhanced with random walk and Laplacian positional encodings, capturing spatial relationships without the need for destructive stochastic augmentations.
The framework employs multi-grained contrastive learning, checking for agreement at the node (local), graph (global), and tree levels. A self-adaptive loss function automatically balances these levels based on prediction error variance during training.
Experimental Results and Insights
The authors evaluated SEGO across 10 OOD dataset pairs from TUDataset and OGB, as well as 5 anomaly detection benchmarks. SEGO achieved state-of-the-art performance in 9 out of 10 OOD pairs, with an average AUC improvement of 3.7% over the previous best method, GOOD-D.
As shown in the figure above, the structural entropy minimization process significantly improves the separation between ID and OOD score distributions. Before minimization, the distributions overlap considerably, making detection difficult. After minimization, the OOD scores for anomalous samples are clearly shifted, allowing for more accurate classification.
A standout result was observed on the FreeSolv/ToxCast molecular dataset pair, where SEGO outperformed its closest competitor by 10.8%. This suggests that the coding tree approach is particularly effective at capturing the complex hierarchical structures inherent in chemical compounds.
Conclusion
SEGO demonstrates that effective OOD detection is as much about "forgetting" redundant noise as it is about learning relevant features. By using structural entropy as a principled guide for denoising, SEGO provides a robust, theoretically grounded approach to unsupervised graph anomaly detection. Future work will look to extend these hierarchical abstractions to better handle the extreme density of social network graphs.
Summary updated