1 Introduction
A variety of realworld graphs, including computer networks, online social networks, and hyperlink networks, have been targets of attacks. Distributed denialofservice attacks block the availability by causing an unexpected traffic jam on the target machine. In addition, fake connections in online social networks degrade the quality of recommendations, and those in hyperlink networks manipulate the centrality of webpages. Due to its importance and necessity in realworld applications, anomaly detection in graphs has received considerable attention. To detect nodes, edges, and/or subgraphs deviating from structural and temporal patterns in graphs, various numerical measures of the deviation have been proposed with search algorithms [akoglu2010oddball, hooi2016fraudar, shin2016corescope]. As many realworld graphs evolve over time, detecting anomalies in realtime, as they appear, is desirable [bhatia2020midas, eswaran2018sedanspot].
While graphs model pairwise interactions, interactions in many realworld systems are groupwise (collaborations of coauthors, group interactions on online Q&A platforms, copurchases of items, etc). Such a groupwise interaction is naturally represented as a hyperedge, i.e., a set of an arbitrary number of nodes. A hypergraph, which is a set of hyperedges, is an indispensable extension of a graph, which can only describe pairwise relations. Moreover, many of such realworld hypergraphs evolve over time (e.g., emails exchanged continuously between sets of users, coauthorships established over time, and daily records of copurchased items), and thus they are typically modeled as a stream of hyperedges.
Despite the great interest in anomaly detection in graphs, the same problem in hypergraphs has been largely unexplored. Highorder relationships represented by hyperedges exhibit structural and temporal properties distinguished from those in graphs and hence raise unique technical challenges. Thus, instead of simply decomposing hyperedges into pairwise edges and applying graphbased methods, it is required to take the underlying highorder structures into consideration for anomaly detection in hypergraphs.
To this end, we propose HashNWalk, an online algorithm for detecting anomalous hyperedges. HashNWalk maintains a constantsize summary that tracks structural and temporal patterns in highorder interactions in the input stream. Specifically, HashNWalk incorporates socalled edgedependent node weights [chitra2019random]
into random walks on hypergraphs to estimate the proximity between nodes while capturing highorder information. Furthermore, we develop an incremental update scheme, which each hyperedge is processed by as it appears.
The designed hypergraph summary is used to score the anomalousness of any new hyperedge in the stream. While the definition of anomaly depends on the context, in this work, we focus on two intuitive aspects: unexpectedness and burstiness. We assume that unexpected hyperedges consist of unnatural combinations of nodes, and bursty hyperedges suddenly appear in a short period of time. Based on the information in the form of a hypergraph summary, we formally define two anomaly score metrics that effectively capture these properties. We empirically show that HashNWalk is effective in detecting anomalous hyperedges in (semi)real hypergraphs.
In summary, our contributions are as follows:

[leftmargin=*]

Fast: It takes a very short time for HashNWalk to process each new hyperedge. Specifically, in our experimental setting, it processed 1.4 billion hyperedges within 2.5 hours.

Space Efficient: The user can bound the size of the summary, which HashNWalk maintains.

