Detecting and handling online anomalies

The system addresses the limitations of existing cyber threat detection by building concentric profiles and using a counterfactual generator to adaptively calibrate thresholds, enhancing contextual understanding and reducing false positives for rapid and accurate threat remediation.

US12820121B1Active Publication Date: 2026-12-01MORGAN STANLEY SERVICES GROUP INC
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
US19/415790
Authority / Receiving Office
US · United States
Patent Type
Patents(United States)
Current Assignee / Owner
Filing Date
2025-12-11
Publication Date
2026-12-01
Estimated Expiration
2045-12-11

AI Technical Summary

Technical Problem

Existing systems for detecting cyber threats are reactive, generate excessive false positives, lack contextual clarity, and fail to identify novel or cross-application attack patterns, leading to delayed detection and high operational costs.

Method used

A system that implements a profile engine for building concentric profiles at global, cohort, and individual levels, using a counterfactual generator trained on normal events to repair anomalies, compute anomaly scores, and adaptively calibrate detection thresholds, reducing false positives and enhancing contextual understanding.

Benefits of technology

The system provides rapid, accurate, and minimally manual remediation of cyber threats by reducing false positives and improving contextual insight across applications, adapting to dynamic environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure US12820121-D00000_ABST
    Figure US12820121-D00000_ABST
Patent Text Reader

Abstract

A system for anomaly detection is programmed to implement a profile engine that builds concentric profiles at global, cohort, and individual levels to capture behavioral norms for user transactions over recent periods. The system is programmed to summarize activities at each level by fitting probability distributions to transaction data to provide personalized context for each user transaction. The system is programmed to prepare a counterfactual generator that uses the profile context to repair anomalies or generate borderline examples. The counterfactual generator can be implemented by a large language model trained on normal events and paired examples, with transactions represented by their features and corresponding concentric profiles. The system is programmed to compute anomaly scores by comparing actual transactions to repaired counterfactuals, combining deviations from concentric profiles with deviations from normal events. The system is programmed to calibrate anomaly detection thresholds adaptively by generating borderline counterfactuals and fitting tail models.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to online threat management and machine learning, and more particularly to detecting and handling online anomalies using machine learning.BACKGROUND

[0002] Today's computer systems face mounting challenges in detecting and mitigating increasingly sophisticated and evasive cyber threats. Existing systems are reactive, generating excessive false positives. They are often unable to identify novel or cross-application attack patterns. They also lack contextual clarity, offering limited insight into flagged activities. In addition, they fail in dynamic environments where “normal” is constantly evolving. These limitations result in delayed detection, high operational cost, and tangible and intangible harm. Therefore, it would be helpful to have a threat detection system that delivers contextual, adaptable, cross-application, and explainable insights—enabling rapid, accurate, and minimally manual remediation.SUMMARY

[0003] The appended claims may serve as a summary of the invention.BRIEF DESCRIPTION OF THE DRAWINGS

[0004] Example embodiments will now be described by way of non-limiting examples with reference to the accompanying drawings, in which:

[0005] FIG. 1 illustrates an example networked computer system in which various embodiments may be practiced.

[0006] FIG. 2 illustrates an example record that captures a user activity associated with a user account.

[0007] FIG. 3 illustrates a portion of an example prompt for invoking a counterfactual generator for a given user transaction.

[0008] FIG. 4 illustrates example data for computing normalized per-field deviation or feature-wise differential.

[0009] FIG. 5 illustrates an example process of detecting or handling online anomalies in a distributed computing environment in accordance with the embodiments disclosed herein.

[0010] FIG. 6 illustrates an example computer system upon which various embodiments may be implemented.DETAILED DESCRIPTION OF CERTAIN EMBODIMENTS

[0011] In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the example embodiment(s) of the present invention. It will be apparent, however, that the example embodiment(s) may be practiced without these specific details. In other instances, well-known structures and devices are shown in block diagram form in order to avoid unnecessarily obscuring the example embodiment(s).1. General Overview

[0012] A system is programmed to implement a profile engine that builds concentric profiles at global, cohort, and individual levels to capture behavioral norms for user transactions over recent periods. The system is programmed to summarize activities at each level by fitting probability distributions to transaction data to provide personalized context for each user transaction. The system is programmed to prepare a counterfactual generator that uses the profile context to repair anomalies or generate borderline examples. The counterfactual generator can be implemented by a large language model (LLM) trained on normal events and paired examples, with transactions represented by their features and corresponding concentric profiles. The system is programmed to compute anomaly scores by comparing actual transactions to repaired counterfactuals, combining deviations from concentric profiles with deviations from normal events. The system is programmed to calibrate anomaly detection thresholds adaptively by generating borderline counterfactuals and fitting tail models.

[0013] In some embodiments, the system is programmed to implement a profile engine that can build a concentric profile covering multiple granularities, such as the global, cohort, and individual levels. The concentric profile can cover activities or transactions in a recent period of time for a user account, a cohort to which the user account belongs, and a company or industry to which the cohort belongs. The concentric profile summarizes the transactions at each level by combining parameters of a probability distribution fitted to the transaction data and provides a personalized context for the transaction.

[0014] In some embodiments, the system is programmed to prepare a counterfactual generator that uses this profile context to repair anomalies or generate borderline examples. The counterfactual generator can be implemented by an LLM and trained on normal events together with abnormal-to-normal pairs to determine how a given transaction would deviate from normal events or with normal-to-abnormal pairs to enrich borderline examples to determine whether recent transactions reflect an updated trend in deviation from normal events. Each transaction would be represented by features of the transaction together with the corresponding concentric profile. The LLM can be continuously updated based on feedback designating normal events from an administrator account.

[0015] In some embodiments, the system is programmed to compute an anomaly score by comparing the actual transaction to a corresponding repair counterfactual. The anomaly score includes a first component representing how the transaction deviates from the concentric profile using values of the likelihood function corresponding to the probability distribution for each profile level. This first component is designed to reflect derivation from personally relevant transactions. The anomaly score also includes a second component representing how the transaction deviates from the normal events used to train the counterfactual generator using the differences between the transaction and the repair counterfactual at the raw data level and the embedding level. This second component is designed to reflect deviation from permitted transaction. A combination of the two components provides a richer anomaly score.

[0016] In some embodiments, the system is programmed to calibrate anomaly detection thresholds adaptively by generating borderline counterfactuals and fitting tail models to the exceedance of the resulting anomaly scores of the borderline counterfactuals and actual transactions. The system can be programmed to adjust the thresholds for different cohorts or users so that sensitivity is tuned appropriately. Therefore, the continuously updated counterfactual generator can be used to update the anomaly detection thresholds, which can in turn be used to update when a transaction is considered as an anomaly by deviating from the general counterfactual for more than the anomaly detection threshold.

