Abnormal transaction behavior detection method, device, equipment, medium and program product
By reconstructing transaction behavior vectors, obtaining multi-dimensional features, and combining them with discriminator training, the threshold is dynamically adjusted, solving the problems of threshold dependence on human experience and data scarcity in traditional methods, and achieving accurate anomaly detection of bank transaction data.
Patent Information
- Application Number
- CN202611110971.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-24
- Publication Date
- 2026-11-24
AI Technical Summary
Traditional abnormal transaction detection methods rely on human experience to set thresholds, which makes it difficult to cope with new abnormal transaction behaviors. Furthermore, supervised learning methods require a large amount of labeled data and struggle to capture the temporal and multivariate dynamic correlations of bank transaction data, resulting in inaccurate identification of abnormal transaction behaviors.
Based on time series analysis, transaction behavior vectors are reconstructed to obtain multi-dimensional features. Through Fourier transform and graph analysis, combined with gating attention mechanism and discriminator training, anomaly scores are calculated, and the threshold is adjusted using generalized Pareto distribution to dynamically update the detection strategy.
It improves the accuracy and flexibility of abnormal transaction detection, can identify new types of abnormal transactions, reduce false alarms and false negatives, and adapt to complex transaction scenarios.
Smart Images

Figure CN123160260A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of big data, and more specifically to a method, apparatus, equipment, medium, and program product for detecting abnormal transaction behavior. Background Technology
[0002] With the widespread adoption of electronic payments and mobile banking, bank transaction data has exploded, leading to increasingly complex anomaly detection behaviors. Traditional anomaly detection methods widely employ rule engines and supervised learning models. However, these methods have significant limitations. Rule engines rely on human experience to set thresholds, but this approach struggles to handle novel anomaly behaviors and frequently results in false positives. Meanwhile, supervised learning methods typically require large amounts of labeled data, but in practice, anomaly samples are often scarce and labeling is extremely costly. Furthermore, bank transaction data itself exhibits strong temporal and multivariate characteristics, such as transaction time, amount, merchant type, and device information. The dynamic relationships between these features are difficult for existing methods to fully capture, making it challenging to accurately identify anomaly behaviors. Summary of the Invention
[0003] In view of the above problems, embodiments of this application provide a method, apparatus, device, medium, and program product for detecting abnormal transaction behavior.
[0004] According to a first aspect of this application, an abnormal trading behavior detection method is provided, comprising: reconstructing a trading behavior vector based on the time-series analysis results of the trading behavior vector at the time to be detected, thereby obtaining a reconstructed vector; acquiring features of the trading behavior vector and the reconstructed vector in multiple dimensions, including a time domain dimension, a frequency domain dimension, and a graph dimension, wherein the features in the frequency domain dimension include the periodic fluctuation degree of trading frequency and trading amount, and the features in the graph dimension indicate the trading relationship between trading accounts; calculating the feature deviation between the trading behavior vector and the reconstructed vector in the same dimension; weightedly fusing the feature deviations of each dimension and the first abnormal probability of the trading behavior vector to obtain an abnormal score, wherein the first abnormal probability is obtained by inputting the trading behavior vector into a pre-trained discriminator; and classifying the trading behavior represented by the trading behavior vector with an abnormal score greater than a threshold as an abnormal trading behavior, wherein the threshold is determined based on historical abnormal scores that follow a generalized Pareto distribution, and the historical abnormal scores change with the time to be detected.
[0005] According to embodiments of this application, the features of the transaction behavior vector and the reconstructed vector in multiple dimensions are obtained respectively, including: performing Fourier transform on the transaction behavior vector and the reconstructed vector respectively to obtain the frequency domain features of the transaction behavior vector and the reconstructed vector in the frequency domain dimension; and extracting the transaction information of the transaction behavior vector and the reconstructed vector respectively to construct the transaction behavior graphs of the transaction behavior vector and the reconstructed vector in the graph dimension, wherein the transaction behavior graphs indicate the transaction relationships between the transaction accounts in the corresponding transaction information.
[0006] According to embodiments of this application, before weighted fusion of the feature bias and the first anomaly probability of the trading behavior vector, the method includes: calculating the attention score of the temporal features of the reconstructed vector in the temporal domain dimension, and the attention scores of the frequency domain features and the trading behavior graph corresponding to the reconstructed vector, respectively, based on a gated attention mechanism; assigning the attention score of the temporal features as weights to the feature bias in the temporal domain dimension; assigning the attention score of the frequency domain features of the reconstructed vector as weights to the feature bias in the frequency domain dimension; and assigning the attention score of the trading behavior graph of the reconstructed vector as weights to the feature bias in the graph dimension.
[0007] According to an embodiment of this application, the discriminator is trained in the following manner: In the first stage, the historical transaction behavior vector and the first pseudo-vector are respectively input into the discriminator to obtain their respective second anomaly probabilities, and the first loss function is calculated to update the first model parameters. The first pseudo-vector is obtained by inputting the first random vector into the generator. The first loss function and the first model parameters represent the loss function and model parameters of the discriminator, respectively. The second anomaly probability acquisition and first model parameter update operations are repeated until a preset number of times are reached. In the second stage, the second random vector is input into the generator to obtain the second pseudo-vector, and the second pseudo-vector is input into the discriminator trained in the first stage to obtain the third anomaly probability. Based on the third anomaly probability, the second loss function is calculated and the second model parameters are updated. The second loss function and the second model parameters represent the loss function and model parameters of the generator, respectively. In the third stage, the second pseudo-vector is used to replace the first pseudo-vector, and the operations indicated by the first stage and the second stage are alternately cycled until the first loss function and the second loss function reach Nash equilibrium.
[0008] According to an embodiment of this application, the method further includes: matching a transaction behavior vector with a preset verification rule and obtaining a matching score, wherein the matching score indicates the degree of abnormality of the transaction behavior vector; calculating the confidence level of the abnormal score based on the difference between the abnormal score and the matching score; if the confidence level is less than a preset confidence level, then using the matching score as the historical abnormal score for the next detection time and updating the threshold corresponding to the next detection time.
[0009] According to an embodiment of this application, the method further includes: if the time to be detected is within a preset time period, obtaining a first historical anomaly score of a first historical anomaly transaction within the preset time period and a second historical anomaly score of a second historical anomaly transaction outside the preset time period; determining a first threshold within the preset time period based on the first historical anomaly score, the first threshold being used to distinguish between anomaly transactions and normal transactions within the preset time period; determining a second threshold outside the preset time period based on the second historical anomaly score that follows a generalized Pareto distribution, the second threshold being used to distinguish between anomaly transactions and normal transactions outside the preset time period; and performing weighted processing on the first threshold and the second threshold to obtain a threshold value.
[0010] According to an embodiment of this application, obtaining a first historical anomaly score for a first historical abnormal transaction within a preset time period includes: identifying a first historical abnormal transaction behavior vector based on feature information of the historical transaction behavior vector within the preset time period in multiple dimensions; and calculating a first historical anomaly score based on the relative entropy between the first historical abnormal transaction behavior vector and the historical transaction behavior vector within the preset time period, wherein the relative entropy indicates the degree to which the first historical abnormal transaction behavior vector deviates from the historical transaction behavior vector within the preset time period.
[0011] According to a second aspect of this application, an abnormal transaction behavior detection device is provided, comprising: a reconstruction vector construction module, used to reconstruct a transaction behavior vector based on the time-series analysis results of the transaction behavior vector at the time to be detected, to obtain a reconstructed vector; a feature acquisition module, used to acquire features of the transaction behavior vector and the reconstructed vector in multiple dimensions, including a time domain dimension, a frequency domain dimension, and a graph dimension, wherein the features in the frequency domain dimension include the periodic fluctuation degree of transaction frequency and transaction amount, and the features in the graph dimension indicate the transaction relationship between transaction accounts; a feature deviation acquisition module, used to calculate the feature deviation between the transaction behavior vector and the reconstructed vector in the same dimension; an anomaly score acquisition module, used to perform weighted fusion of the feature deviations of each dimension and the first anomaly probability of the transaction behavior vector to obtain an anomaly score, wherein the first anomaly probability is obtained by inputting the transaction behavior vector into a pre-trained discriminator; and an abnormal transaction behavior detection module, used to identify transaction behaviors represented by transaction behavior vectors with an anomaly score greater than a threshold as abnormal transaction behaviors, wherein the threshold is determined based on historical anomaly scores that follow a generalized Pareto distribution, and the historical anomaly scores change with the time to be detected.
[0012] According to a third aspect of this application, an electronic device is provided, comprising: one or more processors; and a memory for storing one or more computer programs, wherein the one or more processors execute the one or more computer programs to implement the steps of the method described above.
[0013] According to a fourth aspect of this application, a computer-readable storage medium is also provided, on which a computer program or instructions are stored, wherein the computer program or instructions, when executed by a processor, implement the steps of the above-described method.
[0014] According to a fifth aspect of this application, a computer program product is also provided, including a computer program or instructions that, when executed by a processor, implement the steps of the above-described method. Attached Figure Description
[0015] The above-mentioned contents, other objects, features and advantages of this application will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:
[0016] Figure 1 The illustration shows an application scenario of the abnormal transaction behavior detection method, apparatus, device, medium, and program product according to embodiments of this application;
[0017] Figure 2 A flowchart illustrating an abnormal transaction behavior detection method according to an embodiment of this application is shown schematically.
[0018] Figure 3 A schematic diagram illustrating a feature acquisition method according to an embodiment of this application is shown.
[0019] Figure 4 This illustration schematically shows a training method for a discriminator according to an embodiment of the present application;
[0020] Figure 5 A schematic diagram illustrating a threshold update method according to an embodiment of this application is shown.
[0021] Figure 6 This illustration schematically shows another threshold update method according to an embodiment of the present application;
[0022] Figure 7 This schematic diagram illustrates the structural block diagram of an abnormal transaction behavior detection device according to an embodiment of this application;
[0023] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing an abnormal transaction behavior detection method according to an embodiment of this application. Detailed Implementation
[0024] The embodiments of this application will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of this application. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of this application for ease of explanation. However, it will be apparent that one or more embodiments may be implemented without these specific details. Furthermore, descriptions of well-known structures and technologies are omitted in the following description to avoid unnecessarily obscuring the concepts of this application.
[0025] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of this application. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.
[0026] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.
[0027] When using expressions such as "at least one of A, B and C", they should generally be interpreted in accordance with the meaning that is commonly understood by those skilled in the art (e.g., "a system having at least one of A, B and C" should include, but is not limited to, a system having A alone, a system having B alone, a system having C alone, a system having A and B, a system having A and C, a system having B and C, and / or a system having A, B and C, etc.).
[0028] In the technical solution of this application, the user information (including but not limited to user personal information, user image information, user device information, such as location information) and data (including but not limited to data used for analysis, stored data, and displayed data) involved are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of related data all comply with relevant laws, regulations, and standards, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entry points for users to choose to authorize or refuse.
[0029] In scenarios where personal information is used for automated decision-making, the methods, devices, and systems provided in this application all provide users with corresponding operation entry points for users to choose to agree to or reject the automated decision results; if the user chooses to reject, the process enters the expert decision-making process.
[0030] Figure 1 The diagram illustrates an application scenario of the abnormal transaction behavior detection method according to an embodiment of this application. Figure 1 As shown, application scenario 100 according to an embodiment of this application may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables. For example, a user can use the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send information, etc.
[0031] The first terminal device 101, the second terminal device 102, and the third terminal device 103 can be electronic devices such as smartphones, wearable devices, personal computers, intelligent voice interaction devices, smart home appliances, intelligent vehicles, in-vehicle terminals, aircraft, unmanned vending terminals, and extended reality devices. Extended reality devices can include virtual reality devices, augmented reality devices, and mixed reality devices. A client application for the target application can be installed and run on the terminal devices. This target application can include, but is not limited to, financial transaction applications, payment applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, and social media platform software (these are just examples). Furthermore, this application embodiment does not limit the form of the target application, and it can include, but is not limited to, applications, mini-programs, etc., installed on the terminal devices, and can also be in the form of web pages.
[0032] Server 105 can be a server providing various services, such as a backend management server supporting websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103 (this is just an example). The backend management server can analyze and process received user requests and other data, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services such as cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and basic cloud computing services such as big data. The server can be the backend server of the aforementioned target application, used to provide backend services to the clients of the target application.
[0033] It should be noted that the abnormal transaction behavior detection method provided in this application embodiment can generally be executed by server 105 and / or terminal devices 101-103. Accordingly, the abnormal transaction behavior detection device provided in this application embodiment can generally be set in server 105 and / or terminal devices 101-103.
[0034] It should be understood that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.
[0035] Figure 2 A flowchart illustrating an abnormal transaction behavior detection method according to an embodiment of this application is shown schematically. Figure 2 As shown, the abnormal transaction behavior detection method 200 according to the embodiments of this application may include steps S210 to S250.
[0036] In step S210, based on the time-series analysis results of the transaction behavior vector at the time to be detected, the transaction behavior vector is reconstructed to obtain the reconstructed vector.
[0037] In step S220, the features of the transaction behavior vector and the reconstructed vector in multiple dimensions are obtained respectively. The multiple dimensions include the time domain dimension, the frequency domain dimension, and the graph dimension. The features in the frequency domain dimension include the periodic fluctuation degree of transaction frequency and transaction amount, and the features in the graph dimension indicate the transaction relationship between transaction accounts.
[0038] In step S230, the feature deviation between the transaction behavior vector and the reconstructed vector in the same dimension is calculated.
[0039] In step S240, the feature bias of each dimension and the first anomaly probability of the transaction behavior vector are weighted and fused to obtain an anomaly score. The first anomaly probability is obtained by inputting the transaction behavior vector into a pre-trained discriminator.
[0040] In step S250, the transaction behavior represented by the transaction behavior vector with an abnormal score greater than a threshold is regarded as an abnormal transaction behavior. The threshold is determined based on the historical abnormal scores that follow a generalized Pareto distribution, and the historical abnormal scores change with the time to be detected.
[0041] In some embodiments, before collecting the transaction behavior vector at the time to be detected in step S210, the user's consent or authorization may be obtained. For example, before step S210, a request may be sent to the user to obtain the user's transaction behavior vector. If the user's consent or authorization allows the acquisition of the user's transaction behavior vector, the user's transaction behavior vector at the time to be detected is collected.
[0042] In some embodiments, in step S210, the transaction behavior vector includes the distribution of transaction amount, the distribution of transaction time, and the usage of equipment used in each transaction. Before obtaining the transaction behavior vector, the collected raw transaction data of users is preprocessed. The raw transaction data includes transaction amount, transaction time, merchant category, and information on the equipment used during the transaction. Preprocessing includes data cleaning, removal of outliers and missing data, and data standardization. Standardization can unify data of different dimensions belonging to the same feature dimension to the same scale. The feature dimension can be the transaction time dimension or the transaction amount dimension. For example, standardization can unify the dimensions of transaction amount to the same dimension and the dimensions of transaction time to the same dimension. Then, feature extraction is performed on the preprocessed transaction data through a sliding time window to obtain the transaction behavior vector. In this way, the changing patterns of user transaction behavior during the transaction process can be accurately captured, so as to detect abnormal transactions based on the transaction behavior vector in the future.
[0043] For example, suppose the original transaction data is represented by a matrix. express, Represents the real number field. , These represent the number of transactions and the dimensions of information contained in the raw transaction data, respectively. The number of transactions indicates how many transactions were conducted, while the dimensions of information contained in the raw transaction data can include transaction amount, transaction time, and device type. A sliding time window is used... express, For window length, The moment to be tested. Representation matrix By extracting elements from the preprocessed transaction data using a sliding time window, the transaction behavior vector at the time to be detected can be obtained. Furthermore, the standardized transaction behavior vector can be obtained by standardizing the data using the following formula. :
[0044]
[0045] in, , These represent the mean and standard deviation of transaction data for the same feature dimension, respectively. Furthermore, data with categorical attributes can be standardized using read-hot encoding. For example, a device may be a merchant's payment device or a personal payment device; therefore, the attribute of the device category is the category attribute.
[0046] In some embodiments, in step S210, after performing time series analysis on the transaction behavior vector, the transaction behavior vector is mapped to the latent variable space. The time series characteristics of the transaction behavior vector can be obtained in the latent variable space based on the time series analysis results. Based on the time series characteristics of the transaction behavior vector learned from the latent variable space, the transaction behavior vector is reconstructed to obtain the reconstructed vector.
[0047] To reduce the error of the reconstructed vector, a dynamic time warping algorithm can be used to optimize the error. Specifically, let... Represents a transaction behavior vector. The reconstructed vector is defined as the first distance, which is the deviation between any element in the transaction vector and the corresponding element in the reconstructed vector. If a path exists... To minimize the sum of all first distances along the path, the error of the reconstructed vector can be considered minimized. Map the transaction vector and the reconstructed vector to Euclidean space respectively, and use the local distance function... Elements representing the vector of transaction behavior in Euclidean space To the corresponding element in the reconstructed vector The distance, expressed in matrix Represents the front in Euclidean space Each element and its corresponding predecessor The minimum cumulative value of the distances between the elements is the minimum sum of the distances. Therefore, the formula for calculating the minimum value of the sum of all first distances is as follows:
[0048]
[0049] path From arrive The path with the minimum cumulative distance. , They represent The last element in and Zhongyu The corresponding element.
[0050] In some embodiments, in step S220, the features of the transaction behavior vector and the reconstructed vector in the frequency domain dimension are their respective frequency domain features, the features of the transaction behavior vector and the reconstructed vector in the graph dimension are their respective transaction behavior graphs, and the features of the transaction behavior vector and the reconstructed vector in the time domain dimension are their respective time series features. The frequency domain features can be the degree of periodic fluctuation of transaction frequency and transaction indicators, etc. The transaction indicators can be the transaction amount, etc. For example, if the transaction period is one week, the frequency domain features can represent the degree of change of the user's daily transaction amount within this week period. The frequency domain features can also indicate how often the user will conduct a transaction, that is, indicate the transaction frequency.
[0051] In some embodiments, in step S230, a dynamic time warping algorithm can be used to calculate the feature deviation between the transaction behavior vector and the reconstructed vector in the time domain dimension. The feature deviation in the time domain dimension can be called the time series deviation.
[0052] In some embodiments, in step S250, historical transaction behavior vectors for multiple time periods prior to the time to be detected are collected using a sliding time window. Following the anomaly score calculation method indicated by the abnormal transaction behavior detection method 200, historical anomaly scores are calculated for each historical transaction behavior vector. The high quantiles (e.g., 95th percentile, 98th percentile) of each historical anomaly score are used as initial thresholds. Historical anomaly scores greater than the initial threshold are selected from the historical anomaly scores. These historical anomaly scores are then fitted to a generalized Pareto distribution, and the quantiles of the generalized Pareto distribution are calculated to obtain the threshold corresponding to the time to be detected. For the next time to be detected ( +1), based on the historical anomaly scores before the detection time and the anomaly scores corresponding to the detection time, update the initial threshold, and refit the anomaly scores greater than the updated initial threshold to the generalized Pareto distribution, thereby updating the threshold. The updated threshold is used for judgment ( +1) Whether the trading behavior vector at time point is an abnormal trading behavior vector.
[0053] For example,( -1) time, ( -2) time, ( -3) Time... ( The historical anomaly scores corresponding to the historical trading behavior vectors at time -T) are respectively , , ... Where T is an integer greater than 1, and the anomaly score of the transaction behavior vector at the time to be detected is... Based on , , ... The first initial threshold can be obtained from... Historical anomaly scores greater than a first initial threshold are obtained, and these scores are fitted to a generalized Pareto distribution to obtain a threshold for determining whether a transaction behavior vector at the time of detection is an abnormal transaction behavior vector; the anomaly scores are then assigned to... Add to In this process, a new historical anomaly scoring sequence is obtained ( ),based on The initial threshold is recalculated to obtain a second initial threshold. The abnormal scores greater than the second initial threshold are obtained and fitted to a generalized Pareto distribution to obtain a threshold for judging whether the transaction behavior vector at the next detection time is an abnormal transaction behavior vector. In other words, the threshold can change with the detection time. This threshold is dynamically adjusted. By dynamically adjusting the threshold corresponding to the sliding time window, it is possible to more accurately judge whether the transaction at the detection time is an abnormal transaction, improve the detection accuracy, and avoid misjudgment caused by using a fixed threshold to identify abnormal transactions.
[0054] According to embodiments of this application, the difference between the reconstructed vector of a normal trading behavior vector and its corresponding normal trading behavior vector is very small. If the deviation between the reconstructed vector and its corresponding trading behavior vector is large, then the trading behavior vector is likely an abnormal trading behavior vector. Therefore, abnormal trading behavior can be detected based on the feature deviation between the reconstructed vector and the trading behavior vector in the same dimension. Specifically, based on the feature deviation between the trading behavior vector and the reconstructed vector in the frequency domain dimension, the degree of deviation between the reconstructed vector and the trading behavior vector in the frequency domain dimensions such as the periodic fluctuation of trading frequency and trading amount can be obtained. Based on the feature deviation between the trading behavior vector and the reconstructed vector in the graph dimension... It can obtain the degree of deviation between the reconstructed vector and the transaction behavior vector in the graph dimension representing the transaction relationship between accounts. However, the feature deviation in the time domain dimension can only represent the degree of deviation between the reconstructed vector and the transaction behavior vector in terms of transaction time, etc., and cannot uncover the transaction features of the reconstructed vector in deeper dimensions such as the frequency domain dimension and the graph dimension. Combining the feature deviations of the reconstructed vector in the time domain dimension, frequency domain dimension and graph dimension is beneficial to obtain abnormal features in each dimension, which in turn helps to distinguish different types of abnormal transaction behavior vectors. This avoids the inability to detect abnormal transaction behavior in the frequency domain dimension or the graph dimension based solely on features in the time domain dimension, thereby reducing false positives and false negatives and achieving accurate detection.
[0055] Furthermore, using a discriminator to identify abnormal transactions from transaction behavior vectors is suitable for scenarios where abnormal transaction samples are scarce, and can accurately identify novel abnormal transactions. By combining feature bias and the first anomaly probability to obtain an anomaly score, sensitivity to subtle abnormal transactions is preserved while ensuring the ability to identify novel abnormal transactions, thus significantly improving the accuracy of abnormal transaction behavior detection. Comparing the anomaly score with a threshold allows for the detection of abnormal transaction behavior. Moreover, the threshold is derived from historical anomaly scores, which change with the detection time. Specifically, the threshold differs at different detection times; the distribution of historical anomaly scores varies, and therefore, historical anomaly scores following a generalized Pareto distribution may change, leading to different thresholds. This threshold determination method is a dynamic threshold determination method. Comparing the anomaly score with this dynamic threshold further improves detection accuracy and reduces false alarms caused by fixed thresholds. Using a generalized Pareto distribution to determine the threshold accurately distinguishes between historical anomaly scores with relatively minor and extremely minor anomalies, preventing the use of extremely minor historical anomaly scores as the threshold, thereby improving the reliability and accuracy of the threshold.
[0056] Figure 3 A schematic diagram of a feature acquisition method according to an embodiment of this application is shown.
[0057] In some embodiments, the features of the transaction behavior vector and the reconstructed vector in multiple dimensions are obtained respectively, including: performing Fourier transform on the transaction behavior vector and the reconstructed vector respectively to obtain the frequency domain features of the transaction behavior vector and the reconstructed vector in the frequency domain dimension; and extracting the transaction information of the transaction behavior vector and the reconstructed vector respectively to construct the transaction behavior graphs of the transaction behavior vector and the reconstructed vector in the graph dimension, wherein the transaction behavior graphs indicate the transaction relationships between the transaction accounts in the corresponding transaction information.
[0058] like Figure 3As shown, step S310 is performed on transaction behavior vector 301 and reconstructed vector 302 respectively, that is, Fourier transform is performed to obtain their respective frequency domain features. In this way, the temporal features of the transaction behavior vector can be converted into frequency domain features, and the transaction characteristics of the transaction behavior vector can be analyzed in the frequency domain dimension. Similarly, the temporal features of the reconstructed vector can be converted into corresponding frequency domain features, so as to analyze the transaction characteristics of the reconstructed vector in the frequency domain dimension, avoiding the omission of the transaction characteristics of the transaction behavior vector and the reconstructed vector. Further, step S320 can be performed on transaction behavior vector 301 and reconstructed vector 302 respectively, that is, transaction information is extracted to obtain their respective corresponding transaction behavior graphs. The transaction information includes account information and transaction relationships between accounts. For example, the first account information and the transaction relationships between the first accounts are extracted from the transaction behavior vector. The first account information is used as a node and the transaction relationships between the first accounts are used as edges to construct the first transaction behavior graph of the transaction behavior vector. The second account information and the transaction relationships between the second accounts are extracted from the reconstructed vector. The second account information and the transaction relationships between the second accounts are used as nodes and the transaction relationships between the second accounts are used as edges to construct the second transaction behavior graph of the reconstructed vector.
[0059] According to embodiments of this application, by mapping the transaction behavior vector and the reconstructed vector from the time domain to the frequency domain through Fourier transform, the random noise and periodic fluctuations in the time domain can be effectively removed, and the frequency domain features that are difficult to capture in the time domain can be extracted, significantly enhancing the ability to perceive abnormal transactions. Constructing corresponding transaction behavior maps for the transaction behavior vector and the reconstructed vector respectively is beneficial to more clearly describing the transaction relationships between each transaction account, so as to accurately compare the subtle differences in the transaction behavior vector and the reconstructed vector, thereby improving the detection accuracy of subtle abnormal transaction behaviors.
[0060] In some embodiments, before weighted fusion of the feature bias and the first anomaly probability of the trading behavior vector, the method includes: calculating the attention score of the temporal features of the reconstructed vector in the temporal domain dimension, and the attention scores of the frequency domain features and the trading behavior graph corresponding to the reconstructed vector, respectively, based on a gated attention mechanism; assigning the attention score of the temporal features as weights to the feature bias in the temporal domain dimension; assigning the attention score of the frequency domain features of the reconstructed vector as weights to the feature bias in the frequency domain dimension; and assigning the attention score of the trading behavior graph of the reconstructed vector as weights to the feature bias in the graph dimension.
[0061] For example, the inner product of the query vector and key vector of the reconstructed vector temporal feature is calculated to obtain the initial attention score of the temporal feature. This initial attention score characterizes the influence of historical reconstructed vectors on the current reconstructed vector (i.e., the reconstructed vector at the time to be detected). The inner product of the query vector and key vector of the reconstructed vector frequency domain feature is calculated to obtain the initial attention score of the frequency domain feature. The inner product of the query vector and key vector of the reconstructed vector transaction behavior graph is calculated, and combined with the node association term, the initial attention score of the transaction behavior graph is obtained. The node association term indicates the degree of association between nodes in the transaction behavior graph. The temporal features and reconstructed vectors of the reconstructed vector are aggregated. The frequency domain features and the transaction behavior graph of the reconstructed vector are used to obtain the comprehensive features of the reconstructed vector. This comprehensive feature is then input into a gating network to obtain the first gating coefficient corresponding to the temporal features of the reconstructed vector, the second gating coefficient corresponding to the frequency domain features of the reconstructed vector, and the third gating coefficient corresponding to the transaction behavior graph of the reconstructed vector. The first gating coefficient is multiplied by the initial attention score of the temporal features of the reconstructed vector to obtain the attention score of the temporal features. The second gating coefficient is multiplied by the initial attention score of the frequency domain features of the reconstructed vector to obtain the attention score of the frequency domain features. The third gating coefficient is multiplied by the initial attention score of the transaction behavior graph of the reconstructed vector to obtain the attention score of the transaction behavior vector.
[0062] According to the embodiments of this application, weights are assigned to the corresponding deviations based on the temporal features, frequency domain features, and attention scores of the transaction behavior graph of the reconstructed vector. This allows for weighting of the deviations between the reconstructed vector and the transaction behavior vector based on the importance of different dimensions, so as to focus on the deviation values corresponding to more important dimensions and give preference to the deviations under different dimensions, thereby improving the detection accuracy of complex transaction behaviors.
[0063] Figure 4 A schematic diagram illustrating a training method for a discriminator according to an embodiment of this application is shown.
[0064] In some embodiments, the discriminator is trained as follows: In the first stage, the historical transaction behavior vector and the first pseudo-vector are respectively input into the discriminator to obtain their respective second anomaly probabilities, and the first loss function is calculated to update the first model parameters. The first pseudo-vector is obtained by inputting the first random vector into the generator. The first loss function and the first model parameters represent the loss function and model parameters of the discriminator, respectively. The second anomaly probability acquisition and first model parameter update operations are repeated until a preset number of times are reached. In the second stage, the second random vector is input into the generator to obtain the second pseudo-vector, and the second pseudo-vector is input into the discriminator trained in the first stage to obtain the third anomaly probability. Based on the third anomaly probability, the second loss function is calculated and the second model parameters are updated. The second loss function and the second model parameters represent the loss function and model parameters of the generator, respectively. In the third stage, the second pseudo-vector is replaced with the first pseudo-vector, and the operations indicated by the first stage and the second stage are alternately cycled until the first loss function and the second loss function reach Nash equilibrium.
[0065] like Figure 4 As shown, the historical transaction behavior vector 401 and the first pseudo-vector 402 generated by the generator are input into the discriminator 403 to obtain the second abnormal probability of the historical transaction behavior vector 401 and the second abnormal probability of the first pseudo-vector 402. Based on the difference between these two second abnormal probabilities, the first loss function is calculated and the first model parameters are updated to obtain the updated discriminator. This process is repeated several times until a preset number of times is reached to obtain the discriminator 404 after the first stage of training. The second pseudo-vector 405 generated by the generator is input into the discriminator after the first stage of training to obtain the third abnormal probability of the second pseudo-vector. Since the first random vector and the second random vector are different, the second pseudo-vector and the first pseudo-vector are also different.
[0066] Based on the third anomaly probability, the second loss function is calculated and the second model parameters are updated to obtain the generator 406 after the second stage of training. The historical trading behavior vector 401 and the second pseudo vector 407 regenerated by the generator after the second stage of training are input into the discriminator 404 after the first stage of training to obtain the second anomaly probability of the historical trading behavior vector and the second anomaly probability of the regenerated second pseudo vector. Based on the deviation between the two second anomaly probabilities, the first loss function is recalculated and the first model parameters are updated to fine-tune the discriminator. The above three-stage training process is repeated until the first loss function and the second loss function reach Nash equilibrium.
[0067] In other words, the first stage mainly involves keeping the generator unchanged and training the discriminator, that is, enabling the discriminator to accurately distinguish between the pseudo vectors generated by the generator and the real trading behavior vectors; the second stage mainly involves keeping the discriminator trained in the first stage unchanged and training the generator, that is, enabling the generator to generate pseudo vectors that are as close as possible to the real trading behavior vectors, so as to mislead the discriminator; the third stage mainly involves co-training the discriminator and the generator so that even when the generator generates more realistic pseudo trading behavior vectors, the discriminator can still accurately distinguish between pseudo trading behavior vectors and real trading behavior vectors.
[0068] Furthermore, the generator includes an encoder and a decoder. The encoder maps historical trading behavior vectors to a latent variable space to learn the temporal features of these vectors. The decoder then maps these temporal features back to the original space, obtaining reconstructed vectors of the historical trading behavior vectors. Based on this reconstruction process, construction rules can be generated so that the generator can map a first random vector to a first pseudo-vector and a second random vector to a second pseudo-vector according to these rules. The generator's training process involves minimizing the reconstructed vectors, or more specifically, minimizing the difference between random vectors and their corresponding pseudo-vectors. For example, minimizing the difference between the first random vector and the first pseudo-vector, and minimizing the difference between the second random vector and the second pseudo-vector. Specifically, a dynamic time warping algorithm can be used to minimize the difference between random vectors and their corresponding pseudo-vectors. This can be expressed by the following formula:
[0069]
[0070] in, Represents the first random vector The distance between each element and its corresponding element in the corresponding pseudo-vector This represents the number of elements in a random vector.
[0071] Furthermore, the transaction behavior vector at the time to be detected can be input into the trained generator to obtain the reconstructed vector, thereby reducing the error between the reconstructed vector and the transaction behavior vector.
[0072] Furthermore, the first loss function It can be represented as:
[0073]
[0074] in, , These represent the historical transaction behavior vector and the first pseudo-vector, respectively. , Let represent the anomalous probability of the historical transaction behavior vector output by the discriminator and the anomalous probability of the first pseudo-vector, respectively. This indicates the calculation of the expected value. This indicates that a logarithmic operation is being performed.
[0075] Second loss function It can be represented as:
[0076]
[0077] in, , Let them represent the first random vector and the second random vector, respectively. , These represent the first and second pseudo-vectors generated by the generator, respectively. This represents the anomaly probability of the second pseudo-vector output by the discriminator. This represents the L2 norm operation.
[0078] According to the embodiments of this application, in the first stage, a first pseudo-vector generated by the generator and a historical transaction behavior vector are used to train a discriminator, enabling it to distinguish between real and fake transactions. In the second stage, a second pseudo-vector different from the first pseudo-vector is regenerated by the generator. The discriminator trained in the first stage is then used to calculate the anomaly probability of the second pseudo-vector to update the generator, making it generate pseudo-samples that are closer to the real transaction behavior vector. Finally, the historical transaction behavior vector and the updated second pseudo-vector generated by the generator are input into the discriminator. The first and second stages are alternately cyclical until the loss functions of the first and second stages reach Nash equilibrium. Only then can the generator generate samples that are highly similar to the real transaction behavior vector. Furthermore, the discriminator has a strong ability to distinguish abnormal transaction behavior. Therefore, even if an abnormal transaction is a transaction behavior that is extremely similar to a normal transaction, the discriminator trained using this method can still accurately identify such abnormal transaction behavior, thus improving the accuracy of abnormal transaction identification.
[0079] Figure 5 The illustration shows a schematic diagram of a threshold update method according to an embodiment of this application.
[0080] like Figure 5 As shown, method 200 further includes: matching the transaction behavior vector 501 with the preset verification rule 502 and obtaining a matching score 503, wherein the matching score indicates the degree of abnormality of the transaction behavior vector; calculating the confidence level 505 of the abnormal score based on the difference between the abnormal score 504 and the matching score; if the confidence level is less than the preset confidence level, then the matching score is used as the historical abnormal score of the next detection time, and the threshold corresponding to the next detection time is updated, that is, step S510 is executed, and the threshold is updated based on the matching score corresponding to the confidence level that is less than the preset confidence level.
[0081] In some embodiments, the preset verification rules may be: if the amount of a single transaction exceeds A times the user's average daily transaction amount in the past six months, the transaction is judged as an abnormal transaction, where A is an integer greater than 1; or if the current transaction location is a marked abnormal transaction location, the transaction is judged as an abnormal transaction; or if the counterparty account has been involved in abnormal transactions and the user has made multiple large transfers to the counterparty account during the current transaction, the current transaction is judged as an abnormal transaction. If the transaction features in the current transaction (or transaction behavior vector) highly match the transaction features in the preset verification rules, it indicates that the current transaction is likely to be an abnormal transaction, and the matching score is high. If, in this case, the abnormal score of the current transaction is less than the threshold, the conclusion drawn by the abnormal transaction behavior detection method 200 of this application is that the current transaction is not an abnormal transaction. Calculating the confidence between the abnormal score and the matching score of the current transaction, the confidence is low, indicating that the threshold may need to be adjusted. Compared with the user's previous transaction behavior, the current transaction may have undergone a sudden change, so the threshold obtained based on historical abnormal scores is not accurate enough to judge the abnormal behavior of the transaction. Therefore, it is necessary to adjust the threshold according to the matching score so that the abnormal transaction in this sudden transaction behavior can be accurately identified in the next abnormal transaction detection, thereby improving the accuracy of abnormal transaction detection.
[0082] In some embodiments, if the confidence level is less than a preset confidence level, the first model parameters and the second model parameters can be adjusted according to the matching score. For example, multiplying the first learning rate by the first model parameters and then adding it to the first model parameters before adjustment yields the adjusted first model parameters; multiplying the second learning rate by the second model parameters and then adding it to the second model parameters before adjustment yields the adjusted second model parameters; the first learning rate and the second learning rate are used to control the step size of the adjustment required for the first model parameters and the second model parameters, respectively.
[0083] According to the embodiments of this application, by updating the threshold corresponding to the next detection time based on the matching score, the threshold can be dynamically adjusted, making the threshold closer to the actual transaction scenario, thereby greatly improving the detection accuracy.
[0084] Figure 6 The illustration shows a schematic diagram of another threshold update method according to an embodiment of this application.
[0085] In some embodiments, method 200 further includes: if the time to be detected is within a preset time period, obtaining a first historical anomaly score 602 for a first historical abnormal transaction within the preset time period and a second historical anomaly score 601 for a second historical abnormal transaction outside the preset time period; determining a first threshold 605 within the preset time period based on the first historical anomaly score, the first threshold being used to distinguish between abnormal transactions and normal transactions within the preset time period; determining a second threshold 604 outside the preset time period based on the second historical anomaly score 603 following a generalized Pareto distribution, the second threshold being used to distinguish between abnormal transactions and normal transactions outside the preset time period; and performing weighted processing on the first threshold and the second threshold to obtain a threshold, i.e., executing step S610, performing weighted processing on the first threshold 605 and the second threshold 604, and updating the threshold.
[0086] For example, a preset time period can refer to special periods, such as annual promotional periods or annual wealth management promotion periods. During these special periods, users' transaction characteristics may change significantly compared to their usual trading habits. For instance, some users may purchase a large number of wealth management products during promotional periods, but their daily transaction amounts are relatively small, which is quite different from their usual trading behavior. However, this does not necessarily mean that the user's trading behavior during this period is abnormal. In this case, the threshold needs to be updated. The first historical anomaly score within the preset time period and the second historical anomaly score outside the preset time period are separated, and the thresholds for these two time periods are calculated separately to determine the final threshold, so as to accurately identify whether the trading behavior during special periods is abnormal. For example, the second threshold outside the preset time period can be calculated based on the second historical anomaly score that follows a generalized Pareto distribution. The difference between the first historical anomaly score and the historical matching score obtained by matching the historical trading behavior vector within the preset time period with the preset verification rules can be calculated to further determine the first threshold within the preset time period. By weighting the first threshold and the second threshold, the threshold can be obtained again.
[0087] According to an embodiment of this application, if the time to be detected is within a preset time period, the transaction behavior within this time period generally differs significantly from historical transaction behavior. However, this does not necessarily mean that all transactions within this time period are abnormal transactions. In this case, it is necessary to redetermine the threshold to accurately determine whether the transactions within this time period are abnormal transactions. That is, a first threshold is determined based on the first historical abnormal score within the preset time period, and a second threshold is determined based on the second historical abnormal score outside the preset time period. The first threshold and the second threshold are weighted to obtain a new threshold. Using this threshold, it is possible to accurately identify which transactions within the preset time period are abnormal transactions, thereby reducing the false alarm rate.
[0088] In some embodiments, obtaining a first historical anomaly score for a first historical abnormal transaction within a preset time period includes: identifying a first historical abnormal transaction behavior vector based on feature information of the historical transaction behavior vector within the preset time period in multiple dimensions; and calculating a first historical anomaly score based on the relative entropy between the first historical abnormal transaction behavior vector and the historical transaction behavior vector within the preset time period, wherein the relative entropy indicates the degree to which the first historical abnormal transaction behavior vector deviates from the historical transaction behavior vector within the preset time period.
[0089] For example, assuming the preset time period is the annual financial promotion period, the historical transaction behavior vector within the preset time period refers to the transaction behavior vector of the same user during the financial promotion period of previous years. Analyze the temporal characteristics, frequency domain characteristics, and transaction behavior pattern characteristics of user A's transaction behavior vector during the financial promotion period of previous years (i.e., historical transaction behavior vector) to identify user A's abnormal transaction behavior vector during the financial promotion period of previous years, i.e., the first historical abnormal transaction behavior vector; calculate the first historical abnormal score by calculating the relative entropy between user A's first historical abnormal transaction behavior vector and the historical transaction behavior vector during the financial promotion period of previous years.
[0090] According to the embodiments of this application, by calculating the relative entropy between the first historical abnormal transaction behavior vector and the historical transaction behavior vector within a preset time period, abnormal transaction behaviors with relatively hidden abnormal transaction characteristics can be accurately captured. Then, based on the relative entropy, the first historical abnormal score can be calculated, which can accurately assess the degree of abnormality of the first historical abnormal transaction behavior vector, thereby facilitating the setting of the corresponding threshold within the preset time period.
[0091] Based on the above-described abnormal transaction behavior detection method, embodiments of this application also provide an abnormal transaction behavior detection device. The following will be combined with... Figure 7 The device is described in detail.
[0092] Figure 7 The diagram illustrates the structure of an abnormal transaction behavior detection device according to an embodiment of this application.
[0093] like Figure 7 As shown, the abnormal transaction behavior detection device 700 of this embodiment includes a reconstruction vector construction module 710, a feature acquisition module 720, a feature deviation acquisition module 730, an abnormal score acquisition module 740, and an abnormal transaction behavior detection module 750.
[0094] The reconstructed vector construction module 710 is used to reconstruct the transaction behavior vector based on the time-series analysis results of the transaction behavior vector at the time to be detected, thereby obtaining the reconstructed vector. In one embodiment, the reconstructed vector construction module 710 can be used to execute step S210 described above, which will not be repeated here.
[0095] The feature acquisition module 720 is used to acquire features of the transaction behavior vector and the reconstructed vector in multiple dimensions, including time domain, frequency domain, and graph dimension. Features in the frequency domain dimension include the periodic fluctuations in transaction frequency and transaction amount, while features in the graph dimension indicate the transaction relationships between transaction accounts. In one embodiment, the feature acquisition module 720 can be used to execute step S220 described above, which will not be repeated here.
[0096] The feature deviation acquisition module 730 is used to calculate the feature deviation between the transaction behavior vector and the reconstructed vector in the same dimension. In one embodiment, the feature deviation and time series deviation acquisition module 730 can be used to execute step S230 described above, which will not be repeated here.
[0097] The anomaly score acquisition module 740 is used to perform weighted fusion of the feature bias of each dimension and the first anomaly probability of the transaction behavior vector to obtain an anomaly score. The first anomaly probability is obtained by inputting the transaction behavior vector into a pre-trained discriminator. In one embodiment, the anomaly score acquisition module 740 can be used to perform step S240 described above, which will not be repeated here.
[0098] The abnormal transaction behavior detection module 750 is used to identify transaction behaviors represented by transaction behavior vectors with abnormal scores greater than a threshold as abnormal transaction behaviors. The threshold is determined based on historical abnormal scores that follow a generalized Pareto distribution, and the historical abnormal scores change with the time of detection. In one embodiment, the abnormal transaction identification module 750 can be used to perform step S250 described above, which will not be repeated here.
[0099] According to the embodiments of this application, the abnormal transaction behavior detection device 700 can not only improve the ability to identify subtle abnormal transactions, but also accurately detect new types of abnormal transactions, thereby improving the detection accuracy of abnormal transaction behavior.
[0100] In some embodiments, the feature acquisition module 720 is specifically used to: perform Fourier transform on the transaction behavior vector and the reconstructed vector respectively to obtain the frequency domain features of the transaction behavior vector and the reconstructed vector in the frequency domain dimension; and extract the transaction information of the transaction behavior vector and the reconstructed vector respectively to construct the transaction behavior graphs of the transaction behavior vector and the reconstructed vector in the graph dimension, wherein the transaction behavior graphs indicate the transaction relationships between the transaction accounts in the corresponding transaction information.
[0101] In some embodiments, the abnormal transaction behavior detection device 700 is further configured to: calculate, based on a gated attention mechanism, the attention score of the temporal features of the reconstructed vector in the time domain dimension, and the attention scores of the frequency domain features and the transaction behavior graph corresponding to the reconstructed vector; assign the attention score of the temporal features as weights to the feature deviations in the time domain dimension; assign the attention score of the frequency domain features of the reconstructed vector as weights to the feature deviations in the frequency domain dimension; and assign the attention score of the transaction behavior graph of the reconstructed vector as weights to the feature deviations in the graph dimension.
[0102] In some embodiments, the anomaly scoring acquisition module 740 further includes a discriminator training module, which is specifically used for: In a first stage, inputting the historical transaction behavior vector and the first pseudo-vector into the discriminator to obtain their respective second anomaly probabilities, and calculating the first loss function to update the first model parameters. The first pseudo-vector is obtained by inputting the first random vector into the generator. The first loss function and the first model parameters represent the loss function and model parameters of the discriminator, respectively. Repeating the second anomaly probability acquisition and first model parameter update operations until a preset number of times is reached; In a second stage, inputting the second random vector into the generator to obtain the second pseudo-vector, and inputting the second pseudo-vector into the discriminator trained in the first stage to obtain the third anomaly probability; Based on the third anomaly probability, calculating the second loss function and updating the second model parameters. The second loss function and the second model parameters represent the loss function and model parameters of the generator, respectively; In a third stage, replacing the first pseudo-vector with the second pseudo-vector, and alternately cycling the operations indicated by the first and second stages until the first and second loss functions reach Nash equilibrium.
[0103] In some embodiments, the abnormal transaction behavior detection device 700 is further configured to: match the transaction behavior vector with a preset verification rule and obtain a matching score, wherein the matching score indicates the degree of abnormality of the transaction behavior vector; calculate the confidence level of the abnormal score based on the difference between the abnormal score and the matching score; if the confidence level is less than a preset confidence level, use the matching score as the historical abnormal score for the next detection time and update the threshold corresponding to the next detection time.
[0104] In some embodiments, the abnormal transaction behavior detection device 700 is further configured to: if the time to be detected is within a preset time period, obtain a first historical abnormal score of a first historical abnormal transaction within the preset time period and a second historical abnormal score of a second historical abnormal transaction outside the preset time period; determine a first threshold within the preset time period based on the first historical abnormal score, the first threshold being used to distinguish between abnormal transactions and normal transactions within the preset time period; determine a second threshold outside the preset time period based on the second historical abnormal score which follows a generalized Pareto distribution, the second threshold being used to distinguish between abnormal transactions and normal transactions outside the preset time period; and perform weighted processing on the first threshold and the second threshold to obtain a threshold value.
[0105] In some embodiments, the abnormal transaction behavior detection device 700 is further configured to: identify a first historical abnormal transaction behavior vector based on the feature information of historical transaction behavior vectors in multiple dimensions within a preset time period; and calculate a first historical abnormality score based on the relative entropy between the first historical abnormal transaction behavior vector and the historical transaction behavior vectors within the preset time period, wherein the relative entropy indicates the degree to which the first historical abnormal transaction behavior vector deviates from the historical transaction behavior vectors within the preset time period.
[0106] According to embodiments of this application, any multiple modules among the reconstruction vector construction module 710, feature acquisition module 720, feature deviation acquisition module 730, anomaly scoring acquisition module 740, and abnormal transaction behavior detection module 750 can be merged into one module, or any one of these modules can be split into multiple modules. Alternatively, at least part of the functionality of one or more of these modules can be combined with at least part of the functionality of other modules and implemented in one module. According to embodiments of this application, at least one of the reconstruction vector construction module 710, feature acquisition module 720, feature deviation acquisition module 730, anomaly scoring acquisition module 740, and abnormal transaction behavior detection module 750 can be at least partially implemented as hardware circuits, such as field-programmable gate arrays, programmable logic arrays, systems-on-a-chip, systems-on-a-substrate, systems-on-package, application-specific integrated circuits, or other reasonable means of integrating or packaging circuits, or implemented in hardware or firmware, or in any one of software, hardware, and firmware implementations, or in a suitable combination of any of these. Alternatively, at least one of the reconstruction vector construction module 710, feature acquisition module 720, feature deviation acquisition module 730, anomaly scoring acquisition module 740, and abnormal transaction behavior detection module 750 can be at least partially implemented as a computer program module, which can perform corresponding functions when the computer program module is run.
[0107] Figure 8 A block diagram schematically illustrates an electronic device suitable for implementing an abnormal transaction behavior detection method according to an embodiment of this application.
[0108] like Figure 8 As shown, an electronic device 800 according to an embodiment of this application includes a processor 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory 802 or a program loaded from a storage portion 808 into a random access memory 803. The processor 801 may include, for example, a general-purpose microprocessor, an instruction set processor and / or an associated chipset and / or a dedicated microprocessor. The processor 801 may also include onboard memory for caching purposes. The processor 801 may include a single processing unit or multiple processing units for executing different steps of the method flow according to an embodiment of this application.
[0109] Random access memory 803 stores various programs and data required for the operation of electronic device 800. Processor 801, read-only memory 802, and random access memory 803 are interconnected via bus 804. Processor 801 executes various steps of the method flow according to embodiments of this application by executing programs stored in read-only memory 802 and / or random access memory 803. It should be noted that the programs may also be stored in one or more memories other than read-only memory 802 and random access memory 803. Processor 801 may also execute various steps of the method flow according to embodiments of this application by executing programs stored in said one or more memories.
[0110] According to embodiments of this application, the electronic device 800 may further include an input / output interface 805, which is also connected to a bus 804. The electronic device 800 may also include one or more of the following components connected to the input / output interface 805: an input section 806 including a keyboard, mouse, etc.; an output section 807 including a cathode ray tube, liquid crystal display, etc., and a speaker, etc.; a storage section 808 including a hard disk, etc.; and a communication section 809 including a network interface card, such as a local area network card, modem, etc. The communication section 809 performs communication processing via a network such as the Internet. A drive 810 is also connected to the input / output interface 805 as needed. A removable medium 811, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 810 as needed so that computer programs read from it can be installed into the storage section 808 as needed.
[0111] Embodiments of this application also provide a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or it may exist independently and not assembled into the device / apparatus / system. The computer-readable storage medium carries one or more programs, which, when executed, implement the method according to the embodiments of this application.
[0112] According to embodiments of this application, the computer-readable storage medium can be a non-volatile computer-readable storage medium, such as including but not limited to: portable computer disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, portable compact disk read-only memory, optical storage devices, magnetic storage devices, or any suitable combination thereof. In embodiments of this application, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. For example, according to embodiments of this application, the computer-readable storage medium may include the read-only memory 802 described above, and / or random access memory 803, and / or one or more memories other than read-only memory 802 and random access memory 803.
[0113] Embodiments of this application also include a computer program product comprising a computer program containing program code for performing the methods shown in the flowchart. When the computer program product is run on a computer system, the program code is used to cause the computer system to implement the methods provided in the embodiments of this application.
[0114] In one embodiment, the computer program may rely on a tangible storage medium such as an optical storage device or a magnetic storage device. In another embodiment, the computer program may also be transmitted and distributed in the form of signals over a network medium, and may be downloaded and installed via the communication section 809, and / or installed from a removable medium 811. The program code contained in the computer program can be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination thereof.
[0115] In embodiments of this application, the computer program can be downloaded and installed from a network via communication section 809, and / or installed from removable medium 811. When the computer program is executed by processor 801, it performs the functions defined in the system of embodiments of this application. According to embodiments of this application, the systems, devices, apparatuses, modules, units, etc., described above can be implemented by computer program modules.
[0116] According to embodiments of this application, program code for executing the computer programs provided in the embodiments of this application can be written in any combination of one or more programming languages. Specifically, these computational programs can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. The program code can be executed entirely on the user's computing device, partially on the user's device, partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0117] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0118] Those skilled in the art will understand that the features described in the various embodiments of this application can be combined and / or combined in various ways, even if such combinations or combinations are not explicitly described in this application. In particular, the features described in the various embodiments of this application can be combined and / or combined in various ways without departing from the spirit and teachings of this application. All such combinations and / or combinations fall within the scope of this application.
Claims
1. A method for detecting abnormal transaction behavior, characterized in that, The method includes: Based on the time-series analysis results of the transaction behavior vector at the time to be detected, the transaction behavior vector is reconstructed to obtain the reconstructed vector; The features of the transaction behavior vector and the reconstructed vector in multiple dimensions are obtained respectively. The multiple dimensions include time domain dimension, frequency domain dimension and graph dimension. The features in the frequency domain dimension include the periodic fluctuation degree of transaction frequency and transaction amount, and the features in the graph dimension indicate the transaction relationship between transaction accounts. Calculate the feature deviation between the transaction behavior vector and the reconstructed vector in the same dimension; The feature biases of each dimension and the first anomaly probability of the transaction behavior vector are weighted and fused to obtain an anomaly score. The first anomaly probability is obtained by inputting the transaction behavior vector into a pre-trained discriminator. The transaction behavior represented by the transaction behavior vector with the abnormal score greater than the threshold is regarded as abnormal transaction behavior. The threshold is determined based on the historical abnormal score that follows a generalized Pareto distribution. The historical abnormal score changes with the time to be detected.
2. The method according to claim 1, characterized in that, The step of obtaining the features of the transaction behavior vector and the reconstructed vector in multiple dimensions includes: Perform Fourier transforms on the transaction behavior vector and the reconstructed vector respectively to obtain the frequency domain features of the transaction behavior vector and the reconstructed vector in the frequency domain dimension; and The transaction information of the transaction behavior vector and the reconstructed vector are extracted respectively, and transaction behavior graphs are constructed for the transaction behavior vector and the reconstructed vector respectively in the graph dimension. The transaction behavior graphs indicate the transaction relationships between each transaction account in the corresponding transaction information.
3. The method according to claim 2, characterized in that, Before the weighted fusion of the feature bias and the first anomaly probability of the transaction behavior vector, the following steps are included: Based on the gated attention mechanism, the attention scores of the temporal features of the reconstructed vector in the time domain dimension, as well as the attention scores of the frequency domain features and the transaction behavior graph corresponding to the reconstructed vector, are calculated respectively. The attention scores of the temporal features are used as weights to assign to the feature biases in the temporal dimension; The attention score of the frequency domain feature of the reconstructed vector is used as a weight to assign to the feature bias in the frequency domain dimension; The attention score of the transaction behavior graph of the reconstructed vector is used as a weight to assign to the feature bias of the graph dimension.
4. The method according to claim 1, characterized in that, The discriminator is trained in the following way: In the first stage, the historical transaction behavior vector and the first pseudo vector are respectively input into the discriminator to obtain their respective second anomaly probabilities, and the first loss function is calculated to update the first model parameters. The first pseudo vector is obtained by inputting the first random vector into the generator. The first loss function and the first model parameters represent the loss function and model parameters of the discriminator, respectively. Repeat the second anomaly probability acquisition and first model parameter update operation until the preset number of times is reached; In the second stage, the second random vector is input into the generator to obtain the second pseudo vector, and the second pseudo vector is input into the discriminator trained in the first stage to obtain the third anomaly probability. Based on the third anomaly probability, a second loss function is calculated and the second model parameters are updated. The second loss function and the second model parameters represent the loss function and model parameters of the generator, respectively. In the third stage, the first pseudo-vector is replaced with the second pseudo-vector, and the operations indicated by the first and second stages are alternately cycled until the first loss function and the second loss function reach Nash equilibrium.
5. The method according to claim 1, characterized in that, The method further includes: The transaction behavior vector is matched with preset verification rules, and a matching score is obtained. The matching score indicates the degree of abnormality of the transaction behavior vector. The confidence level of the anomaly score is calculated based on the difference between the anomaly score and the matching score. If the confidence level is less than the preset confidence level, the matching score is used as the historical anomaly score for the next detection time, and the threshold corresponding to the next detection time is updated.
6. The method according to claim 1, characterized in that, The method further includes: If the time to be detected is within a preset time period, then the first historical abnormal score of the first historical abnormal transaction within the preset time period and the second historical abnormal score of the second historical abnormal transaction outside the preset time period are obtained. Based on the first historical anomaly score, a first threshold is determined within the preset time period. The first threshold is used to distinguish between abnormal transactions and normal transactions within the preset time period. Based on the second historical anomaly score that follows the generalized Pareto distribution, a second threshold is determined for the non-preset time period. The second threshold is used to distinguish between abnormal transactions and normal transactions within the non-preset time period. The first threshold and the second threshold are weighted to obtain the threshold.
7. The method according to claim 6, characterized in that, The step of obtaining the first historical anomaly score of the first historical anomaly transaction within a preset time period includes: Based on the feature information of historical transaction behavior vectors within a preset time period in the multiple dimensions, the first historical abnormal transaction behavior vector is identified. Based on the relative entropy between the first historical abnormal transaction behavior vector and the historical transaction behavior vector within a preset time period, the first historical abnormality score is calculated. The relative entropy indicates the degree to which the first historical abnormal transaction behavior vector deviates from the historical transaction behavior vector within the preset time period.
8. An abnormal transaction behavior detection device, characterized in that, The device includes: The reconstruction vector construction module is used to reconstruct the transaction behavior vector based on the time series analysis results of the transaction behavior vector at the time to be detected, and obtain the reconstructed vector; The feature acquisition module is used to acquire features of the transaction behavior vector and the reconstructed vector in multiple dimensions, including time domain dimension, frequency domain dimension and graph dimension. The features in the frequency domain dimension include the periodic fluctuation degree of transaction frequency and transaction amount, and the features in the graph dimension indicate the transaction relationship between transaction accounts. The feature deviation acquisition module is used to calculate the feature deviation between the transaction behavior vector and the reconstructed vector in the same dimension; An anomaly score acquisition module is used to perform weighted fusion of the feature deviations of each dimension and the first anomaly probability of the transaction behavior vector to obtain an anomaly score. The first anomaly probability is obtained by inputting the transaction behavior vector into a pre-trained discriminator. An abnormal transaction behavior detection module is used to identify transaction behaviors represented by transaction behavior vectors with abnormal scores greater than a threshold as abnormal transaction behaviors. The threshold is determined based on historical abnormal scores that follow a generalized Pareto distribution, and the historical abnormal scores change with the time of detection.
9. An electronic device, comprising: One or more processors; Memory, used to store one or more computer programs. The characteristic feature is that the one or more processors execute the one or more computer programs to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.
11. A computer program product, comprising a computer program or instructions, characterized in that, When the computer program or instructions are executed by a processor, they implement the steps of the method according to any one of claims 1 to 7.
