# Anomaly Detection in Dynamic Graphs via Transformer

Transformer를 이용한 동적 그래프의 이상 탐지

Yixin Liu, Shirui Pan, Yu Guang Wang, Fei Xiong, Liang Wang, Qingfeng Chen 외 1명 · arXiv · 2021년 6월 18일

- **연구 문제** 동적 그래프의 이상 엣지 탐지는 원시 노드 속성이 부족하고, 구조와 시간 정보가 얽혀 있어 기존 분리형 딥러닝 방법으로 어렵습니다.
- **연구 방법** TADDY는 엣지 기반 부분구조 샘플링, 확산·거리·상대 시간을 합친 노드 인코딩, 단일 트랜스포머 인코더, 네거티브 샘플링 기반 이상 탐지기를 종단간으로 학습합니다.
- **주요 결과** 저자들은 여섯 데이터셋과 1%, 5%, 10% 이상 비율에서 TADDY가 기준 방법보다 높은 평균 ROC-AUC를 보였다고 보고하며, 최고 기준 방법 대비 평균 4.49% 향상을 제시합니다.

## 동적 그래프 이상 탐지의 두 가지 어려움

동적 그래프에서 이상 엣지를 찾는 일은 소셜 네트워크, 전자상거래, 사이버 보안처럼 엣지가 시간에 따라 생기고 바뀌는 상황에서 중요합니다. 원문은 이 문제의 핵심 어려움으로 두 가지를 제시합니다. 첫째는 원시 노드 속성이 없거나 접근할 수 없는 경우가 많아, 노드의 구조적 역할과 시간적 상태를 담는 인코딩을 따로 만들어야 한다는 점입니다. 둘째는 구조 정보와 시간 정보가 서로 얽혀 있어, 두 정보를 함께 고려해야 올바른 판단이 가능하다는 점입니다.