Accurate: HashNWalk successfully detects anomalous hyperedges. Numerically, it outperforms its stateoftheart competitors with up to higher AUROC.
Reproducibility: The source code and datasets are available at https://github.com/geonlee0325/HashNWalk.
2 Related Works
We discuss prior works on the three topics relevant to this paper: (a) anomaly detection in (hyper)graphs; (b) summarization of edge streams; and (c) hypergraphs and applications.
Anomaly Detection in Graphs & Hypergraphs: The problem of detecting anomalous nodes, edges, and/or subgraphs has been extensively studied for both static and dynamic graphs [akoglu2015graph]. In static graphs, nodes whose egonets are structurally different from others [akoglu2010oddball], edges whose removal significantly reduces the encoding cost [chakrabarti2004autopart], or subgraphs whose density is abnormally high [beutel2013copycatch, hooi2016fraudar, shin2016corescope] are assumed to be anomalies. In dynamic graphs, temporal edges are assumed to be anomalous if they connect sparsely connected parts in graphs [eswaran2018sedanspot] or are unlikely to appear according to underlying models [aggarwal2011outlier, yoon2019fast, bhatia2020midas, belth2020mining]. In addition, dense subgraphs generated within a short time are considered to be anomalous [shin2017densealert, eswaran2018spotlight]. Recently, embedding based methods have shown to be effective in detecting anomalies in graphs [yu2018netwalk, chang2020f].
On the other hand, detecting anomalies in hypergraphs is relatively unexplored. Anomalous nodes in the hypergraph have been the targets of detection by using scan statistics on hypergraphs [park2009anomaly]
or training a classifier based on the highorder structural features of the nodes
[leontjeva2012fraud]. The anomalousness of unseen hyperedges is measured based on how likely the combinations of nodes are drawn from the distribution of anomalous cooccurrences, which is assumed to be uniform, instead of the distribution of nominal ones [silva2008hypergraph]. Approximate frequencies of structurally similar hyperedges obtained by locality sensitive hashing are used to score the anomalousness of hyperedges in the hyperedge stream [ranshous2017efficient]. In this paper, we compare ours with the methods that detect anomalous interactions in online settings, i.e., anomaly detectors designed for edge streams [bhatia2020midas, eswaran2018sedanspot, chang2020f] and hyperedge streams [ranshous2017efficient].Summarization of Edge Streams: Summarization aims to reduce the size of a given graph while approximately maintaining its structural properties. It has been particularly demanded in the context of realtime processing of streaming edges. In [bhatia2020midas], a countminsketch is maintained for approximate frequencies of edges. Edge frequencies have been used to answer queries regarding structural properties of graphs [zhao2011gsketch, tang2016graph]. In [bandyopadhyay2016topological], local properties, such as the number of triangles and neighborhood overlap, are estimated by maintaining topological information of a given graph.
Hypergraphs and Applications: Hypergraphs appear in numerous fields, including bioinformatics [hwang2008learning], circuit design [karypis1999multilevel]
[huang2009video, kim2020hypergraph][ding2020more], social network analysis [yang2019revisiting], and recommendation [mao2019multiobjective]. Structural properties [benson2018simplicial, do2020structural, lee2020hypergraph, lee2021how, choe2022midas] and dynamical properties [benson2018simplicial, benson2018sequences, kook2020evolution, lee2021thyme+, choo2022persistence] of such realworld hypergraphs have been studied extensively.3 Preliminaries
In this section, we introduce notations and preliminaries.
3.1 Notations and Concepts
Hypergraphs: A hypergraph consists of a set of nodes and a set of hyperedges . Each hyperedge is a nonempty subset of an arbitrary number of nodes. We can represent by its incidence matrix , where each entry is if and otherwise. A hyperedge stream is a sequence of hyperedges where each hyperedge arrives at time . For any and , if , then .
Clique Expansion and Information Loss: Clique expansion [zhou2007learning], where each hyperedge is converted to a clique composed of the nodes in , is one of the most common ways of transforming a hypergraph into an ordinary pairwise graph. Clique expansion suffers from the loss of information on highorder interactions. That is, in general, a hypergraph is not uniquely identifiable from its clique expansion. Exponentially many nonisomorphic hypergraphs are reduced to identical clique expansions.
Random Walks on Hypergraphs: A random walk on a hypergraph is formulated in [chitra2019random] as follows. If the current node is , (1) select a hyperedge that contains the node (i.e.,
) with probability proportional to
and (2) select a node with probability proportional to and walk to node . The weight is the weight of the hyperedge , and the weight is the weight of node with respect to the hyperedge . The weight is edgeindependent if it is identical for every hyperedge ; and otherwise, it is edgedependent. If all node weights are edgeindependent, then a random walk on becomes equivalent to a random walk on its clique expansion [chitra2019random]. However, if node weights are edgedependent, random walks on hypergraphs are generally irreversible. That is, they may not be the same as random walks on any undirected graphs. In this sense, if edgedependent weights are available, random walks are capable of exploiting highorder information beyond clique expansions and thus empirically useful in many machine learning tasks
[hayashi2020hypergraph].Transition Matrix: To incorporate edgedependent node weights, the incidence matrix is generalized to a weighted incidence matrix where each entry is if and otherwise. Then, the transition probability matrix of a random walk on the hypergraph is written as , where denotes the hyperedgeweight matrix where each entry is if and 0 otherwise. The matrices and are diagonal matrices of node degrees and hyperedge weights, respectively. That is, if we let and
be the vectors whose entries are all ones, then
and .3.2 Problem Description
The problem that we address in this paper is as follows.
Problem 1.
Given a stream of hyperedges, detect anomalous hyperedges, whose structural or temporal properties deviate from general patterns, in near realtime using constant space.
While the definition of anomalous hyperedges depends on the context, we focus on two intuitive perspectives. In one aspect, a hyperedge is anomalous if it consists of an unexpected subset of nodes. That is, we aim to detect hyperedges composed of unusual combinations of nodes. In the other aspect, we aim to identify a set of similar hyperedges that appear in bursts as an anomaly. The sudden emergence of similar interactions often indicates malicious behavior harmful in many applications. In addition, for timecritical applications, we aim to detect such anomalous hyperedges in near realtime, as they appear, using bounded space. While one might tempt to reduce hyperedges into subgraphs and solve the problem as anomalous subgraph detection, this harms the highorder information of the hyperedges. Also, existing works on anomalous subgraphs assume static graphs [hooi2016fraudar] or detect only the single most anomalous subgraph [shin2017densealert], while we aim to score every hyperedge in the stream.
4 Proposed Method
In this section, we propose HashNWalk (Algorithm 1), which is a fast and spaceefficient algorithm for detecting anomalies in a hyperedge stream. Our main focus is speed and space efficiency since HashNWalk is expected to process a potentially infinite stream. As illustrated in Figure 2, it maintains a concise and informative summary of a hyperedge stream (Sect. 4.1), which is incrementally updated as each new hyperedge arrives (Sect. 4.2). Once the summary is updated, anomalous hyperedges are identified immediately based on two principled metrics (Sect. 4.3). While HashNWalk is based on multiple summaries (Sect. 4.4), we assume that it consists of a single summary for ease of explanation.
4.1 Hypergraph Summarization
Hyperedge Representation: We describe how to concisely represent each hyperedge using constant space. Hyperedges, by definition, are flexible in their sizes, and it is nontrivial to represent each hyperedge using the same amount of space. To this end, we map each node into one of different values using a hash function . We consider each hash value as a supernode that contains the nodes with the same hash value. Due to hash collisions, a hyperedge may contain a supernode multiple times, and the number of occurrences becomes the weight of the supernode with respect to the hyperedge. Formally, we represent each hyperedge of any size into a dimensional vector , whose ^{th} element indicates the number of the nodes that are contained in and mapped into the hash value (i.e., ). It is also interpreted as the weight of the supernode with respect to the hyperedge . We denote as the set of supernodes that hyperedge contains, i.e., . Note that a hyperedge of any size is represented as a fixedsize vector, whose size is usercontrolled. In addition, the edgedependent weights of supernodes can be utilized by random walks (see Section 3.1). If we use a constanttime hash function and a sparse vector format, for each hyperedge , the time complexity of generating the vector is , as stated in Lemma 1.
Lemma 1 (Time Complexity of Generating ).
Given a hyperedge , it takes time to generate the vector .
Proof. Creating a zero vector in a sparse format (e.g., a hash table) and incrementing for every node takes time. ∎
Hypergraph Summary: Below, we describe how to summarize the entire hypergraph for rapid and accurate anomaly detection. We note that the key building block for identifying anomalous hyperedges of both types (i.e., unexpected ones and similar ones in bursts) is to estimate the proximity or structural similarity between nodes. Thus, we summarize the input hypergraph in the form of proximity between supernodes, and we extend random walks to measure the proximity. Our summary is based on random walks extended with edgedependent supernode weights and hyperedge weights; and we use the transition probabilities as their approximation for rapid updates (see Section 4.2). Specifically, we summarize the input hypergraph as a matrix , where is the weighted incidence matrix where each entry is if and 0 otherwise. The matrix denotes the hyperedgeweight matrix where is if and 0 otherwise. The matrices and are diagonal matrices of supernode degrees and hyperedge weights, respectively. Then, is the transition probability matrix where each entry is the transition probability from supernode to :
(1) 
where is the weighted degree of the , i.e., , and is the sum of the weights of the supernodes in the , i.e., .
EdgeDependent Supernode Weights: If edgedependent supernode weights are available, random walks utilize highorder information beyond clique expansions. Such weights are naturally obtained from the aforementioned vector representation of hyperedges. That is, we use the number of the occurrences of each supernode in each hyperedge as the weight of with respect to . Formally, , and thus .
TimeDecaying Hyperedge Weights: In order to facilitate identifying recent bursts of similar hyperedges, which are one of our focuses, we emphasize recent hyperedges with large weights. Specifically, at current time , we define the weight of each hyperedge , which is arrived at time , as where is a kernel function for quantifying time decay and
is a hyperparameter that determines the degree of emphasis. Specifically, smaller
more emphasizes recent hyperedges.4.2 Incremental Update
Challenges: Constructing from scratch, which takes time, is undesirable when immediate responses to anomalies are demanded. In addition, when hyperedges are streamed indefinitely, materializing , , and , which are used to compute , is prohibitive since their sizes are proportional to the number of hyperedges.
Proposed Updated Scheme: We present an incremental algorithm for efficiently but exactly updating in response to a new hyperedge. The proposed update scheme maintains only , whose size is controllable by the user, without materializing any larger matrix. Assume hyperedges have arrived, and let be the proximity from supernode to supernode in them. We introduce a matrix and a vector , and for any supernodes and , their entries when the hyperedge arrives at time are
Then, based on Eq. (1) and the predefined hyperedge weight function , is written as
(2) 
Instead of directly tracking the proximity matrix , we track aforementioned and , whose entries are initialized to zero. Each entry and can be updated in constant time, as presented in Lemmas 2 and 3, and once they are updated, we can compute in time by Eq. (2), if necessary.
Lemma 2 (Updating ).
For any , when the hyperedge arrives at , Eq. (3) holds.
(3) 
Lemma 3 (Updating ).
For any , when the hyperedge arrives at , Eq. (4) holds.
(4) 
Complexity: Notably, if , holds and if , holds. Thus, if or is not included in the new hyperedge (i.e., or ), remains the same (i.e., ) and thus does not need any update. Similarly, does not change if is not included in . These facts significantly reduce the update time of the summary, enabling near realtime processing of each hyperedge. To sum up, in response to a new hyperedge, HashNWalk updates the summary in a short time using constant space, as stated in Lemmas 4 and 5, respectively.
Lemma 4 (Update Time Per Hyperedge).
Lemma 5 (Constant Space).
The maintained summary takes space.
Proof. The matrix and the vector require and space, respectively.
4.3 Anomaly Detection
Hyperedge Anomaly Score: We now propose an online anomalous hyperedge detector, which is based on the structural and temporal information captured in the summary . We evaluate each newly arriving hyperedge by measuring a hyperedge anomaly score defined in Definition 1.
Definition 1 (Hyperedge Anomaly Score).
Given a newly arriving hyperedge at time , its anomaly score is defined as
(5) 
where is the number of occurrences of at time , is a hyperparameter for the importance of the occurrences, , and is just before . Intuitively, and are the “observed” proximity (i.e., the proximity in the current hyperedge) and “expected” proximity (i.e., the proximity in all past hyperedges appearing before ) from supernode to supernode , respectively.
Note that the relationships between all pairs of supernodes in the hyperedge, including the pairs of the same supernode, are taken into consideration, and they are aggregated using any aggregation functions. The hyperparameter and the aggregate function can be controlled to capture various types of anomalies. For the two types of anomalies, we define scoring functions and as described below.
Unexpectedness (): Intuitively, in Eq. (5) measures how much the proximity from the supernode to in the new hyperedge deviates from the proximity in the past hyperedges. Specifically, the ratio is high if two supernodes and that have been far from each other in past hyperedges unexpectedly coappear with high proximity in the new hyperedge. Thus, in , which is the anomaly score for identifying unexpected hyperedges, we focus on the ratio by setting . In order to detect any such unexpected pairs of supernodes in the hyperedge, uses the maximum ratio as the final score (i.e., ).
Burstiness (): In order to detect similar hyperedges that appear in bursts, the number of occurrences of supernodes is taken into consideration. Supernodes, by definition, are subsets of nodes, and similar hyperedges tend to share many supernodes. If a large number of similar hyperedges appear in a short period of time, then the occurrences of the supernodes in them tend to increase accordingly. Thus, in , which is the anomaly score for identifying recent bursts of similar hyperedges, we set to a positive number (specifically, in this work) to take such occurrences (i.e., in Eq. (5)) into consideration, in addition to unexpectedness (i.e., in Eq. (5)). We reflect the degrees of all supernodes in the hyperedge by averaging the scores from all supernode pairs (i.e., ).
Complementarity of the Anomaly Scores: While the only differences between and are the consideration of the current degree of supernodes (i.e., ) and the aggregation methods, the differences play an important role in identifying specific types of anomalies (see Section 5.2).
Complexity: For each new hyperedge , HashNWalk computes in a short time, as stated in Lemma 6.
Lemma 6 (Scoring Time Per Hyperedge).
Given the hypergraph summary and a hyperedge in the form of a vector , computing takes time.
Proof. The number of supernodes in is . We maintain and update the current degrees of supernodes, which takes time for each new hyperedge . There are pairs of supernodes in , and the computation for each supernode pair in Eq. (5) takes time. Hence, the total time complexity is .
4.4 Using Multiple Summaries (Optional)
Multiple hash functions can be used in HashNWalk to improve its accuracy at the expense of speed and space. Specifically, if we use hash functions, maintain summaries, and compute scores independently, then the space and time complexities become times of those with one hash function. Given hyperedge anomaly scores from different summaries, we use the maximum one as the final score, although any other aggregation function can be used instead.
5 Experiments
We review our experiments to answer Q1Q4:

[label=Q0.,leftmargin=*]

Performance: How rapidly and accurately does HashNWalk detect anomalous hyperedges?

Discovery: What meaningful events can HashNWalk detect in realworld hypergraph streams?

Scalability: How does the total runtime of HashNWalk change with respect to the input stream size?

Parameter Analysis: How do the parameters of HashNWalk affect its performance?
5.1 Experimental Settings
Dataset  

EmailEnron  143  10,885  2.472  37 
Transaction  284,807  284,807  5.99  6 
DBLP  1,930,378  3,700,681  2.790  280 
Citepatent  4,641,021  1,696,554  18.103  2,076 
Tagsoverflow  49,998  14,458,875  2.968  5 
Datasets: We used five different realworld datasets in Table 1. They are described in detail in later subsections.
Machines: We ran FFADE on a workstation with an Intel Xeon 4210 CPU, 256GB RAM, and RTX2080Ti GPUs. We ran the others on a desktop with an Intel Core i910900KF CPU and 64GB RAM.
Baselines: We consider four streaming algorithms for anomaly detection in graphs and hypergraphs as competitors:

[leftmargin=*]

SedanSpot [eswaran2018sedanspot]: Given a stream of edges, it aims to detect unexpected edges, i.e., edges that connect nodes from sparsely connected parts of the graph, based on personalized PageRank scores.

