Skip to content

Objectives

An objective consists of a loss function and a decoder. Node-level objectives compute a loss for every node in a time-window graph, whereas edge-level ones compute a loss for every edge. This makes node-level objectives usually faster but less powerful than edge-level objectives to capture pair-wise information.

Level Objective Learns to Used by
Edge predict_edge_type Predict the type of each edge Velox, Orthrus, Kairos
Edge predict_edge_contrastive Tell real edges from negative ones (link prediction) Euler, Argus, Jbeil, E-GraphSAGE, ShadeWatcher
Edge autoencode_edge_embeddings Reconstruct the embedding of each edge LARES
Edge deep_graph_infomax Tell edges from those of a corrupted graph Anomal-E
Edge reconstruct_edge_embeddings Reconstruct edge embeddings
Edge predict_edge_supervised Separate benign edges from given attack edges Supervised fine-tuning
Node predict_node_type Predict the type of each node Flash, ThreaTrace
Node predict_process_tag Predict the name of the executable of each process, which is removed from its features (doc2vec.truncate_process_name); scores processes by the loss, or by the distance to K-Means clusters of training processes (detection: kmeans) R-Caid
Node reconstruct_node_features, reconstruct_node_embeddings Reconstruct node features or embeddings NodLink
Node reconstruct_masked_features, predict_masked_struct Reconstruct masked features and structure MAGIC
Node one_class Map benign nodes into a hypersphere per node type (Deep SVDD) OCR-APT
Node predict_snapshot_embedding Predict the graph2vec embedding of each time window; nodes are scored by their key indicators ProGrapher

Objectives are not tied to a family of datasets, except predict_node_type, which needs at least two node types: network datasets only have hosts (see Running across families for the combinations that are tested). On network datasets, predict_edge_type predicts the operation of events (e.g. LogOn), or the attribute set as edge type with construction.edge_type (e.g. logon_type).