![Figure 1: A toy example to illustrate how the coupled information affects the detection of edges’ legality. The three graphs are a fragment from a dynamic grap…](https://refivu.com/papers/753e83eb-ff24-44ce-9097-3fa4ff681eb0/figures/figure-101b67d10ea2795e596efd00c5ae412b.png?thumb=512)

**Fig. 1** . A toy example to illustrate how the coupled information affects the detection of edges’ legality. The three graphs are a fragment from a dynamic graph stream at a sequential timeline {t1,t 2,t 3}. The solid green line represents a normal edge at t3, while the red dash line indicates an anomalous edge. We highlight the corresponding nodes in the previous timestamps with colors.

[원문](https://arxiv.org/abs/2106.09876v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yixin Liu, Shirui Pan, Yu Guang Wang, Fei Xiong, Liang Wang, Qingfeng Chen, Vincent CS Lee · Anomaly Detection in Dynamic Graphs via Transformer · 원문 그림 인용 · 원본 PDF 2쪽에서 그림 영역을 추출했습니다.

기존 딥러닝 방법들은 원-핫 식별자나 무작위 초기화 특징을 쓰거나, 공간 모듈과 시간 모듈을 따로 두어 두 정보를 분리해 처리하는 경우가 많습니다. 이 논문은 이러한 분리 처리가 얽힌 공간-시간 특징을 놓쳐 최적이 아닌 해로 이어질 수 있다고 봅니다. 따라서 질문은 노드 인코딩을 어떻게 구성하고, 단일 트랜스포머로 두 정보를 함께 학습할 수 있는지로 좁혀집니다.

## TADDY의 부분구조 샘플링과 노드 인코딩

TADDY는 각 엣지를 대상 엣지로 두고, 대상 노드 주변의 문맥 노드를 샘플링해 부분구조를 만듭니다. 문맥 노드는 그래프 확산 행렬 S의 연결성 점수로 고르며, 대상 노드 자체를 제외한 상위 k개를 선택합니다. 확산의 대표 예로 원문은 PPR과 열 커널을 들고, 실험에는 PPR 확산을 사용합니다. 여러 타임스탬프에 대해서는 슬라이딩 윈도 τ만큼 같은 샘플링을 반복하고 노드 집합을 합칩니다.

노드 인코딩은 세 항의 합으로 구성됩니다. 확산 기반 공간 인코딩은 확산 값의 순위를 선형 사상으로 바꾸어 전역 구조 역할을 나타냅니다. 거리 기반 공간 인코딩은 대상 엣지의 두 노드까지 거리 중 최소값을 선형 사상으로 바꾸어 국소 구조를 나타냅니다. 상대 시간 인코딩은 대상 엣지의 발생 시각과 각 타임스탬프의 차이를 선형 사상으로 바꿉니다. 원문은 이 선형 사상이 고정된 주파수 함수 대신 학습 가능한 사상이라는 점을 밝힙니다.

## 동적 그래프 트랜스포머와 이상 탐지기

노드 인코딩 행렬 X(e)는 트랜스포머 모듈의 입력 H(0)로 쓰이고, 어텐션 층이 노드 임베딩을 갱신합니다. 원문은 이 구조가 공간 정보와 시간 정보를 하나의 인코더에서 함께 포착하도록 설계되었다고 설명합니다. 마지막 어텐션 층의 출력 노드 임베딩은 평균 풀링을 거쳐 대상 엣지의 임베딩 z(e)가 됩니다.

탐지기는 학습 시 모든 관측 엣지를 정상으로 가정하고, 네거티브 샘플링으로 만든 가짜 엣지를 이상 후보로 둡니다. 완전연결 층과 시그모이드로 이상 점수 f(e)를 계산하며, 원문의 손실은 양성 엣지에서 log(1-f)를, 음성 엣지에서 log f를 더하는 이진 교차 엔트로피 형태입니다. 원문은 양성 의사 레이블을 0, 음성 의사 레이블을 1로 둔다고 명시합니다. 이 손실은 정상 엣지에는 낮은 이상 점수를, 가짜 엣지에는 높은 점수를 주도록 학습하는 방식입니다.

## 여섯 데이터셋에서의 비교 결과

주 실험은 여섯 개 동적 그래프 데이터셋에서 TADDY를 node2vec, Spectral Clustering, DeepWalk, NetWalk, AddGraph, StrGNN과 비교합니다. 각 데이터셋은 앞 50% 타임스탬프를 학습에, 나머지 50%를 테스트에 사용하며, 테스트 스냅샷에 이상 엣지를 1%, 5%, 10% 비율로 주입합니다. 성능은 모든 테스트 타임스탬프에 대한 평균 ROC-AUC로 보고됩니다.

원문은 TADDY가 여섯 데이터셋과 서로 다른 이상 비율 전반에서 기준 방법을 앞선다고 보고하며, 최고 기준 방법 대비 평균 AUC 향상을 4.49%로 제시합니다. 또한 Bitcoin-Alpha와 Bitcoin-OTC에서는 최고 기준 방법 대비 평균 향상이 6.42%라고 보고합니다. 이 두 수치는 같은 평가 설정에서 나온 저자 측정치이며, 비교군의 실험 조건은 본 논문의 표 설정에 따릅니다.

## 노드 인코딩 구성요소의 절제 결과

절제 실험은 확산 기반 공간 인코딩, 거리 기반 공간 인코딩, 상대 시간 인코딩을 하나씩 제거해 각 항의 기여를 확인합니다. 이 실험은 UCI Messages, Bitcoin-Alpha, Bitcoin-OTC에서 이상 비율 10%로 수행되었습니다. 나머지 설정은 기본값으로 유지되었습니다.

거리 기반 공간 인코딩을 제거하면 AUC가 크게 떨어집니다. 원문 표에서 UCI Messages는 0.8370에서 0.5362로, Bitcoin-Alpha는 0.9423에서 0.5043으로 낮아집니다. 이는 국소 구조 정보가 이 설정에서 중요하다는 관찰이며, 확산 기반 항과 상대 시간 항을 제거한 변형에서는 하락 폭이 상대적으로 작습니다. 따라서 이 결과는 거리 기반 항의 기여가 크다는 관찰로 읽는 것이 맞고, 세 항 중 어느 것도 제거하면 안 된다는 결론으로 확장하지 않습니다.

## 적용 범위와 남은 질문

원문의 결과는 여섯 개 데이터셋, 이상 엣지를 인위적으로 주입한 테스트 설정, PPR 확산과 2층 어텐션 설정에서 얻은 것입니다. 원문은 데이터셋마다 적절한 시간 윈도 크기가 다르며, 학습 비율에 따라 성능과 분산이 달라진다고 보고합니다. 따라서 이 결과를 실제 모든 동적 그래프 환경에 대한 보장으로 읽을 수는 없습니다.

![Figure 5: AUC values of TADDY on three datasets with different training ratios. The circular markers indicate the results which is viewed as outliers](https://refivu.com/papers/753e83eb-ff24-44ce-9097-3fa4ff681eb0/figures/figure-1927ac1f8d399bf9d9306aeaabc64989.png?thumb=512)

**Fig. 5** . AUC values of TADDY on three datasets with different training ratios. The circular markers indicate the results which is viewed as outliers.

[원문](https://arxiv.org/abs/2106.09876v2) · [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/) · Yixin Liu, Shirui Pan, Yu Guang Wang, Fei Xiong, Liang Wang, Qingfeng Chen, Vincent CS Lee · Anomaly Detection in Dynamic Graphs via Transformer · 원문 그림 인용 · 원본 PDF 11쪽에서 그림 영역을 추출했습니다.

또한 저자들은 트랜스포머를 동적 그래프 이상 탐지에 처음 적용했다고 주장하지만, 이는 저자 보고에 기반한 기여 주장입니다. 노드 인코딩의 계산 복잡도는 O(τkmI + T n̄²)로 제시되어, 큰 k나 긴 시간 윈도는 실행 비용을 늘립니다. 원문은 k를 5로 고정한 이유로 성능과 효율의 절충을 들며, 이 절충의 일반성은 본 논문 범위를 넘습니다.

## 논문 정보

- **저자**: Yixin Liu, Shirui Pan, Yu Guang Wang, Fei Xiong, Liang Wang, Qingfeng Chen, Vincent CS Lee
- **학회·저널**: arXiv · 프리프린트
- **최초 공개일**: 2021년 6월 18일
- **등록일**: 2026년 11월 6일
- **수정일**: 2021년 10월 27일
- **버전**: v2
- **arXiv**: 2106.09876
- **DOI**: 10.1109/tkde.2021.3124061
- **분류**: cs.LG
- **원문 이용 조건**: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/)
- **제공 범위**: 논문 정보, 해설, 허용된 원문 그림

[논문 원문 ↗](https://arxiv.org/abs/2106.09876v2) · [원문 PDF ↗](https://arxiv.org/pdf/2106.09876v2)

AI 해설은 논문 원문과 별개의 설명이며 오류가 있을 수 있습니다. 원문과 그림은 각 출처의 이용 조건과 따로 표시된 권리를 따릅니다.

## 초록

Detecting anomalies for dynamic graphs has drawn increasing attention due to their wide applications in social networks, e-commerce, and cybersecurity. Recent deep learning-based approaches have shown promising results over shallow methods. However, they fail to address two core challenges of anomaly detection in dynamic graphs: the lack of informative encoding for unattributed nodes and the difficulty of learning discriminate knowledge from coupled spatial-temporal dynamic graphs. To overcome these challenges, in this paper, we present a novel Transformer-based Anomaly Detection framework for DYnamic graphs (TADDY). Our framework constructs a comprehensive node encoding strategy to better represent each node's structural and temporal roles in an evolving graphs stream. Meanwhile, TADDY captures informative representation from dynamic graphs with coupled spatial-temporal patterns via a dynamic graph transformer model. The extensive experimental results demonstrate that our proposed TADDY framework outperforms the state-of-the-art methods by a large margin on six real-world datasets.

## 원문 인용

Yixin Liu, Shirui Pan, Yu Guang Wang, Fei Xiong, Liang Wang, Qingfeng Chen, Vincent CS Lee (2021). Anomaly Detection in Dynamic Graphs via Transformer. arXiv:2106.09876v2. https://doi.org/10.1109/tkde.2021.3124061

**BibTeX**

```
@article{liu2021anomaly,
  title = {{Anomaly Detection in Dynamic Graphs via Transformer}},
  author = {Yixin Liu and Shirui Pan and Yu Guang Wang and Fei Xiong and Liang Wang and Qingfeng Chen and Vincent CS Lee},
  year = {2021},
  eprint = {2106.09876},
  archivePrefix = {arXiv},
  doi = {10.1109/tkde.2021.3124061},
  url = {https://arxiv.org/abs/2106.09876v2}
}
```

## 이 논문의 용어

- [트랜스포머](https://refivu.com/terms/515e8433c447-transformer)
- [ROC-AUC](https://refivu.com/terms/4a16e24a9f10-roc-auc)
- [negative sampling](https://refivu.com/terms/1dbdea971d8c-negative-sampling)
- [binary cross-entropy loss](https://refivu.com/terms/e6ec2f1d9bdf-binary-cross-entropy-loss)
- [Personalized PageRank](https://refivu.com/terms/b8c03b235684-personalized-pagerank)
- [Bitcoin-Alpha](https://refivu.com/terms/b8dd032a0673-bitcoin-alpha)
- [Bitcoin-OTC](https://refivu.com/terms/7e087bc71c2e-bitcoin-otc)
- [graph diffusion](https://refivu.com/terms/5ee5aa90a24c-graph-diffusion)
- [heat kernel](https://refivu.com/terms/4f2b5e4ccfcb-heat-kernel)
- [relative temporal encoding](https://refivu.com/terms/6e5d42b5e99f-relative-temporal-encoding)

## 다른 논문 해설

- [DisCoVQA: Temporal Distortion-Content Transformers for Video Quality Assessment](https://refivu.com/papers/abf0b621-115a-4cad-ab92-7393c5ad6740-discovqa-temporal-distortion-content-transformers-for-video.md)
- [A multi-stream convolutional neural network for classification of progressive MCI in Alzheimer's disease using structural MRI images](https://refivu.com/papers/10b30fa8-1311-4e8e-8982-f09f78cec0b4-a-multi-stream-convolutional-neural-network-for.md)
- [Event-based Object Detection and Tracking for Space Situational Awareness](https://refivu.com/papers/66a8b893-f439-439f-8682-4e58e340a5e1-event-based-object-detection-and-tracking-for-space.md)
- [MFuseNet: Robust Depth Estimation with Learned Multiscopic Fusion](https://refivu.com/papers/e9f98436-c7dd-4915-a961-6b8bf97b8d07-mfusenet-robust-depth-estimation-with-learned-multiscopic.md)
- [Modeling Realistic Adversarial Attacks against Network Intrusion Detection Systems](https://refivu.com/papers/f13ca6e0-6eca-4426-afaf-381b59126578-modeling-realistic-adversarial-attacks-against-network.md)
- [deSpeckNet: Generalizing Deep Learning Based SAR Image Despeckling](https://refivu.com/papers/42ab96e9-97c8-490c-adeb-a7a9b82fa0e1-despecknet-generalizing-deep-learning-based-sar-image.md)
- [Generative Adversarial Network based Heuristics for Sampling-based Path Planning](https://refivu.com/papers/1f09e400-12bf-4b19-b72a-3ed5fb40a707-generative-adversarial-network-based-heuristics-for-sampling.md)
- [Physics-informed Dyna-Style Model-Based Deep Reinforcement Learning for Dynamic Control](https://refivu.com/papers/ed839db3-e284-449a-8ce0-d136449cdf16-physics-informed-dyna-style-model-based-deep-reinforcement.md)
- [Unlocking the Archives: Using Large Language Models to Transcribe Handwritten Historical Documents](https://refivu.com/papers/c3f9b9b5-8145-4837-9b3e-abaf5cbfb22c-unlocking-the-archives-using-large-language-models-to.md)
- [EmoBipedNav: Emotion-aware Social Navigation for Bipedal Robots with Deep Reinforcement Learning](https://refivu.com/papers/4c424d22-aaa0-4159-bc27-985211f3fce5-emobipednav-emotion-aware-social-navigation-for-bipedal.md)
- [Global birdsong embeddings enable superior transfer learning for bioacoustic classification](https://refivu.com/papers/35cfd4f6-ffbc-4629-b2eb-47d83ae30f04-global-birdsong-embeddings-enable-superior-transfer-learning.md)
- [GCNDepth: Self-supervised Monocular Depth Estimation based on Graph Convolutional Network](https://refivu.com/papers/b6ff0b35-b083-47ea-b483-c9e093e7094d-gcndepth-self-supervised-monocular-depth-estimation-based-on.md)

---

AI 해설에는 오류가 있을 수 있습니다. [Refivu](https://refivu.com/papers/753e83eb-ff24-44ce-9097-3fa4ff681eb0-anomaly-detection-in-dynamic-graphs-via-transformer)