Midas [bhatia2020midas]: Given a stream of edges, it aims to detect similar edges in bursts. To this end, it uses the CountMinSketch.

FFADE [chang2020f]: Given a stream of edges, it uses frequencybased matrix factorization and computes the likelihoodbased anomaly score of each edge that combines unexpectedness and burstiness.

LSH [ranshous2017efficient]: Given a stream of hyperedges, it computes the unexpectedness of each one using its approximate frequency so far.
For graphbased anomaly detection methods, we transform hypergraphs into graphs via clique expansion (Section 3.1). That is, each hyperedge is reduced to pairwise edges, and the timestamp
is assigned to each edge. The anomaly score of the hyperedge is computed by aggregating the anomaly scores of the pairwise edges, using the best one among arithmetic/geometric mean, sum, and maximum.
Implementation: We implemented HashNWalk and LSH
in C++ and Python, respectively. For the others, we used their opensource implementation.
SedanSpot and Midas are implemented in C++ and FFADE is implemented in Python.Evaluation: Given anomaly scores of hyperedges, we measure AUROC and Precision@ (i.e., the ratio of true positives among hyperedges with the highest scores).
5.2 Q1. Performance Comparison
We consider three hypergraphs: Transaction, SemiU, and SemiB. Transaction [dal2015calibrating] is a realworld hypergraph of credit card transactions. Each timestamped transaction is described by a dimensional feature vector. There exist frauds, which account for of the entire transactions. For each transaction, we generate a hyperedge by grouping it with nearest transactions that occurred previously. Thus, each node is a transaction, and each hyperedge is a set of transactions that are similar to each other.
In EmailEnron, each node is an email account and each hyperedge is the set of the sender and receivers. The timestamp of each hyperedge is when the email was sent. We consider two scenarios InjectionU and InjectionB, where we generate two semireal hypergraphs SemiU and SemiB by injecting 200 unexpected and bursty hyperedges, respectively, in EmailEnron. The two injection scenarios are designed as follows:
[leftmargin=*] InjectionU: Injecting unexpected hyperedges. [leftmargin=8pt] Select a hyperedge uniformly at random. Create a hyperedge by replacing nodes in with random ones, and set their timestamp to . Repeat (1)(2) times to generate hyperedges. InjectionB: Injecting bursty hyperedges. [leftmargin=8pt] Select a time uniformly at random. Sample a set of nodes uniformly at random. Create uniform random subsets of at time . Their sizes are chosen uniformly at random from . Repeat (1)  (3) times to generate hyperedges.
All anomalies are injected after time , and thus all methods are evaluated from time where we set (). In InjectionU, we set . In InjectionB, we set , , and .
Accuracy: In Transaction, we use and set , , and . In SemiU and SemiB, we use and , respectively, and commonly set , , and . As discussed later, these summaries take up less space than the original hypergraphs. As shown in Figure 3, HashNWalk accurately detects anomalous hyperedges in real and semireal hypergraphs. Notably, while most methods fail to find any anomalous hyperedges in their top (see Figure 0(a) in Section 1) or top (Figure 2(a)) hyperedges with the highest anomaly scores, HashNWalk is successful. In addition, HashNWalk accurately detects both unexpected and bursty hyperedges. Note that while several competitors successfully spot bursty hyperedges in SemiB, most of them fail to spot unexpected ones in SemiU. Specifically, in SemiU, HashNWalk achieves higher precision@100 with faster speed than SedanSpot.
SemiU  SemiB  