[0017] The system disclosed herein has several technical benefits. As the same framework applies seamlessly to transactions across logins, network address patterns, or conversational data by abstracting behavior into schema-level counterfactuals, cross-domain portability is achieved. Concentric profiles are personalized and entity-specific, reducing false positives in anomaly detection and yet capturing subtle fraud. The counterfactual normal allows computation of feature-level deviation, eliminating the need for a separate interpretability layer; the counterfactual generator continues to have low operational overhead since retraining does not require labeled fraud data-normal behavior alone is sufficient. The self-calibrating anomaly detection thresholds allow automatic adjustment of anomaly detection mechanisms rather than relying on fixed sensitivity parameters.2. Example Computing Environments

[0018] FIG. 1 illustrates an example networked computer system in which various embodiments may be practiced. FIG. 1 is shown in simplified, schematic format for purposes of illustrating a clear example and other embodiments may include more, fewer, or different elements.

[0019] In some embodiments, a networked computer system 100 comprises a computer application server (“server”) 102, a user device 120, and an administrator device 130, which are communicatively coupled through direct physical connections or via a network 118.

[0020] In some embodiments, the server 102 is programmed or configured to detect and handle online anomalies in a distributed computing environment. The server 102 is programmed to collect data related to user transactions, analyze the data using machine learning or other advanced computational models, and recommend or implement appropriate response to potential cyber threats. The server 102 can comprise any centralized or distributed computing facility with sufficient computing power in data processing, data storage, and network communication for performing the above-mentioned functions.

[0021] In some embodiments, the administrator device 130 is programmed or configured to evaluate threat assessments or recommended preventive or remedial actions and provide confirmation or other feedback. The administrator device 130 can comprise any personal computing device, such as a desktop computer, laptop computer, or tablet computer. In other embodiments, some of the functions performed by the administrator device 130 can be performed by the server 102.

[0022] In some embodiments, the user device 120 is programmed or configured to perform various activities or transactions in the distributed computing environment. The activities involve interactions by a user account with various computer applications or devices. The user device 120 can comprise any personal computing device, such as a desktop computer, laptop computer, or tablet computer.

[0023] The network 118 may be implemented by any medium or mechanism that provides for the exchange of data between the various elements of FIG. 1. Examples of the network 118 include, without limitation, one or more of a cellular network, communicatively coupled with a data connection to the computing devices over a cellular antenna, a near-field communication (NFC) network, a Local Area Network (LAN), a Wide Area Network (WAN), or the Internet, a terrestrial or satellite link.

[0024] In some embodiments, the user device 120 is programmed to interact with computer applications and devices in the distributed computing environment. The server 102 is programmed to continuously collect data resulting from interactions by the user device 130 and other user devices within a company or an industry. After building computational models for detecting anomalies in user activities based on granular profiles, the server 102 is programmed to determine whether a new user activity is anomalous or otherwise assess the threat level of new user activity by applying these computational models and further identify appropriate actions in response to a determination of an anomaly or a high threat level. The server 102 can be programmed to send data regarding the new user activities, the assessment result, or the actions to the administrator device 130 as a routine or in escalated circumstances. The administrator device 130, which can be associated with an administrator account, is programmed to provide approval, rejection, or other feedback on the received data. The server 102 can be programmed to revise or implement the actions or update the computational models based on the feedback from the administrator device.3. Functional Descriptions3.1. Concentric Profiling

[0025] In some embodiments, the server 102 is programmed to implement a profiling engine that learns behavioral patterns from the collected data at multiple granularities. The server 102 can be configured to form a concentric profile for a user account using the profiling engine in response to a specific number of new user activities associated with a user account. Alternatively, the server 102 can be configured to build all possible concentric profiles on a regular basis or in response to detected distributional drifts, as further discussed below, to provide a close approximate to the most current version. At the top level, the server 102 can be configured to establish a global profile layer that captures firm-wide or industry-wide norms, in terms of transaction ranges, active hours, network usage patterns, or other attributes by considering all user accounts within the firm or the industry. For example, the global profile may show that transactions above $10,000 are rare across the entire population, or that login activity typically occurs between 6:00 a.m. and 10:00 p.m. local time. In similar embodiments, the global profile layer may instead capture norms across multiple firms within a sector, or across multiple industries that share overlapping schemas. At the next level, the server 102 can be programmed to establish a cohort profile layer that models peer-group behaviors, such as all user accounts in the same geographic region or product segment. For instance, a cohort of small-business merchants in California may exhibit higher weekend transaction volumes than the global average. At the bottom level, the server 102 can be configured to establish an individual profile layer that learns personal historical habits and temporal rhythms associated with the user account. As an example, an individual user may consistently log in from a single IP address during weekday mornings, and deviations from this pattern are captured in the individual profile. In similar embodiments, the individual profile layer may incorporate device-level or session-level identifiers to capture finer-grained behavioral signatures. In other embodiments, additional levels or granularities can be implemented.

[0026] In some embodiments, the server 102 is programmed to build the profile for each profile layer by generating a compact representation of a density function for normal events and a corresponding likelihood function. The former provides the context that could be used downstream, while the latter provides an anomaly indication. In general, the compact representation in terms of an embedding can be built from a concatenation of the key parameters of the density function.

[0027] In some embodiments, the server 102 is configured to maintain an individual profile for each entity or user account. The server 102 is programmed to continuously collect data representing transactions (activities, events) associated with a user account, update the data pursuant to the privacy policy or other internal regulations, and normalize the resulting data according to a schema. A transaction can comprise any interactions with a user interface (UI) or calls to an application programming interface (API). FIG. 2 illustrates an example record that captures a user activity associated with a user account. For example, the property 202 indicates details of a transaction, such as a monetary amount of the transaction and another party of the transaction, while the property 204 indicates details of a user account, such as the network address of the user device.

[0028] In some embodiments, the server 102 is programmed to build individual profiles by encoding a temporal sequence of normalized transaction data for recent transactions associated with a user account occurring in a window of a predetermined length using a transformer, a recurrent neural network, or another temporal encoder to produce an individual embedding eu. The server 102 is configured to also fit a personal density model pu(x), which can be a Gaussian probability distribution, to the normalized transaction data and generate an individual likelihood function Lind(x)=−log pu(x), from which a likelihood value can be computed for a given event. Alternatively, the individual embedding eu can be generated from a concatenation of the parameters of the personal density model pu(x). The server 102 is programmed to fall back to the cohort or global profile when insufficient data is available.

