Skip to main content
Back to timeline
arXivSource publication:

Medication-trajectory anomaly detection stops scoring whole records: L2G-Joint pinpoints the few suspicious visits

Synopsis

Suspicious deviations in longitudinal medication trajectories often sit in only a few visits, and scoring the whole account can dilute that local signal. L2G-Joint builds multi-granularity proxy anomalies constrained by a drug knowledge graph and reimbursement-catalogue categories, adds knowledge-consistent plausible variants as negatives, and gives every scoreable visit a shared anomaly score that is selectively aggregated by Top-20% into an account-level decision. On the City-A proxy benchmark it reaches a Macro AP of 0.7844, Macro AUROC of 0.7707 and Localization Macro AP of 0.7215, relative gains of about 2.4%, 3.6% and 9.2% over the strongest respective comparators.

Source-provided article image: Knowledge-Guided Local-to-Global Anomaly Learning for Longitudinal Medication Trajectories
arXiv

Interpretation

A medication trajectory can now yield both an account-level verdict and the visits responsible, rather than a single score for the whole record. Generic anomaly supervision struggled to separate clinically plausible medication changes from semantically suspicious deviations, while account-level supervision alone left the responsible visits undetermined. On the City-A proxy benchmark built from medication records, L2G-Joint reaches a Macro AP of 0.7844, Macro AUROC of 0.7707 and Localization Macro AP of 0.7215; the strongest account-level comparator, Account-Pooled Transformer, reaches 0.7659 and 0.7439, and the strongest localization comparator, AnomalyBERT-Proxy, reaches 0.6605.

The model encodes each scoreable visit as a local anomaly score and derives the account-level score by selectively aggregating those local scores. Aggregation uses Top-20%, summing the logits of only the highest-scoring 20% of visits instead of averaging all visits or keeping only the maximum. On City-A, Top-20% aggregation gives a Macro AP of 0.7844 and Macro AUROC of 0.7707, above Mean at 0.7727 and 0.7588 and Max at 0.7782 and 0.7628; raising the aggregation ratio to 0.30 lowers test Macro AP to 0.7664.

Proxy anomalies are not random perturbations but knowledge-constrained replacements or injections of real fragments at three granularities. K1 replaces a single medication, K2 replaces a 7–30-day treatment episode, and K3 injects a contiguous visit segment from another account; K1-Same and K2-Same serve as knowledge-consistent plausible negatives. A matched ablation without the Same negatives lowers AP on K1, K2 and K3 by 0.0091, 0.0103 and 0.0099 respectively, a Macro AP drop of 0.0098, while Macro AUROC and Localization Macro AP stay essentially unchanged.

Perspective

Results come from proxy benchmarks built on medication records from two cities, City-A and City-B, where positive anomalies are knowledge-constrained perturbed trajectories rather than clinically verified anomalies; City-A uses 8,855 eligible accounts split 70/10/20, while City-B has only 562 accounts and uses a burden-controlled five-fold out-of-fold evaluation.

A detected deviation cannot be determined to be a true clinical anomaly rather than a complex but reasonable treatment evolution; on City-B, adding localization supervision raises Localization Macro AP from 0.3637 to 0.4985 but lowers Macro AP from 0.6527 to 0.6372, so the extra account-level benefit of localization supervision varies across cohorts.