AUROC  Prec.@100  AUROC  Prec.@100  
0.951  0.815  0.802  0.740  
0.916  0.090  0.997  1.000 
Speed: As seen in Figure 3, HashNWalk is one of the fastest methods among the considered ones. Notably, in SemiU, HashNWalk is faster than the second most accurate method.
Space Usage: We analyze the amount of space used by HashNWalk. Let and be the numbers of bits to encode an integer and a floating number, respectively, and we assume . The size of the original hypergraph is the sum of the hyperedge sizes, and precisely, bits are required to encode the hypergraph. As described in Lemma 5 in Section 4.2, for each hash function, HashNWalk tracks a matrix and a vector , and thus it requires bits with hash functions. We set and in Transaction; and and in SemiU and SemiB. As a result, HashNWalk requires about and of the space required for the original hypergraphs, in Transaction and semireal hypergraphs, respectively. For competitors, we conduct hyperparameter tuning, including configurations requiring more space than ours.^{1}^{1}1See https://github.com/geonlee0325/HashNWalk for details.
Complementarity of and : As seen in Table 2, while is effective in detecting unexpected hyperedges, it shows relatively low accuracy in detecting bursty hyperedges. The opposite holds in . The results indicate that the two metrics and are complementary.
5.3 Q2. Discovery
Here, we share the results of case studies conducted on the DBLP, Citepatent, and Tagsoverflow datasets.
Discoveries in Coauthorship Hypergraph: DBLP contains information of bibliographies of computer science publications. Each node represents an author, and each hyperedge consists of authors of a publication. The timestamp of the hyperedge is the year of publication. Here, we investigate how authors cowork with different researchers. For each author who have published at least 100 papers, we compute the average unexpectedness and burstiness scores of the hyperedges that is contained in, which we denote by and , respectively. We analyze several authors whose ratio is the highest or the lowest. Intuitively, authors with low ratios tend to cowork in a bursty manner with expected coauthors, while those with high ratios tend to work steadily with unexpected coauthors. Surprisingly, Dr. Bill Hancock, whose ratio is the lowest, published 186 papers all alone. Furthermore, Dr. Hancock published 139 papers in 2000. On the other hand, Dr. Seymour Ginsburg, whose is the highest, published 114 papers from 1958 to 1999 (2.7 papers per year). In addition, 18 coauthors (out of 38) coauthored only one paper with Dr. Ginsburg. In fact, and of the most authors are clustered as seen in Figure 3(a), and the top authors are those with the largest (or the smallest) slope. We further conduct case studies on two specific authors Dr. Shinji Sakamoto and Dr. KingSun Fu, whose coworking patterns are very different. As seen in Figure 3(b), while Dr. Sakamoto collaborated on most papers with a few researchers, Dr. Fu enjoyed coworking with many new researchers. These findings support our intuition behind the proposed measures, and .
Discoveries in Patent Citation Hypergraph: We use Citepatent [tang2012patentminer], which is a citation hypergraph where each node is a patent and each hyperedge is the set of patents cited by a patent. The timestamp of each hyperedge is the year of the citation ranging from 2000 to 2012. Using HashNWalk, we extract some hyperedges with high or . Then, we represent each hyperedge as a dimensional binary vector indicating which nodes belong to the hyperedge. We visualize the hyperedges after reducing the dimension of the vectors via TSNE in Figure 5. While unexpected hyperedges are spread, bursty hyperedges are closely located, indicating structurally similar hyperedges arrive in bursts. In addition, we closely examine the citation patterns of suspicious patents detected by HashNWalk. As seen in Figure 0(c), patents with unexpected or bursty citations are effectively detected.
Discoveries in Online Q&A Cite: We share the results of a case study using Tagsoverflow. In the dataset, nodes are tags and hyperedges are the set of tags attached to a question. Hyperedges with high (i.e., sets of unexpected keywords) include: {channel, ignore, antlr, hidden, whitespace}, {sifr, glyph, stling, textstyling, embedding}, and {retrocomputing, boot, floppy, amiga}. Hyperedges with high (i.e., sets of bursty keywords) include: {python, javascript}, {java, adobe, javascript}, and {c#, java}. Notably, sets of unpopular tags tend to have high unexpectedness, while those containing popular keywords, such as python and javascript, have high burstiness.
5.4 Q3. Scalability
To evaluate the scalability of HashNWalk, we measure how rapidly it updates the hypergraph summary and computes the anomaly scores as the number of hyperedges grows. To this end, we upscale EmailEnron, which originally consists of 10,885 hyperedges, by to times, and measure the total runtime of HashNWalk. As seen in Figure 0(b), the total runtime is linear in the number of hyperedges, which is consistent with our theoretical analysis (Theorem 1 in Section 4). That is, the time taken for processing each hyperedge is near constant. Notably, HashNWalk is scalable enough to process a stream of billion hyperedges within hours.
5.5 Q4. Parameter Analysis
We evaluate HashNWalk under different parameter settings, and the results are shown in Figure 6. In most cases, there is a positive correlation with (i.e., the number of supernodes) and
(i.e., the number of hash functions). Intuitively, a larger number of supernodes and hash functions collectively reduce the variance due to randomness introduced by hash functions. However, since the space usage is dependent on these parameters, a tradeoff between the accuracy and the space usage should be considered. In addition, properly setting
(i.e., time decaying parameter) improves the accuracy, as shown in Figure 6, which indicates that not only structural information but also the temporal information is critical in detecting anomalies in hyperedge streams.6 Conclusion
In this work, we propose HashNWalk, an online anomaly detector for hyperedge streams. HashNWalk maintains a randomwalkbased hypergraph summary with constant space, and it is incrementally updated in near realtime. Using the summary, HashNWalk computes two anomaly scores that are effective in identifying (a) hyperedges composed of unexpected combinations of nodes and (b) those appearing in bursts. Our experiments demonstrate the speed, accuracy, and effectiveness of HashNWalk in (semi)real datasets. The source code and datasets are publicly available at https://github.com/geonlee0325/HashNWalk.
Acknowledgements:
This work was supported by National Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. NRF2020R1C1C1008296) and Institute of Information & Communications Technology Planning & Evaluation (IITP) grant funded by the Korea government (MSIT) (No. 2019000075, Artificial Intelligence Graduate School Program (KAIST)).