[0029] In some embodiments, the server 102 is programmed to construct cohort profiles by clustering entities based on stable attributes such as region, product, or segment. The server 102 can be configured to apply a clustering algorithm, such as Hierarchical Density-Based Spatial Clustering of Applications with Noise (HDBSCAN) to capture non-spherical shapes, k-means, or spectral clustering. For example, the server 102 can cluster customers in the “North America / Retail” segment into three sub-cohorts characterized by transaction frequency and average basket size. The server 102 is programmed to thereafter fit a cohort density model pc(x), which can be a Gaussian probability distribution to the normalized data within each cluster and generate a cohort likelihood function Lcoh=−log pc(x), from which a likelihood value can be computed for a given event. The server 102 can be configured to generate a cohort embedding ec by similarly applying a temporal encoder to an aggregate of the normalized transaction data within the corresponding cluster or from a concatenation of the parameters of the cohort density model pc(x).

[0030] In some embodiments, the server 102 is programmed to construct the global profile for the global profile layer by training a global density model pg(x) on a corpus of normal events. The server 102 is configured to then implement the density model using a normalizing flow, a Gaussian mixture model, a kernel density estimator (KDE) with categorical smoothing, or another method that can generate a density function by leveraging Gaussian components or bases. The server 102 is programmed to thereafter derive a global embedding eg from the global density model pg(x). For a normalizing flow, the global embedding eg could be obtained from the mean latent vector across all normal samples. For a Gaussian mixture model, the global embedding eg can be obtained by concatenating the mixture parameters: means, covariances, and mixture weights. For the KDE, the global embedding eg could comprise kernel centers or a smoothed histogram vector. The server 102 is configured to next produce a global likelihood function Lglob(x)=−log pg(x), from which a likelihood value can be computed for the given event. In other embodiments, the techniques applied to obtain the global density model pg(x) or the global embedding eg can also be applied at the individual level or the cohort level, and vice versa.

[0031] In some embodiments, the server 102 is programmed to concatenate the global, cohort, and individual embeddings associated with a user account into a profile context vector defined as ctx=π([e]|ec|eu]), where It denotes a projection into a fixed-size representation. The projection may be performed using linear transformations, neural encoders, or hashing functions to ensure fixed-size representations. The server 102 can also be configured to weight the profile layers differently (e.g., elevate cohort norms when individual history is sparse). The server 102 is configured to then optionally quantize the profile context vector into discrete tokens for use in prompting a generative model. For example, the server 102 may quantize the embeddings into a sequence of discrete codes that are appended to a prompt for an LLM tasked with generating counterfactual events, as further discussed below.

[0032] In some embodiments, the server 102 is programmed to update the profiles on a scheduled basis, such as hourly or daily, and is further configured to refresh profiles in response to detected distributional drift, as further discussed below. The server 102 is programmed to then monitor key statistics including transaction amounts, inter-transaction times, and geolocations using online drift detectors, such as ADaptive WINdowing (ADWIN) or Page-Hinkley. For example, the server 102 may detect that the median transaction amount for a cohort has shifted upward by 30% over a two-week period, triggering a cohort profile update. The server 102 is configured to thereafter update the cohorts by rerunning a clustering algorithm when drift is detected in the distribution of feature values. The server 102 is programmed to subsequently refit or partially fit the density models for the global, cohort, or individual profiles using incremental training methods. As examples of partial refitting, for Normalizing Flows, streaming updates fine-tune the transformation layers with each batch so the mapping adapts smoothly to drift. For Gaussian Mixture Models, online Expectation-Maximization algorithms adjust means, variances, and mixture weights as new data arrives instead of recomputing them from scratch. For KDE, incremental updates add kernels for new points and prune outdated ones, with bandwidths adjusted dynamically. The server 102 is configured to then recompute the embeddings for the global, cohort, or individual profiles. The server 102 is programmed to thereby maintain the concentric profiling engine to provide a continuously adaptive baseline that supports downstream counterfactual generation, borderline synthesis, and anomaly scoring.3.2. Counterfactual Generation

[0033] In some embodiments, the server 102 is programmed to prepare an LLM or equivalent sequence generator for use as a counterfactual generator, which can have a transformer or autoencoder architecture, for example. The counterfactual generator is designed to operate in two distinct modes: repairing abnormal events into normal ones and producing borderline examples from normal events to probe detection thresholds. The server 102 is configured to train this model primarily on normal events so that the generator learns the baseline manifold of expected behavior. In addition, the server 102 is programmed to take layered profile context vectors as input during both training and inference, thereby personalizing the generator's outputs to the specific entity and context. For example, a transaction repair may be conditioned on global spending variance, a cohort's typical merchant categories, and a user's usual geographic radius, so that the server 102 avoids changing fields that are normal for the user even if they appear atypical globally. Combining training over normal events with tiered context conditioning helps ensure that generated counterfactuals are not only schema-valid but also behaviorally consistent with the appropriate level of personalization. The server 102 can be configured to append the hierarchical profile to the raw event so that the LLM receives both behavioral norms and entity-specific patterns before any generation occurs.

[0034] In some embodiments, the server 102 is programmed to train the counterfactual generator additionally on two channels of paired examples so that the LLM learns distinct operational behaviors. The server 102 is configured to use abnormal-to-normal pairs for a first mode, REPAIR_TO_NORMAL, where the objective is minimal but sufficient editing that returns inputs to normal behavior for the given context. The server 102 is further configured to use normal-to-borderline pairs for a second mode, NORMAL_TO_BORDERLINE, where the objective is producing synthetic examples that sit just beyond a detection threshold, denoted t, to probe and calibrate system sensitivity. Via the two channels, the LLM can both repair anomalies (Mode A) and generate calibration data (Mode B) that reveals threshold brittleness across fields such as amount, merchant, and location. For example, the server 102 may learn to adjust an outlier amount while preserving a user's frequent foreign city if that location is normal for the user but atypical globally.

[0035] In some embodiments, the server 102 is configured to optimize a composite supervised loss function that balances reconstruction fidelity, edit minimality, and profile consistency under tiered conditioning. The supervised objective is defined as

[0036] Lsup=XEnt⁡(y,xcf )+λ1⁢Δfeat(x,xcf)+λ2⁢Dprofile(xcf ⁢<semantics definitionURL="">❘<annotation encoding="Mathematica">"\[LeftBracketingBar]"< / annotation>< / semantics>g,c,u),where xcf represents the counterfactual generated based on the model parameters θ being trained, y represents the ground-truth counterfactual paired with x in the training dataset, XEnt(y, xcf) is a cross-entropy or token-level reconstruction component relative to the target y, Δfeat(x, xcf) penalizes the magnitude of edits across selected fields, and Dprofile(xcf)| g, c, u measures deviation from the normal manifold induced by global g, cohort c, and user u contexts.