predict_edge_contrastive
Link prediction: the decoder scores the edges of the graph against negative edges. loss is bce (default), ap, the surrogate average precision loss of Argus, or bpr, the pairwise ranking loss of ShadeWatcher between each negative edge and the positive edge it was drawn for. neg_sampling draws the negatives: shuffle_dst (default) pairs each source with the destination of another edge, uniform and uniform_dst draw uniform nodes (neg_ratio negatives per edge), and tgn uses destinations embedded by the TGN (requires batching.intra_graph_batching.tgn_last_neighbor.negative_destinations). With the inner_product decoder, inner_product.negate scores edges by the negated inner product, as ShadeWatcher, whose inner product is the probability that two entities would not interact.
autoencode_edge_embeddings
The edge autoencoder of LARES: edge embeddings combine the embeddings of the two nodes with the edge features (gated skip connection, use_edge_feats), and edges are scored by their reconstruction error.
deep_graph_infomax
Deep Graph Infomax on edge embeddings, as in Anomal-E: edges are scored by the reconstruction error of their embedding by a PCA (pca_components) fitted on the training edges.
predict_snapshot_embedding
The objective of ProGrapher, used with the textrcnn encoder: the loss of a time window is the L2 distance between its graph2vec embedding and the embedding predicted from the previous windows. At inference, each node of the window gets the score of the window weighted by the rank of its key indicator: the rooted subgraphs (RSGs) of the window are ranked by how much more likely they are under the actual embedding than under the prediction, and a node gets score × (1 − rank / #RSGs) from the best-ranked RSG rooted at it. The maximum node score of a window is the window's score, so the same losses serve tw_evaluation and node_evaluation. With top_k, only the nodes of the top_k first RSGs keep a score. Its validation score (best_model_selection: best_val_score) is the opposite of the mean validation error.

autoencode_edge_embeddings, deep_graph_infomax and predict_snapshot_embedding have no decoder (decoder: none).

predict_edge_type also accepts loss: AMS, an additive margin softmax configured in its AMS section.

predict_edge_supervised is the only supervised objective: it learns from attack edges that you provide. See Supervised Fine-Tuning.

Arguments

  • predict_edge_supervised
    • decoder: str (1)
    • mode: str (2)
    • top_n_attacks: int (3)
    • attack_patterns: list (4)
    • max_edges_per_pattern: int (5)
    • attack_edges_path: str (6)
    • pos_weight: float (7)
  • predict_edge_type
    • loss: str (8)
    • decoder: str (9)
    • balanced_loss: bool
    • use_triplet_types: bool
    • edge_type_in_msg: bool (10)
    • AMS
      • version: int
      • margin: float
      • scale: int
  • predict_node_type
    • decoder: str (11)
    • balanced_loss: bool
    • flash_snapshots: bool (12)
    • flash_drop_conf: float (13)
  • predict_process_tag
    • decoder: str (14)
    • balanced_loss: bool
    • detection: str (15)
  • predict_masked_struct
    • loss: str (16)
    • decoder: str (17)
    • balanced_loss: bool
    • max_samples: int (18)
  • detect_edge_few_shot
    • decoder: str (19)
  • predict_edge_contrastive
    • decoder: str (20)
    • loss: str (21)
    • ap_margin: float (22)
    • neg_sampling: str (23)
    • neg_ratio: float (24)
  • deep_graph_infomax
    • decoder: str (25)
    • pca_components: int (26)
  • predict_snapshot_embedding
    • decoder: str (27)
    • top_k: int (28)
  • reconstruct_node_features
    • loss: str (29)
    • decoder: str (30)
  • reconstruct_node_embeddings
    • loss: str (31)
    • decoder: str (32)
  • autoencode_edge_embeddings
    • decoder: str (33)
    • use_edge_feats: bool (34)
  • reconstruct_edge_embeddings
    • loss: str (35)
    • decoder: str (36)
  • reconstruct_masked_features
    • loss: str (37)
    • mask_rate: float
    • decoder: str (38)
  • one_class
    • decoder: str (39)
    • beta: float (40)
    • eps: float (41)
    • warmup: int (42)
  1. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  2. 'scores': pick top-N from an edge_scores pkl; 'patterns': match hand-crafted TTP patterns; 'synthetic': use pre-computed embeddings for explicit attack edge definitions.

    Available options (one selection):
    scores
    patterns
    synthetic
  3. (scores mode) Number of top-loss edges to use as attack examples.
  4. (patterns mode) List of TTP pattern dicts.
  5. (patterns mode) Max edges collected per pattern.
  6. (synthetic mode) Path to YAML file with explicit (src_type, src_label, edge_type, dst_type, dst_label) attack edge definitions.
  7. BCE pos_weight for the attack class (on top of 1:1 oversampling).
  8. Loss used to predict the edge type. AMS: additive margin softmax (see AMS).

    Available options (one selection):
    cross_entropy
    BCE
    AMS
  9. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  10. Keeps the edge type in the edge messages msg (TGN memory and msg edge features), as in Kairos. Messages of an edge are only used after its type is predicted. By default, the edge type is removed from the messages.
  11. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  12. With the flash threshold method: trains each epoch on the training nodes still misclassified, and flags a node only if no snapshot of the epochs so far predicts its type correctly with a confidence above the threshold, as in FLASH.
  13. With flash_snapshots: training nodes predicted with this confidence or more are removed after an epoch, as the correctly predicted ones (0.9 in FLASH).
  14. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  15. Score of the processes at inference. loss: cross-entropy of their tag (tags unseen in training have their own class, never predicted). kmeans: distance of their embedding to the median of the nearest K-Means cluster of training processes (as in the paper).

    Available options (one selection):
    loss
    kmeans

  16. Available options (one selection):
    cross_entropy
    BCE
  17. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  18. Number of existing edges sampled per batch as positives, with as many negative node pairs, capped by the number of nodes (MAGIC: 10000). 0 uses all the edges.
  19. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  20. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  21. bce: binary cross-entropy of positive vs. random negative edges (default), ap: surrogate average precision loss of Argus, bpr: pairwise BPR loss of ShadeWatcher, softplus(s_neg - s_pos) between each negative edge and its positive edge.

    Available options (one selection):
    bce
    ap
    bpr
  22. Margin of the squared hinge of the ap loss (default: 0.8).
  23. Negative edges: shuffle_dst pairs each source with the destination of another edge of the graph (negatives keep the degree of destinations), uniform draws sources and destinations uniformly among the embedded nodes (as Euler and Argus), uniform_dst pairs the source of each edge with uniform destinations among the embedded nodes, tgn pairs it with a uniform destination of the dataset embedded by the TGN (as TGN and Jbeil, requires tgn_last_neighbor.negative_destinations).

    Available options (one selection):
    shuffle_dst
    uniform
    uniform_dst
    tgn
  24. Number of negatives per positive edge with uniform sampling.
  25. Unused: the discriminator of DGI is bilinear.

    Available options (one selection):
    none
  26. Number of principal components of the PCA fitted on the embeddings of training edges. Edges are scored by the reconstruction error of their embedding.
  27. Unused: the encoder predicts the embedding.

    Available options (one selection):
    none
  28. Number of top-ranked rooted subgraphs (key indicators) whose nodes get a score: other nodes get 0. 0 scores all nodes by the rank of their best rooted subgraph.

  29. Available options (one selection):
    SCE
    MSE
    MSE_sum
    MAE
    none
  30. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none

  31. Available options (one selection):
    SCE
    MSE
    MSE_sum
    MAE
    none
  32. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  33. Unused: the objective has its own autoencoder.

    Available options (one selection):
    none
  34. Adds the edge features (batching.edge_features) to the edge embedding through a gated skip connection, as LARES.

  35. Available options (one selection):
    SCE
    MSE
    MSE_sum
    MAE
    none
  36. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none

  37. Available options (one selection):
    SCE
    MSE
    MSE_sum
    MAE
    none
  38. Decoder used before computing loss.

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  39. Decoder applied to embeddings before the hypersphere; use 'none' (identity).

    Available options (one selection):
    edge_mlp
    node_mlp
    magic_gat
    nodlink
    inner_product
    none
  40. Soft-boundary fraction; radius is the (1-beta) distance quantile.
  41. Center slack keeping |c| away from zero.
  42. Kept for parity; a no-op (c/r update every train step).