[0037] In some embodiments, the server 102 is configured to compute Δfeat(x, xcf) using normalized per-field differences, such as z-score standardization, quantile normalization, or rank-based distances. Δfeat can be instantiated as a weighted l1 norm over the fields or feature values. Dprofile can be computed from likelihoods under the refit density models, for example. The server 102 is programmed to select λ1 and λ2 to discourage both over-correction (unnecessary edits that harm auditability) and under-correction (residual anomaly). For example, the server 102 may prefer changing only “amount” while preserving “merchant” and “city” if cohort and user profiles indicate those fields are normal.

[0038] In some embodiments, the server 102 is programmed to apply mode-specific targets within the same training framework so that the generator acquires precise behaviors for each use case. In Mode A, the server 102 is configured to minimize the supervised objective function, ensuring that the counterfactual xcf is pushed onto the normal manifold by reducing profile deviation Dprofile(xcf| g, c, u) while keeping the edit cost Δfeat(x, xcf) small. This is done so that abnormal events are repaired with minimal, context-consistent changes. In Mode B, the server 102 is configured to still minimize the supervised objective but with an additional bounding requirement: the drift score of the counterfactual must be deliberately shifted to sit just beyond (within a bounding margin of) the detection threshold t, as further discussed below. This constraint ensures that borderline examples are generated close to the threshold without drifting into implausible anomalies.

[0039] In some embodiments, the server 102 is configured to further fine-tune the counterfactual generator via reinforcement learning after supervised training so that behavior aligns with measurable anomaly distance and schema validity. A composite reward signal is applied, defined as

[0040] Reward=f(drift_margin⁢(x,xcf),minimality(Δf⁢e⁢a⁢t),validity(schema),where drift_margin captures movement toward (Mode A) or just beyond (Mode B) the desired boundary, minimality incentivizes fewer / smaller edits, and validity enforces schema constraints. The server 102 is programmed to employ policy optimization methods such as Proximal Policy Optimization (PPO) and Group Relative Policy Optimization (GRPO) to maximize expected reward, to correct residual behaviors that supervised losses do not fully capture. In alternative embodiments, the reward includes a term for profile-consistency confidence derived from likelihood estimates at global, cohort, and user layers.

[0041] In some embodiments, the server 102 is programmed to generate a counterfactual during inference by invoking the fine-tuned model with a profile context and a specified mode based on a prompt. A structured prompt can include a configuration segment and a domain schema declaration, followed by the task mode (Mode A or B) and the event payload for the transaction to be evaluated. FIG. 3 illustrates a portion of an example prompt for invoking a counterfactual generator for a given user transaction. For example, the statement 302 indicates the concentric profile, the statement 304 indicates the schema, the statement 306 indicates the task mode, and the statement 308 indicates the details of the transaction. The server 102 can be configured to invoke the LLM using the prompt as follows, for example:

[0042] xcf =LLM .generate(ctx,,x,constrained=True).with constrained decoding ensures that only schema-valid objects are produced. For example, negative currency amounts, unrecognized country codes, or timestamps outside allowed ranges can be blocked, while soft penalties are applied only to profile deviations that are still schema-valid.3.3. Anamoly Detection

[0043] In some embodiments, the server 102 is configured to compute, for every transaction x and its generated counterfactual xcf, a composite drift distance or the drift score to determine whether a transaction is anomalous. The server 102 is programmed to calculate

[0044] D=α⁢Lind(x)+β⁢Lcoh(x)+γ⁢Lglob(x)+η⁢Δfeat(x,xcf )+ζ⁢demb(x,xcf ),where as discussed above, Lind(x), Lcoh(x), and Lglob are negative log likelihoods under individual, cohort, and global profile density models and Δfeat(x, xcf) is a normalized per-field deviation, and additionally demb(x, Xcf) is an embedding-space distance.

[0045] The server 102 can be configured to compute demb (x, xcf) as a cosine distance between embeddings, a Mahalanobis distance, or an l2 Euclidean distance. The server 102 can be programmed to vary the weighting scheme by learning α, β, γ, η, ζ through calibration methods, such as isotonic regression or Platt scaling against validation labels or analyst decisions, while remaining within the same computational family of linear composite scoring. Because negative log likelihoods are standard loss functions, the server 102 is configured to interpret each L term as statistical deviation and each Δfeat or demb as counterfactual deviation, thereby making D a unified, decomposable anomaly score.

[0046] FIG. 4 illustrates example data for computing normalized per-field deviation or feature-wise differential. The feature column 402 shows the list of features representing a transaction. The actual column 404 indicates the given transaction record, as illustrated in FIG. 1. The counterfactual column 406 indicates a counterfactual generated for the given transaction using the counterfactual generator. The normalization column 408 indicates a normalization method to be applied to the difference between the actual and the counterfactual for each feature. The delta column 410 then indicates the normalized difference. Δfeat(x, Xcf) can then be computed as the sum of these normalized differences. Different normalization methods can be used for different feature types. As one example, for the amount feature that has continuous values, a probability distribution may be known in terms of the mean and standard deviation based on the individual profile, and the normalized difference can be computed as a z-score, while for the mcc feature that has discrete values, the rarity data can be used instead of a probability distribution. As another example, for a numerical feature, the normalized difference could be expressed in terms of the actual difference relative to a predetermined threshold, such as a window length. As yet another example, for a categorical feature, the normalized difference could be simply 1 or 0 for a match or a mismatch.

[0047] In some embodiments, the server 102 is programmed to mark a transaction anomalous if D exceeds the threshold t. The likelihood terms quantify statistical improbability against the personalized context and the counterfactual terms quantify semantic deviation against the training dataset, and the server 102 is configured to flag a transaction as anomalous only when it is both unlikely under baseline models and distant from its counterfactual repair. For example, a transaction amount of $9,950 may appear plausible under the global model but, when contrasted with its counterfactual repair of $250, yields a largeΔfeat(x, xcf) and elevated D, causing the event to exceed t.

[0048] The server 102 can be programmed to further provide explanations for the anomaly determination by indicating how a feature is associated with a larger value for the terms Δfeat or demb individually or in combination and thus is considered as a bigger contributor to the anomaly determination. The server 102 can be configured to transmit the explanations to the user device associated with the user account or an administrator device for further review. The server 102 can also be programmed to take further action based on the drift score or the explanations. The server 102 can be programmed to reverse the transaction, suspend the user account, send an alert regarding the user account to an external device, downgrade privileges of the user account, or take other measures depending on the drift score. The server 102 can also be programmed to lower the withdrawal limit or disable account access in a geographical region for the user account when the withdrawal amount or the geographical region of the user transaction deviates from the expected range relative to the counterfactual.3.4. Drift Threshold Calibration

[0049] In some embodiments, the server 102 is configured to calibrate the anomaly detection threshold t adaptively rather than relying on static cutoffs. The server 102 is programmed to generate borderline counterfactuals using the counterfactual generator via Mode B, as discussed above, and to compute their drift scores. These borderline cases probe the decision boundary where real samples may be scarce and help stabilize the calibration. Assuming that the counterfactual generator is continuously updated, the borderline cases are expected to reflect the current distribution. The server 102 is configured to then apply Peaks-Over-Threshold Extreme Value Threshold (EVT) to the resulting distribution, thereby updating t automatically. Specifically, the server 102 is configured collect transactions occurring in a recent predetermined period plus the borderline transactions generated by the counterfactual generator. The server 102 is configured to then compute the composite scores D (x) for each transaction x, identify those values that exceed then existing threshold, and fit the resulting exceedance distribution to a Generalized Pareto law under Peaks-Over-Threshold EVT. Once the tail parameters are estimated, the server 102 is configured to update r automatically by selecting a quantile or confidence level of the fitted distribution, thereby defining a calibrated boundary for extreme deviations. In similar embodiments, the server 102 can be programmed to apply block-maxima modeling or conformal quantile regression, each remaining within the same computational family of tail-based calibration methods.

[0050] In some embodiments, the server 102 is configured to execute a boundary discovery loop on a periodic cadence, such as nightly, or earlier if the distribution of drift scores shifts significantly. The server 102 can be programmed to generate borderline counterfactuals from multiple cohorts or even maintain different detection thresholds τcohort for different cohorts, such as by achieving specific target false positive rates. In this case, the server 102 can be programmed to iterate over cohorts, sample normal events, generate borderline variants using the counterfactual generator under the appropriate detection threshold, compute drift scores Db, and fit a tail model to the resulting distribution. In similar embodiments, the server 102 is programmed to generate borderline variants not only via the counterfactual generator but also by perturbing along principal component directions or interpolating between normal and anomalous embeddings. In other embodiments, the server 102 is configured to apply back-off rules at the user level. The server 102 is programmed to override τcohort with a user-specific threshold τuser when the user's history is relatively rich and representative.4. Example Processes

[0051] In some embodiments, the server 102 is programmed to perform offline, batch operations according to a schedule. These operations can include updating the concentric profiles, as discussed in Section 3.1, retraining the counterfactual generator, as discussed in Section 3.2, or calibrating the drift threshold, as discussed in Section 3.4. The server 102 is further programmed to determine perform fraud detection in real time, discussed in Sections 3.3.

[0052] FIG. 5 illustrates a process of detecting and handling online anomalies in a distributed environment in accordance with disclosed embodiments. FIG. 5 is shown in simplified, schematic format for purposes of illustrating a clear example and other embodiments may include more, fewer, or different elements connected in various manners. FIG. 5 is intended to disclose an algorithm, plan, or outline that can be used to implement one or more computer programs or other software elements which when executed cause performing the functional improvements and technical advances that are described herein. Furthermore, the flow diagrams herein are described at the same level of detail that persons of ordinary skill in the art ordinarily use to communicate with one another about algorithms, plans, or specifications forming a basis of software programs that they plan to code or implement using their accumulated skill and knowledge.

[0053] In step 502, the server 102 is programmed to receive an input vector representing a transaction associated with a user account. In some embodiments, the transaction includes an interaction with a user interface or a call to an application programming interface.

[0054] In step 504, the server 102 is programmed to obtain a concentric profile associated with the user account, including a plurality of profiles representing transaction data in a predetermined period at a plurality of granularities.

[0055] In some embodiments, the server 102 is configured to fit a global probability distribution to a global set of normal transactions, compute a concatenation of parameters of the global probability distribution as a global profile of the plurality of profiles, and determine a global likelihood function from the global probability distribution. In certain embodiments, the server 102 is configured to compute a cohort profile of the plurality of profiles based on a subset of normal transactions associated with a cohort including the user account. In other embodiments, the server 102 is configured to compute an individual profile of the plurality of profiles using a temporal encoder. In yet other embodiments, the server 102 is configured to update concentric profiles associated with all user accounts according to a schedule.

[0056] In step 506, the server 102 is programmed to apply a machine learning model trained on normal transactions to the input vector with the concentric profile, where the machine learning model is invoked in a first mode to generate a normal counterfactual that represents a normal transaction.

[0057] In some embodiments, the server 102 is configured to train the machine learning model with abnormal-to-normal pairs for the first mode and with normal-to-abnormal pairs for the second mode. In certain embodiments, the server 102 is configured to train the machine learning model with an objective function that includes a loss function of a ground-truth vector and a specific counterfactual generated for a given vector and a difference function of the given vector and the specific counterfactual. In other embodiments, the server 102 is configured to update the machine learning model using reinforcement learning that rewards a smaller number of edits between a given vector and a specific counterfactual generated for the given vector.

[0058] In step 508, the server 102 is programmed to compute a drift score for the input vector based on the concentric profile and the normal counterfactual. In some embodiments, the computing comprises applying a likelihood function corresponding to a profile of the plurality of profiles to the input vector and a difference function to the input vector and the normal counterfactual.

[0059] In step 510, the server 102 is programmed to determine whether the transaction is anomalous based on the drift score and a detection threshold.

[0060] In step 512, the server 102 is programmed to provide, upon determining that the transaction is anomalous, an explanation based on a difference between the input vector and the normal counterfactual. In some embodiments, the providing comprises indicating a larger contribution to determining that the transaction is anomalous by a feature that leads to a bigger difference between the input vector and the normal counterfactual than another feature.

[0061] In step 514, the server 102 is programmed to apply the machine learning model to a plurality of normal transactions and their corresponding concentric profiles, where the machine learning model is invoked in a second mode to generate a plurality of borderline counterfactuals that represent borderline transactions.

[0062] In step 516, the server 102 is programmed to update the detection threshold based on the plurality of borderline counterfactuals. In some embodiments, the updating comprises fitting a tail distribution to exceedance of drift scores of the plurality of borderline counterfactuals and actual transactions.5. Example Implementation

[0063] According to one embodiment, the techniques described herein are implemented by at least one computing device. The techniques may be implemented in whole or in part using a combination of at least one server computer and / or other computing devices that are coupled using a network, such as a packet data network. The computing devices may be hard-wired to perform the techniques, or may include digital electronic devices such as at least one application-specific integrated circuit (ASIC) or field programmable gate array (FPGA) that is persistently programmed to perform the techniques, or may include at least one general purpose hardware processor programmed to perform the techniques pursuant to program instructions in firmware, memory, other storage, or a combination. Such computing devices may also combine custom hard-wired logic, ASICs, or FPGAs with custom programming to accomplish the described techniques. The computing devices may be server computers, workstations, personal computers, portable computer systems, handheld devices, mobile computing devices, wearable devices, body mounted or implantable devices, smartphones, smart appliances, internetworking devices, autonomous or semi-autonomous devices such as robots or unmanned ground or aerial vehicles, any other electronic device that incorporates hard-wired and / or program logic to implement the described techniques, one or more virtual computing machines or instances in a data center, and / or a network of server computers and / or personal computers.

[0064] FIG. 6 illustrates an example computer system upon which various embodiments may be implemented. In the example of FIG. 6, a computer system 600 and instructions for implementing the disclosed technologies in hardware, software, or a combination of hardware and software, are represented schematically, for example as boxes and circles, at the same level of detail that is commonly used by persons of ordinary skill in the art to which this disclosure pertains for communicating about computer architecture and computer systems implementations.

[0065] Computer system 600 includes an input / output (I / O) subsystem 602 which may include a bus and / or other communication mechanism(s) for communicating information and / or instructions between the components of the computer system 600 over electronic signal paths. The I / O subsystem 602 may include an I / O controller, a memory controller and at least one I / O port. The electronic signal paths are represented schematically in the drawings, for example as lines, unidirectional arrows, or bidirectional arrows.

[0066] At least one hardware processor 604 is coupled to I / O subsystem 602 for processing information and instructions. Hardware processor 604 may include, for example, a general-purpose microprocessor or microcontroller and / or a special-purpose microprocessor such as an embedded system or a graphics processing unit (GPU) or a digital signal processor or Advanced RISC Machines (ARM) processor. Processor 604 may comprise an integrated arithmetic logic unit (ALU) or may be coupled to a separate ALU.

[0067] Computer system 600 includes one or more units of memory 606, such as a main memory, which is coupled to I / O subsystem 602 for electronically digitally storing data and instructions to be executed by processor 604. Memory 606 may include volatile memory such as various forms of random-access memory (RAM) or other dynamic storage device. Memory 606 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed by processor 604. Such instructions, when stored in non-transitory computer-readable storage media accessible to processor 604, can render computer system 600 into a special-purpose machine that is customized to perform the operations specified in the instructions.

[0068] Computer system 600 further includes non-volatile memory such as read only memory (ROM) 608 or other static storage device coupled to I / O subsystem 602 for storing information and instructions for processor 604. The ROM 608 may include various forms of programmable ROM (PROM) such as erasable PROM (EPROM) or electrically erasable PROM (EEPROM). A unit of persistent storage 610 may include various forms of non-volatile RAM (NVRAM), such as flash memory, or solid-state storage, magnetic disk, or optical disk such as CD-ROM or DVD-ROM, and may be coupled to I / O subsystem 602 for storing information and instructions. Storage 610 is an example of a non-transitory computer-readable medium that may be used to store instructions and data which when executed by the processor 604 cause performing computer-implemented methods to execute the techniques herein.

[0069] The instructions in memory 606, ROM 608 or storage 610 may comprise one or more sets of instructions that are organized as modules, methods, objects, functions, routines, or calls. The instructions may be organized as one or more computer programs, operating system services, or application programs including mobile apps. The instructions may comprise an operating system and / or system software; one or more libraries to support multimedia, programming or other functions; data protocol instructions or stacks to implement Transmission Control Protocol / Internet Protocol (TCP / IP), Hypertext Transfer Protocol (HTTP) or other communication protocols; file processing instructions to interpret and render files coded using HTML, XML, Joint Photographic Experts Group (JPEG), Moving Picture Experts Group (MPEG) or Portable Network Graphics (PNG); user interface instructions to render or interpret commands for a GUI, command-line interface or text user interface; application software such as an office suite, internet access applications, design and manufacturing applications, graphics applications, audio applications, software engineering applications, educational applications, games or miscellaneous applications. The instructions may implement a web server, web application server or web client. The instructions may be organized as a presentation layer, application layer and data storage layer such as a relational database system using structured query language (SQL) or NoSQL, an object store, a graph database, a flat file system or other data storage.

[0070] Computer system 600 may be coupled via I / O subsystem 602 to at least one output device 612. In one embodiment, output device 612 is a digital computer display. Examples of a display that may be used in various embodiments include a touch screen display or a light-emitting diode (LED) display or a liquid crystal display (LCD) or an e-paper display. Computer system 600 may include other type(s) of output devices 612, alternatively or in addition to a display device. Examples of other output devices 612 include printers, ticket printers, plotters, projectors, sound cards or video cards, speakers, buzzers or piezoelectric devices or other audible devices, lamps or LED or LCD indicators, haptic devices, actuators, or servos.

[0071] At least one input device 614 is coupled to I / O subsystem 602 for communicating signals, data, command selections or gestures to processor 604. Examples of input devices 614 include touch screens, microphones, still and video digital cameras, alphanumeric and other keys, keypads, keyboards, graphics tablets, image scanners, joysticks, clocks, switches, buttons, dials, slides, and / or various types of sensors such as force sensors, motion sensors, heat sensors, accelerometers, gyroscopes, and inertial measurement unit (IMU) sensors and / or various types of transceivers such as wireless, such as cellular or Wi-Fi, radio frequency (RF) or infrared (IR) transceivers and Global Positioning System (GPS) transceivers.

[0072] Another type of input device is a control device 616, which may perform cursor control or other automated control functions such as navigation in a graphical interface on a display screen, alternatively or in addition to input functions. Control device 616 may be a touchpad, a mouse, a trackball, or cursor direction keys for communicating direction information and command selections to processor 604 and for controlling cursor movement on the output device 612. The input device may have at least two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane. Another type of input device is a wired, wireless, or optical control device such as a joystick, wand, console, steering wheel, pedal, gearshift mechanism or other type of control device. An input device 614 may include a combination of multiple different input devices, such as a video camera and a depth sensor.

[0073] In another embodiment, computer system 600 may comprise an internet of things (IOT) device in which one or more of the output device 612, input device 614, and control device 616 are omitted. Or, in such an embodiment, the input device 614 may comprise one or more cameras, motion detectors, thermometers, microphones, seismic detectors, other sensors or detectors, measurement devices or encoders and the output device 612 may comprise a special-purpose display such as a single-line LED or LCD display, one or more indicators, a display panel, a meter, a valve, a solenoid, an actuator or a servo.

[0074] When computer system 600 is a mobile computing device, input device 614 may comprise a global positioning system (GPS) receiver coupled to a GPS module that is capable of triangulating to a plurality of GPS satellites, determining and generating geo-location or position data such as latitude-longitude values for a geophysical location of the computer system 600. Output device 612 may include hardware, software, firmware, and interfaces for generating position reporting packets, notifications, pulse or heartbeat signals, or other recurring data transmissions that specify a position of the computer system 600, alone or in combination with other application-specific data, directed toward host computer 624 or server 630.

[0075] Computer system 600 may implement the techniques described herein using customized hard-wired logic, at least one ASIC or FPGA, firmware and / or program instructions or logic which when loaded and used or executed in combination with the computer system causes or programs the computer system to operate as a special-purpose machine. According to one embodiment, the techniques herein are performed by computer system 600 in response to processor 604 executing at least one sequence of at least one instruction contained in main memory 606. Such instructions may be read into main memory 606 from another storage medium, such as storage 610. Execution of the sequences of instructions contained in main memory 606 causes processor 604 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions.

[0076] The term “storage media” as used herein refers to any non-transitory media that store data and / or instructions that cause a machine to operate in a specific fashion. Such storage media may comprise non-volatile media and / or volatile media. Non-volatile media includes, for example, optical or magnetic disks, such as storage 610. Volatile media includes dynamic memory, such as memory 606. Common forms of storage media include, for example, a hard disk, solid state drive, flash drive, magnetic data storage medium, any optical or physical data storage medium, memory chip, or the like.

[0077] Storage media is distinct from but may be used in conjunction with transmission media. Transmission media participates in transferring information between storage media. For example, transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprise a bus of I / O subsystem 602. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications.

[0078] Various forms of media may be involved in carrying at least one sequence of at least one instruction to processor 604 for execution. For example, the instructions may initially be carried on a magnetic disk or solid-state drive of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a communication link such as a fiber optic or coaxial cable or telephone line using a modem. A modem or router local to computer system 600 can receive the data on the communication link and convert the data to be read by computer system 600. For instance, a receiver such as a radio frequency antenna or an infrared detector can receive the data carried in a wireless or optical signal and appropriate circuitry can provide the data to I / O subsystem 602 such as place the data on a bus. I / O subsystem 602 carries the data to memory 606, from which processor 604 retrieves and executes the instructions. The instructions received by memory 606 may optionally be stored on storage 610 either before or after execution by processor 604.

[0079] Computer system 600 also includes a communication interface 618 coupled to I / O subsystem 602. Communication interface 618 provides a two-way data communication coupling to network link(s) 620 that are directly or indirectly connected to at least one communication network, such as a network 622 or a public or private cloud on the Internet. For example, communication interface 618 may be an Ethernet networking interface, integrated-services digital network (ISDN) card, cable modem, satellite modem, or a modem to provide a data communication connection to a corresponding type of communications line, for example an Ethernet cable or a metal cable of any kind or a fiber-optic line or a telephone line. Network 622 broadly represents a LAN, WAN, campus network, internetwork, or any combination thereof. Communication interface 618 may comprise a LAN card to provide a data communication connection to a compatible LAN, or a cellular radiotelephone interface that is wired to send or receive cellular data according to cellular radiotelephone wireless networking standards, or a satellite radio interface that is wired to send or receive digital data according to satellite wireless networking standards. In any such implementation, communication interface 618 sends and receives electrical, electromagnetic, or optical signals over signal paths that carry digital data streams representing various types of information.

[0080] Network link 620 typically provides electrical, electromagnetic, or optical data communication directly or through at least one network to other data devices, using, for example, satellite, cellular, Wi-Fi, or BLUETOOTH technology. For example, network link 620 may provide a connection through a network 622 to a host computer 624.

[0081] Furthermore, network link 620 may provide a connection through network 622 or to other computing devices via internetworking devices and / or computers that are operated by an Internet Service Provider (ISP) 626. ISP 626 provides data communication services through a world-wide packet data communication network represented as internet 628. To ensure data security and privacy, network communications may be encrypted using Transport Layer Security (TLS), Secure / Multipurpose Internet Mail Extensions (S / MIME), or other cryptographic methods. Network devices such as firewalls, intrusion detection / prevention systems (IDS / IPS), and proxy servers may be deployed to protect computer system 600 components from unauthorized access or cyber threats.

[0082] A server 630 may be coupled to internet 628. Server 630 broadly represents any computer, data center, virtual machine, or virtual computing instance with or without a hypervisor, or computer executing a containerized program system such as DOCKER or KUBERNETES. Server 630 may represent an electronic digital service that is implemented using more than one computer or instance and that is accessed and used by transmitting web services requests, Uniform Resource Locator (URL) strings with parameters in HTTP payloads, application programming interface (API) calls, app services calls, or other service calls. Computer system 600 and server 630 may form elements of a distributed computing system that includes other computers, a processing cluster, server farm or other organization of computers that cooperate to perform tasks or execute applications or services. Server 630 may comprise one or more sets of instructions that are organized as modules, methods, objects, functions, routines, or calls. The instructions may be organized as one or more computer programs, operating system services, or application programs including mobile apps. The instructions may comprise an operating system and / or system software; one or more libraries to support multimedia, programming or other functions; data protocol instructions or stacks to implement TCP / IP, HTTP or other communication protocols; file format processing instructions to interpret or render files coded using HTML, XML, JPEG, MPEG or PNG; user interface instructions to render or interpret commands for a GUI, command-line interface or text user interface; application software such as an office suite, internet access applications, design and manufacturing applications, graphics applications, audio applications, software engineering applications, educational applications, games or miscellaneous applications. Server 630 may comprise a web application server that hosts a presentation layer, application layer and data storage layer such as a relational database system using SQL or NoSQL, an object store, a graph database, a flat file system or other data storage.

[0083] Computer system 600 can send messages and receive data and instructions, including program code, through the network(s), network link 620 and communication interface 618. In the Internet example, a server 630 might transmit a requested code for an application program through Internet 628, ISP 626, local network 622 and communication interface 618. The received code may be executed by processor 604 as it is received, and / or stored in storage 610, or other non-volatile storage for later execution.

[0084] The execution of instructions as described in this section may implement a process in the form of an instance of a computer program that is being executed, and consisting of program code and its current activity. Depending on the operating system (OS), a process may be made up of multiple threads of execution that execute instructions concurrently. In this context, a computer program is a passive collection of instructions, while a process may be the actual execution of those instructions. Several processes may be associated with the same program; for example, opening up several instances of the same program often means more than one process is being executed. Multitasking may be implemented to allow multiple processes to share processor 604. While each processor 604 or core of the processor executes a single task at a time, computer system 600 may be programmed to implement multitasking to allow each processor to switch between tasks that are being executed without having to wait for each task to finish. In an embodiment, switches may be performed when tasks perform input / output operations, when a task indicates that it can be switched, or on hardware interrupts. Time-sharing may be implemented to allow fast response for interactive user applications by rapidly performing context switches to provide the appearance of concurrent execution of multiple processes simultaneously. In an embodiment, for security and reliability, an operating system may prevent direct communication between independent processes, providing strictly mediated and controlled inter-process communication functionality.6. Extensions and Alternatives

[0085] In the foregoing specification, embodiments of the disclosure have been described with reference to numerous specific details that may vary from implementation to implementation. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. The sole and exclusive indicator of the scope of the disclosure, and what is intended by the applicants to be the scope of the disclosure, is the literal and equivalent scope of the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction.

Claims

1. A method of detecting or handling online anomalies in a distributed computing environment, comprising:receiving an input vector representing a transaction associated with a user account;obtaining a concentric profile associated with the user account, including a plurality of profiles representing transaction data across logins or network addresses in a predetermined period at a plurality of granularities;applying a machine learning model trained on normal transactions to the input vector with the concentric profile,the machine learning model being invoked in a first mode to generate a normal counterfactual that represents a normal transaction;computing a drift score for the input vector based on the concentric profile and the normal counterfactual;determining whether the transaction is anomalous based on the drift score and a detection threshold;upon determining that the transaction is anomalous, reversing the transaction, suspending the user account, or downgrading privileges of the user account based on a difference between the input vector and the normal counterfactual;applying the machine learning model to a plurality of normal transactions and their corresponding concentric profiles,the machine learning model being invoked in a second mode to generate a plurality of borderline counterfactuals that represent borderline transactions;updating the detection threshold based on the plurality of borderline counterfactuals,wherein the method is performed by one or more processors.

2. The method of claim 1, the transaction including an interaction with a user interface or a call to an application programming interface.

3. The method of claim 1, further comprising:fitting a global probability distribution to a global set of normal transactions;computing a concatenation of parameters of the global probability distribution as a global profile of the plurality of profiles;determining a global likelihood function from the global probability distribution.

4. The method of claim 1, further comprising computing a cohort profile of the plurality of profiles based on a subset of normal transactions associated with a cohort including the user account.

5. The method of claim 1, further comprising computing an individual profile of the plurality of profiles using a temporal encoder.

6. The method of claim 1, further comprising training the machine learning model with abnormal-to-normal pairs for the first mode and with normal-to-abnormal pairs for the second mode.

7. The method of claim 1, further comprising training the machine learning model with an objective function that includes a loss function of a ground-truth vector and a specific counterfactual generated for a given vector and a difference function of the given vector and the specific counterfactual.

8. The method of claim 1, the computing comprising applying a likelihood function corresponding to a profile of the plurality of profiles to the input vector and a difference function to the input vector and the normal counterfactual.

9. The method of claim 1, the providing comprising indicating a larger contribution to determining that the transaction is anomalous by a feature that leads to a bigger difference between the input vector and the normal counterfactual than another feature.

10. The method of claim 1, the updating comprising fitting a tail distribution to exceedance of drift scores of the plurality of borderline counterfactuals and actual transactions.

11. The method of claim 1, further comprising updating the machine learning model using reinforcement learning that rewards a smaller number of edits between a given vector and a specific counterfactual generated for the given vector.

12. The method of claim 1, further comprising updating concentric profiles associated with all user accounts according to a schedule.

13. A system for detecting or handling online anomalies in a distributed computing environment, comprising:a memory;one or more processors coupled to the memory and configured to perform:receiving an input vector representing a transaction associated with a user account;obtaining a concentric profile associated with the user account, including a plurality of profiles representing transaction data across logins or network addresses in a predetermined period at a plurality of granularities;applying a machine learning model trained on normal transactions to the input vector with the concentric profile,the machine learning model being invoked in a first mode to generate a normal counterfactual that represents a normal transaction;computing a drift score for the input vector based on the concentric profile and the normal counterfactual;determining whether the transaction is anomalous based on the drift score and a detection threshold;, upon determining that the transaction is anomalous, reversing the transaction, suspending the user account, or downgrading privileges of the user account based on a difference between the input vector and the normal counterfactual;applying the machine learning model to a plurality of normal transactions and their corresponding concentric profiles,the machine learning model being invoked in a second mode to generate a plurality of borderline counterfactuals that represent borderline transactions;updating the detection threshold based on the plurality of borderline counterfactuals.

14. The system of claim 13, the one or more processed further configured to perform:fitting a global probability distribution to a global set of normal transactions;computing a concatenation of parameters of the global probability distribution as a global profile of the plurality of profiles;determining a global likelihood function from the global probability distribution.

15. The system of claim 13, the one or more processed further configured to perform computing a cohort profile of the plurality of profiles based on a subset of normal transactions associated with a cohort including the user account.

16. The system of claim 13, the one or more processed further configured to perform training the machine learning model with abnormal-to-normal pairs for the first mode and with normal-to-abnormal pairs for the second mode.

17. The system of claim 13, the one or more processed further configured to perform training the machine learning model with an objective function that includes a loss function of a ground-truth vector and a specific counterfactual generated for a given vector and a difference function of the given vector and the specific counterfactual.

18. The system of claim 13, the computing comprising applying a likelihood function corresponding to a profile of the plurality of profiles to the input vector and a difference function to the input vector and the normal counterfactual.

19. The system of claim 13, the providing comprising indicating a larger contribution to determining that the transaction is anomalous by a feature that leads to a bigger difference between the input vector and the normal counterfactual than another feature.

20. A non-transitory, computer-readable storage medium storing one or more sequences of instructions which when executed cause one or more processor to perform:receiving an input vector representing a transaction associated with a user account;obtaining a concentric profile associated with the user account, including a plurality of profiles representing transaction data across logins or network addresses in a predetermined period at a plurality of granularities;applying a machine learning model trained on normal transactions to the input vector with the concentric profile,the machine learning model being invoked in a first mode to generate a normal counterfactual that represents a normal transaction;computing a drift score for the input vector based on the concentric profile and the normal counterfactual;determining whether the transaction is anomalous based on the drift score and a detection threshold;upon determining that the transaction is anomalous, reversing the transaction, suspending the user account, or downgrading privileges of the user account based on a difference between the input vector and the normal counterfactual;applying the machine learning model to a plurality of normal transactions and their corresponding concentric profiles,the machine learning model being invoked in a second mode to generate a plurality of borderline counterfactuals that represent borderline transactions;updating the detection threshold based on the plurality of borderline counterfactuals.

Citation Information

Patent Citations

  • Fraud detection systems and methods

    US12131330B1

  • Cybersecurity architectures for multi-contextual risk quantification

    US12149558B1

  • Model shift prevention through machine learning

    US20210209512A1

  • Fraud importance system

    US20220006899A1

  • Learning from distributed traces for anomaly detection and root cause analysis

    US20220172067A1