A method and apparatus for identifying transaction risks
By employing feature extraction, dimensionality reduction, and classification models, the limitations of static rules in blockchain risk management are overcome, enabling effective identification of complex attacks and fraud, thereby improving the accuracy of transaction risk identification and the security of the blockchain network.
Patent Information
- Application Number
- CN202411314262.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Traditional blockchain risk management methods rely on static rules, which are difficult to effectively deal with complex and ever-changing attack and fraud strategies. Furthermore, the decentralized nature of blockchain networks leads to limitations in data acquisition and processing.
We employ feature extraction, feature dimensionality reduction, and risk classification models, and utilize population algorithms, manifold learning, and energy entropy support vector machines to process transaction data, thereby improving the accuracy of risk identification.
It improves the accuracy of transaction risk identification, can cope with complex and ever-changing attack and fraud strategies, and enhances the security of the blockchain network.
Smart Images

Figure CN119323424B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data analysis technology, and in particular to a method and apparatus for identifying transaction risks. Background Technology
[0002] Blockchain, as a distributed technology, possesses the characteristics of ensuring data immutability and transparency through encryption, and has been widely applied in various fields such as financial transactions and supply chain management. However, with the increasing number of blockchain applications, transaction security and privacy protection have become important issues. Especially in the financial sector, how to effectively identify and manage risks in transactions and prevent fraud and attacks is one of the core problems that blockchain technology needs to solve.
[0003] Traditional blockchain risk management relies primarily on static rules, which are often ineffective against complex and ever-changing attack and fraud strategies. Furthermore, due to the decentralized nature of blockchain networks, it is difficult for a single node to have a comprehensive grasp of all network transactions, limiting the data acquisition and processing capabilities of traditional methods. Summary of the Invention
[0004] This application provides a method and apparatus for identifying transaction risks, which can improve the accuracy of transaction risk identification.
[0005] In a first aspect, embodiments of this application provide a method for identifying transaction risks. This method can be executed by a transaction risk identification device. The method includes: inputting transaction data into a feature extraction model to obtain transaction feature data, wherein the transaction feature data represents multidimensional feature information of the transaction data; the transaction data includes multiple transaction attribute information; the feature extraction model is obtained by iteratively processing individual samples using a population algorithm with model parameters as individuals; inputting the transaction feature data into a feature dimensionality reduction model to obtain transaction dimensionality reduction data, wherein the transaction dimensionality reduction data represents dimensionality reduction feature information of the transaction feature data; the feature dimensionality reduction model performs dimensionality reduction processing on samples through manifold learning; inputting the transaction dimensionality reduction data into a risk classification model to obtain category labels for the transaction data, wherein the category labels represent the risk level of the transaction data; the risk classification model performs classification using a support vector machine based on energy entropy.
[0006] By employing the above method and processing transaction data through three neural network models, we can cope with complex and ever-changing attack and fraud strategies, thereby improving the accuracy of transaction risk identification.
[0007] In one possible implementation, the feature extraction model is obtained by iterating through a population algorithm, with model parameters as individuals. This includes: determining an initial population of individuals for the feature extraction model, where each individual represents a set of model parameters, and any set of model parameters is determined by a weight vector and a bias vector; iterating through the initial population individuals until an optimal individual that satisfies the iteration termination condition is obtained; and determining the feature extraction model based on the optimal individual. Each population iteration process is as follows: calculating the fitness function value of an individual based on its dynamic stability and accuracy, where the accuracy characterizes the predictive accuracy of the feature extraction model corresponding to that individual in transaction risk identification, and the dynamic stability characterizes the sensitivity of the weight vector in that individual to the loss function; and determining the individuals for the next population iteration based on the fitness function values of each individual.
[0008] The feature extraction model employs a population algorithm, which effectively improves the stability and accuracy of feature extraction.
[0009] In one possible implementation, the feature dimensionality reduction model reduces the dimensionality of samples through manifold learning, including: determining the initial parameters of the feature dimensionality reduction model, which includes an encoder and a decoder; determining the final values of the parameters of the feature dimensionality reduction model by performing multiple iterations on the encoder and the decoder; and determining the feature dimensionality reduction model based on the final values of the parameters. Each iteration process is as follows: encoding the transaction feature data using the encoder to obtain transaction feature encoded data; calculating the manifold constraint loss based on the transaction feature encoded data and the dimensionality-reduced data corresponding to the nearest neighbor transaction feature data; decoding the transaction feature encoded data using the decoder to obtain transaction feature decoded data; obtaining the reconstruction loss based on the transaction feature data and the transaction feature decoded data; calculating the total loss function based on the reconstruction loss and the manifold constraint loss; and determining the parameters for the next iteration based on the total loss function and the parameters of the feature dimensionality reduction model in the current iteration.
[0010] By adopting the above feature dimensionality reduction model, not only is the complexity of the feature space reduced, but the important geometric and topological properties of the transaction data are also preserved, making the feature dimensionality reduction model better reflect the inherent structure of the transaction data.
[0011] In one possible implementation, before encoding the transaction feature data according to the encoder, the method further includes: performing random masking on the transaction feature data.
[0012] In one possible implementation, the risk classification model is performed using a support vector machine based on energy entropy, comprising: determining the initial parameters of the risk classification model; determining the final values of the parameters of the risk classification model through multiple iterations; and determining the risk classification model based on the final values of the parameters. Each iteration process is as follows: calculating the energy of the transaction dimensionality-reduced data based on the distance between the transaction dimensionality-reduced data and the support vectors; the support vectors are transaction dimensionality-reduced data whose distance from the decision boundary is less than a set threshold; calculating the loss function value based on the parameters of the risk classification model in this iteration, the energy of the transaction dimensionality-reduced data, and the prediction of the transaction dimensionality-reduced data by the risk classification model; and calculating the value of the parameters in the next iteration based on the dynamic adjustment factor, the parameters of this iteration, and the loss function value.
[0013] The risk classification model described above uses energy entropy characteristics to make the classification process more accurate and can effectively handle the boundary problems of different categories of data.
[0014] In one possible implementation, the dynamic adjustment factor is determined based on a preset maximum value of the dynamic adjustment factor, a preset minimum value of the dynamic adjustment factor, a preset baseline loss function value, the difference between the loss function value of the current iteration and the loss function value of the previous iteration.
[0015] In one possible implementation, the method further includes generating samples through a data augmentation model, which is obtained by: determining initial parameters of the data augmentation model, the data augmentation model including a generator and a discriminator; acquiring multiple real transaction data sets; performing multiple iterations on the generator and the discriminator based on the multiple real transaction data sets to determine the final parameter values of the generator in the data augmentation model; determining the generator based on the final parameter values of the generator; wherein each iteration process is as follows: calculating the structural similarity loss function value of the generator based on the real transaction data and the generated transaction data output by the generator; calculating the loss function value of the generator based on the structural similarity loss function value of the generator; calculating the loss function value of the discriminator based on the variance of the generated transaction data output by the generator and the discriminator influence factor; the discriminator influence factor is determined based on the gradient value of the structural similarity loss function value; calculating the parameters of the generator in the next iteration based on the loss function value of the generator; calculating the parameters of the discriminator in the next iteration based on the loss function value of the discriminator.
[0016] The above-mentioned data augmentation model improves the quality and diversity of the transaction data used for training, effectively enhancing the model's ability to generalize to unknown samples.
[0017] In one possible implementation, the plurality of transaction attribute information includes at least one of the following: transaction identifier, transaction timestamp, transaction address, transaction amount, transaction status, smart contract call information, and blockchain height.
[0018] Secondly, embodiments of this application provide a transaction risk identification device, the device comprising: a first processing module, configured to input transaction data into a feature extraction model to obtain transaction feature data, the transaction feature data representing multidimensional feature information of the transaction data; the transaction data including multiple transaction attribute information; the feature extraction model being obtained by iterative individual processing using a population algorithm with model parameters as individuals; a second processing module, configured to input the transaction feature data into a feature dimensionality reduction model to obtain transaction dimensionality reduction data, the transaction dimensionality reduction data representing dimensionality reduction feature information of the transaction feature data; the feature dimensionality reduction model performing dimensionality reduction processing on samples through manifold learning; and a third processing module, configured to input the transaction dimensionality reduction data into a risk classification model to obtain category labels for the transaction data, the category labels representing the risk level of the transaction data; the risk classification model performing classification using a support vector machine based on energy entropy.
[0019] In one possible implementation, the apparatus further includes a determining module, which is used to determine an initial population of individuals for the feature extraction model, each individual representing a set of model parameters of the feature extraction model, wherein any set of model parameters is determined by a weight vector and a bias vector; the first processing module is further used to perform individual iteration on the initial population individuals to achieve population iteration until an optimal individual that satisfies the iteration termination condition is obtained; the determining module is further used to determine the feature extraction model based on the optimal individual; in each iteration, the first processing module is specifically used to calculate the fitness function value of an individual based on the individual's dynamic stability and the individual's accuracy, wherein the individual's accuracy characterizes the predictive accuracy of the feature extraction model corresponding to the individual in transaction risk identification, and the individual's dynamic stability characterizes the sensitivity of the weight vector in the individual to the loss function; the determining module is further used to determine the individuals in the next population iteration based on the fitness function values of each individual.
[0020] In one possible implementation, the determining module is further configured to determine the initial parameters of the feature dimensionality reduction model, the feature dimensionality reduction model including an encoder and a decoder; the second processing module is further configured to determine the final values of the parameters of the feature dimensionality reduction model by performing multiple iterations on the encoder and the decoder; the determining module is further configured to determine the feature dimensionality reduction model based on the final values of the parameters of the feature dimensionality reduction model; in each iteration, the second processing module is specifically configured to: encode the transaction feature data according to the encoder to obtain transaction feature encoded data; calculate the manifold constraint loss according to the transaction feature encoded data and the dimensionality-reduced data corresponding to the nearest neighbor transaction feature data of the transaction feature data; decode the transaction feature encoded data according to the decoder to obtain transaction feature decoded data; obtain the reconstruction loss according to the transaction feature data and the transaction feature decoded data; calculate the total loss function according to the reconstruction loss and the manifold constraint loss; the determining module is further configured to determine the parameters in the next iteration according to the total loss function and the parameters of the feature dimensionality reduction model in the current iteration.
[0021] In one possible implementation, the second processing module is further configured to perform random masking on the transaction feature data.
[0022] In one possible implementation, the determining module is further configured to determine the initial parameters of the risk classification model, and the third processing module is further configured to determine the final values of the parameters of the risk classification model by performing multiple iterations on the risk classification model; the determining module is further configured to determine the risk classification model based on the final values of the parameters of the risk classification model; in each iteration, the third processing module is specifically configured to calculate the energy of the transaction dimensionality reduction data based on the distance between the transaction dimensionality reduction data and the support vectors; the support vectors are transaction dimensionality reduction data whose distance from the decision boundary is less than a set threshold; calculate the loss function value based on the parameters of the risk classification model in this iteration, the energy of the transaction dimensionality reduction data, and the prediction of the transaction dimensionality reduction data by the risk classification model; and calculate the value of the parameters in the next iteration based on the dynamic adjustment factor, the parameters of this iteration, and the loss function value.
[0023] In one possible implementation, the determining module is further configured to determine the initial parameters of the data augmentation model, the data augmentation model including a generator and a discriminator; the device further includes a fourth processing module, the fourth processing module being configured to acquire multiple pieces of real transaction data, and perform multiple iterations on the generator and the discriminator based on the multiple pieces of real transaction data to determine the final value of the generator's parameters in the data augmentation model; the determining module is further configured to determine the generator based on the final value of the generator's parameters; in each iteration, the fourth processing module is specifically configured to determine the generator based on the real transaction data. Based on the generated transaction data output by the generator, calculate the structural similarity loss function value of the generator; based on the structural similarity loss function value of the generator, calculate the loss function value of the generator; based on the variance of the generated transaction data output by the generator and the discriminator influence factor, calculate the loss function value of the discriminator; the discriminator influence factor is determined based on the gradient value of the structural similarity loss function value; update the parameters of the generator in the next iteration based on the loss function value of the generator; calculate the parameters of the discriminator in the next iteration based on the loss function value of the discriminator.
[0024] Thirdly, embodiments of this application also provide a transaction risk identification device, which includes a memory and a processor. The memory is used to store computer programs or instructions; the processor is used to call the computer programs or instructions stored in the memory to execute the method as described in any possible implementation of the first aspect.
[0025] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when read and executed by a computer, cause the computer to perform a method as described in any possible implementation of the first aspect.
[0026] Fifthly, embodiments of this application provide a computer program product storing instructions that, when read and executed by a computer, cause the computer to perform the method in any possible implementation of the first aspect described above. Attached Figure Description
[0027] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 This is a flowchart illustrating a transaction risk identification method provided in an embodiment of this application.
[0029] Figure 2 This is a flowchart illustrating a method for training a feature extraction model provided in an embodiment of this application.
[0030] Figure 3 This is a flowchart illustrating a method for training a feature dimensionality reduction model provided in an embodiment of this application.
[0031] Figure 4 This is a flowchart illustrating a method for training a risk classification model provided in an embodiment of this application.
[0032] Figure 5 This is a flowchart illustrating a method for training data augmentation models provided in an embodiment of this application.
[0033] Figure 6 A schematic diagram of the internal modules of a transaction risk identification device 6000 provided in this application embodiment;
[0034] Figure 7 A schematic diagram of a transaction risk identification device 7000 provided in an embodiment of the present invention. Detailed Implementation
[0035] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0036] Existing methods for identifying transaction risks often rely on static rules. For example, a static rule might be that an account receives five or more large transfers in a single day, with large transfers defined as transactions of 500,000 or more. If an account matches this static rule, it is considered suspicious. However, methods based on static rules are ineffective against complex and ever-changing attacks. Furthermore, data between blockchain nodes is not synchronized in real time, making it relatively difficult to obtain real-time data from all nodes.
[0037] Based on this, embodiments of this application provide a method for identifying transaction risks to improve the accuracy of transaction risk identification. Figure 1 This is a flowchart illustrating a transaction risk identification method provided in an embodiment of this application. This process can be executed by a transaction risk identification device, such as... Figure 1 As shown, the process includes the following steps:
[0038] Step 101: The transaction risk identification device inputs the transaction data into the feature extraction model to obtain transaction feature data.
[0039] Specifically, the transaction data in this embodiment is obtained by collecting transaction activity records on blockchain nodes. The transaction data obtained after preprocessing the transaction activity records includes multiple transaction attribute information, which includes at least one of the following: transaction identifier, transaction timestamp, transaction address, transaction amount, transaction status, smart contract call information, and blockchain height. For example, the multiple transaction attribute information may include a1: transaction ID, representing the unique identifier of the transaction; a2: timestamp, representing the exact time of the transaction; a3: sender address, representing the blockchain address that initiated the transaction; a4: receiver address, representing the blockchain address that received the transaction; a5: transaction amount, representing the amount of funds involved in the transaction; a6: transaction fee, representing the fee paid in the blockchain network for this transaction activity; a7: block height, representing the height of the blockchain where the transaction activity is recorded; a8: transaction status, indicating whether the transaction activity is successful, failed, or pending; a9: smart contract call, indicating whether a smart contract has been triggered; a 10 Additional data refers to any extra transaction metadata, which can be represented in the form of a structured vector. It should be noted that in practical applications, transaction data typically has more than 10 attributes, potentially reaching dozens or even hundreds. This application does not limit the number of transaction data attributes or the format in which the transaction data is represented.
[0040] The transaction risk identification device is installed in the blockchain node. After acquiring transaction data in real time, it inputs the transaction data into the feature extraction model. The feature extraction model outputs the transaction feature data corresponding to the transaction data. The transaction feature data represents the multi-dimensional feature information of the transaction data.
[0041] Step 102: The transaction risk identification device inputs the transaction feature data into the feature dimensionality reduction model to obtain the transaction dimensionality reduction data.
[0042] Dimensionality reduction data of transactions represents the dimensionality reduction feature information of transaction feature data, that is, the feature information of transaction feature data after dimensionality reduction.
[0043] Step 103: The transaction risk identification device inputs the transaction dimensionality reduction data into the risk classification model to obtain the category label of the transaction data. The category label represents the risk level of the transaction data.
[0044] For example, after processing the transaction data through a feature extraction model, a feature dimensionality reduction model, and a risk classification model, the transaction data is output as category labels. The category labels characterize the risk level of the transaction data. If the transaction data may belong to three categories—normal, suspicious, and fraudulent—then the category labels can be 0, 1, and 2, where 0 corresponds to normal, 1 to suspicious, and 2 to fraud. It is understood that the transaction data may belong to multiple categories, and this embodiment does not limit this.
[0045] The aforementioned feature extraction model, feature dimensionality reduction model, and risk classification model are used to process new transaction data and generate category labels for the transaction data. These category labels are then used to update the blockchain system, enhancing the security of transactions on blockchain nodes.
[0046] The aforementioned feature extraction model, feature dimensionality reduction model, and risk classification model are all models obtained through training and testing. Among them, the feature extraction model is obtained by iterating through a population algorithm, treating the model parameters as individuals; the feature dimensionality reduction model is obtained by reducing the dimensionality of the samples through manifold learning; and the risk classification model is obtained by classifying through a support vector machine based on energy entropy.
[0047] Figure 2 This is a flowchart illustrating a method for training a feature extraction model provided in an embodiment of this application, as shown below. Figure 2 As shown:
[0048] Step 201: Determine the initial population of individuals for the feature extraction model.
[0049] Specifically, in the initialization phase, an initial population with multiple individuals is generated, each individual representing a set of model parameters for the feature extraction model. Each set of model parameters is determined by a weight vector and a bias vector. Let P... (0) For the initial population, each individual p i It is a parameter vector containing the weights and biases of the neural network, which can be represented as:
[0050]
[0051] In the formula, Nu is the number of individuals in the population, and W i It is the weight matrix, b i It is a bias vector. The weight matrix and bias vector are randomly generated, and the symbol represents each individual p in the initial population. i It possesses randomness to ensure population diversity. This represents the direct concatenation of vectors. In one possible implementation, P (0) The initialization method is random initialization.
[0052] Step 202: Calculate the fitness function value of the individual based on the individual's dynamic stability and accuracy.
[0053] In the dynamic evaluation phase, the performance of an individual is evaluated based on its dynamic stability and accuracy, taking into account the attractor properties of the dynamic trajectory. The accuracy of an individual characterizes the predictive accuracy of the feature extraction model corresponding to that individual in identifying transaction risks, while the dynamic stability characterizes the sensitivity of the weight vector within that individual to the loss function. The evaluation is implemented using the fitness function f(), which can be expressed as:
[0054] f(p i )=α Ts ·Acc(p i )+β Ts ·Stab(p i )
[0055] In the formula, Acc(p) i Acc(p) represents the accuracy of the feature extraction model on labeled training transaction data. It indicates the proportion of correctly predicted transactions out of the total number of transactions in the labeled training data. i The value is calculated from the preset Softmax output. It should be noted that since the training transaction data consists of historical samples, the class labels of the training transaction data are known. Stab(p) i Stab(p) represents the dynamic stability of the parameter. i A smaller α value indicates that the weight parameters are less sensitive to changes in the loss function, meaning the individual parameters are more stable. Ts and β Ts These are the performance hyperparameter and the stability hyperparameter, respectively. Preferably, α Ts and β Ts Set them to 0.7 and 0.3 respectively.
[0056] Among them, the accuracy Acc(p) i The calculation method can be expressed as:
[0057]
[0058] In the formula, N represents the total amount of transaction data. The value is 1 if the prediction is correct and 0 if it is incorrect.
[0059] Parameter dynamic stability Stab(p) i The calculation method for ) can be expressed as:
[0060]
[0061] In the formula, δ sta It is the attenuation coefficient. It is the network's loss function, w ij It is an individual p iIn the j-th weight parameter, Mu is the total number of weights, preferably δ sta Set to 0.05.
[0062] The role of parameter dynamic stability is to help the model maintain a healthy learning state by monitoring and adjusting the parameter update rate during the learning process, preventing gradient explosion or vanishing, and improving the stability of model training.
[0063] Step 203: Calculate the loss function.
[0064] Let κ(t) be the regularization strength of the model in the t-th iteration, and κ(t+1) be the regularization strength in the (t+1)-th iteration. Their calculation methods can be expressed as follows:
[0065] κ(t+1)=κ(t)·exp(-α pe ·g(t)+β pe ·(1-L(t)))
[0066] g(t)=(f(p (t) )-f(p (t-1) ))·exp(-γ pe ·Ds(p (t) ))
[0067]
[0068] In the formula, α pe and β pe These are the hyperparameters of the fitness gradient and the learning progress, respectively. g(t) is the fitness gradient, measuring the rate of change of the fitness function over time; L(t) is the learning progress, representing the improvement in the model's performance on the training trading dataset in each iteration; γ... pe It is a fractal dimension adjustment factor, Ds(p) (t) α is the fractal dimension calculation function. Preferably, α pe and β pe Set them to 0.3 and 0.7 respectively.
[0069] In one embodiment, Ds(p) is defined as the local fractal dimension at point p in the parameter vector, and a small radius ∈ is defined around the parameter vector p. br For a local region of the sphere, calculate the number of individuals N(∈) of the population falling within this sphere. br If the fractal dimension is such that the fractal dimension is calculated, then the fractal dimension can be expressed as:
[0070]
[0071] Preferably, ∈ br Set to 0.0001.
[0072] Furthermore, the model's loss function The calculation method can be expressed as:
[0073]
[0074] In the formula, R(W) is the L2 norm of the weight vector W, used to calculate the sum of squares of the weights; For multi-class classification problems, the cross-entropy loss can be expressed as:
[0075]
[0076] In the formula, C is the number of categories, N is the number of samples, and y i,c It is the true label of the i-th sample in class c (usually one-hot encoded, 1 if it belongs to the class, and 0 if it does not). It is the predicted probability that the i-th sample belongs to the c-th class.
[0077] Step 204: Determine the individuals for the next population iteration based on the fitness function values of each individual.
[0078] Individuals move within niches based on their fitness function. Superior individuals occupy dominant niches, while weaker individuals explore new niches or are eliminated. This adjustment mechanism can be represented as follows:
[0079]
[0080] In the formula, f avg η is the average fitness of all individuals in the current population. vd It is a moderating factor for the degree of interaction, p best It is the parameter of the current optimal individual, γ vd and λ vd These are the hyperparameters for updating the step size and the learning policy. Preferably, γ vd Set to 0.1, λ vd Set to 0.05, η vd Set it to 0.1.
[0081] A new individual may inherit the characteristics of two or more superior individuals, which can be represented as:
[0082] p new =ζ kg ·p parent1 +(1-ζ kg )·p parent2
[0083] p new =ζ kg ·p parent2 +(1-ζ kg )·pparent1
[0084] In the formula, ζ kg It is a randomly generated crossover factor, between 0 and 1; p parent1 and p parent2 These are two randomly selected parent individuals.
[0085] By employing a mutation mechanism based on nonlinear dynamics theory, mutation and mutation operations are performed, allowing individual parameters to undergo random jumps over a large range, which can be expressed as:
[0086] p′ i =p i +∈ bg randn() mask()
[0087] mask() = rand(size(p i ))<μ bg
[0088] In the formula, ∈ bg It is the variation intensity, μ bg It represents the probability of mutation; `randn()` generates a normally distributed random number; `mask()` generates a number similar to p. i A random binary mask of the same size controls which parameters will mutate; size(p) i ) is a length measurement function. Preferably, ∈ bg Set to 0.01, μ bg Set it to 0.1.
[0089] Global dynamic updates are performed, and the entire population updates according to the theory of ecological dynamic systems. The strategies of superior individuals are imitated and propagated, while maladaptive strategies gradually disappear. This can be represented as:
[0090] P (t+1) =sort(P (t) f)
[0091] In the formula, the sort function sorts the population according to fitness f(), retains individuals with high fitness, and eliminates individuals with low fitness.
[0092] Step 205: Repeat steps 202 to 204 until the preset iteration stop condition is met.
[0093] Specifically, in one embodiment, the preset stopping iteration condition can be a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000. The iteration stopping condition can also be that the loss function remains at a low level throughout the iterations of multiple rounds of model training.
[0094] Step 206: Determine the optimal individual that satisfies the iteration stopping condition, and determine the feature extraction model based on the optimal individual.
[0095] For example, the optimal individual represents a set of parameters of the feature extraction model, and the feature extraction model is determined based on the set of parameters represented by the optimal individual. In one embodiment, the top three optimal individuals that satisfy the iteration stopping condition can also be determined. The top three optimal individuals represent three sets of parameters of the feature extraction model. Based on the three sets of parameters and their corresponding weights, the final parameters of the feature extraction model are calculated, thereby determining the feature extraction model.
[0096] Transaction data is input into a feature extraction model for training. This application employs a three-layer fully connected neural network for feature extraction. In existing technologies, some schemes use neural networks for feature extraction, but certain neural network structures may encounter problems such as vanishing gradients, exploding gradients, or getting trapped in local optima, affecting training stability and model performance. This application's embodiment uses a population-based neural network model, inspired by the niche theory in ecology, where each species seeks its optimal position in the ecosystem to gain an advantage in the struggle for survival. Similarly, the population algorithm aims to find the optimal configuration of neural network parameters so that the neural network performs best on a given task.
[0097] Figure 3 This is a flowchart illustrating a method for training a feature dimensionality reduction model provided in an embodiment of this application, as shown below. Figure 3 As shown:
[0098] Step 301: Determine the initial parameters of the feature dimensionality reduction model.
[0099] Specifically, the feature dimensionality reduction model includes an encoder and a decoder, and the initial parameters of the feature dimensionality reduction model are the same as the parameters of the encoder and decoder.
[0100] The initialization method is random initialization, which can be represented as:
[0101]
[0102] In the formula, W e and W d b are the weight matrices for the encoder and decoder, respectively; e and b d For the corresponding bias vector; σ 2 This represents the initial standard deviation. Preferably, σ 2 Set to 0.01.
[0103] Step 302: Perform manifold structure sampling based on transaction feature data.
[0104] In one embodiment, this is implemented using the k-nearest neighbor algorithm, that is, using the k-nearest neighbor method for each transaction feature data point x. i By sampling and calculating the average distance of its k nearest neighbors, it can be expressed as:
[0105]
[0106] In the formula, x i Represents the current data point; NN k (x i ) is x i k nearest neighbors; ||x i -x j || 2 It is x i and x j The square of the Euclidean distance between them.
[0107] Step 303: Encode the transaction feature data according to the encoder to obtain transaction feature encoded data.
[0108] The low-dimensional latent representation z is obtained by compressing the transaction feature data using the encoder. i The calculation method is as follows:
[0109] z i =Sig(W e ·(1+γ csd β csd )·x i +b e )
[0110] In the formula, Sig() is the Sigmoid activation function; β csd γ is the dynamic coding adjustment coefficient; csd This is a preset scaling factor. Preferably, γ csd Set to 0.03.
[0111] In one embodiment, the dynamic coding adjustment coefficient is dynamically adjusted based on the statistical characteristics of the input transaction feature data. Specifically, the skewness S(x) of the input transaction feature data is calculated. i ) and kurtosis K(x i ), can be represented as:
[0112]
[0113] In the formula, μ pk and σ pkd x i The mean and standard deviation of the data, where k is the dimension of the transaction feature data.
[0114] Furthermore, the adjustment coefficient β csd The calculation method can be expressed as:
[0115]
[0116] In the formula, tanh() is the hyperbolic tangent function.
[0117] Step 304: Calculate the manifold constraint loss based on the dimensionality-reduced data corresponding to the transaction feature encoding data and the nearest neighbor transaction feature data of the transaction feature data.
[0118] The calculation method for manifold constraint loss can be expressed as:
[0119]
[0120] In the formula, z i and z j They are x i and x j In low-dimensional space, L manifold This represents the manifold constraint loss.
[0121] Step 305: Decode the transaction feature encoded data using the decoder to obtain the transaction feature decoded data.
[0122] Transaction feature decoding data can be represented as:
[0123]
[0124] Step 306: Obtain the reconstruction loss based on the transaction feature data and the transaction feature decoding data.
[0125] The reconstruction loss can be expressed as:
[0126]
[0127] In the formula, nur represents the number of transaction feature data input into the encoder in this iteration.
[0128] Step 307: Calculate the total loss function based on the reconstruction loss and manifold constraint loss.
[0129] The total loss function is:
[0130]
[0131] In the formula, It is transaction feature decoding data, λ kc It is the regularization parameter of the manifold constraint. Preferably, λ kc Set it to 0.2.
[0132] Step 308: Determine the parameters for the next iteration based on the total loss function and the parameters of the feature dimensionality reduction model in this iteration.
[0133] Specifically, the model parameters are optimized using gradient descent to continuously reduce the total loss. Then, the parameters are updated according to the gradient of the total loss function in each parameter direction in the encoder and decoder.
[0134] Step 309: Repeat steps 303 to 308 until the preset iteration stop condition is met.
[0135] Step 310: Determine the final values of the parameters of the feature dimensionality reduction model, and determine the feature dimensionality reduction model based on the final values of the parameters of the feature dimensionality reduction model.
[0136] This application trains a feature reduction model by inputting transaction feature data into it. The model employs an autoencoder neural network algorithm, consisting of two parts: an encoder and a decoder. The encoder maps the features of the high-dimensional transaction feature data to a low-dimensional latent space, while the decoder attempts to reconstruct the original input from this low-dimensional latent space. This application utilizes the manifold learning principle, enabling the network to better understand and preserve the inherent structure of the feature-extracted transaction data.
[0137] In one possible implementation, before encoding the transaction feature data according to the encoder, the method further includes: performing random masking on the transaction feature data.
[0138] Specifically, a random mask is generated for each transaction feature data point. This random mask is used to simulate the partial loss of transaction feature data. Specifically, for each transaction feature data point x... i Generate a random mask m i The method can be expressed as:
[0139] m i =Bernoulli(p)
[0140] In the formula, m i It is applied to x i The mask is a set of elements, each of which takes the value 0 or 1 independently; Bernoulli(p) represents the Bernoulli distribution, where p is the probability that the mask element is 1.
[0141] Furthermore, the Bernoulli distribution is a discrete distribution used to model a random variable that represents one of two possible outcomes; in one embodiment, the Bernoulli random variable m ij The generation method can be represented as:
[0142]
[0143] In the formula, U is a random number drawn from the uniform distribution Uniform(0,1), pr is a preset threshold parameter, and m represents the value of m. ijThe probability that U = 1. If U is less than p, then m ij It is set to 1; if U is greater than or equal to p, then m ij It is set to 0. Preferably, pr is set to 0.45.
[0144] After random masking, x i =x i ⊙m i , ⊙ indicates element-wise multiplication.
[0145] A mask transformation mechanism is adopted to enhance the model's robustness to noise and outliers in the input transaction feature data.
[0146] Figure 4 This is a flowchart illustrating a method for training a risk classification model provided in an embodiment of this application, as shown below. Figure 4 As shown:
[0147] Step 401: Determine the initial parameters of the risk classification model.
[0148] Specifically, the risk classification model uses a support vector machine for classification. The initial parameters of the support vector machine are set and can be expressed as follows:
[0149]
[0150] In the formula, θ q0 Indicates the initial model parameters; This represents a normal distribution with a mean of 0 and a covariance equal to the identity matrix.
[0151] Step 402: Calculate the energy of the transaction dimensionality reduction data based on the distance between the transaction dimensionality reduction data and the support vectors.
[0152] Specifically, an energy entropy function is defined to quantify the energy of the transaction dimensionality-reduced data near the classification boundary. The energy entropy function calculates its energy based on the distance of the transaction dimensionality-reduced data to the decision boundary. q The calculation method can be expressed as:
[0153]
[0154] In the formula, E q (x) represents the energy entropy of the reduced-dimensional data x in the transaction, x qi σ represents the support vector. q The energy diffusion coefficient is represented by ||xx. qi || 2 Represent x and x qi The square of the Euclidean distance between them.
[0155] In the Support Vector Machine (SVM) algorithm, support vectors are either transaction data points that fall on the decision boundary or dimensionality-reduced transaction data points with a small margin from the decision boundary. Assume that in the t-th iteration, the model parameters are... The support vectors can then be determined through the following process:
[0156]
[0157] This means that support vectors are those that make... A point close to 1.
[0158] Furthermore, the energy diffusion coefficient σ q Adjusting based on the statistical properties of the transaction dimension reduction dataset, it can be expressed as:
[0159]
[0160] In the formula, μ x ndr represents the mean of a single transaction dimensionality reduction dataset; ndr represents the number of transactions in the dimensionality reduction dataset; x i This represents the i-th transaction dimensionality reduction data point in the transaction dimensionality reduction dataset.
[0161] Step 403: Calculate the loss function value based on the parameters of the risk classification model in this iteration, the energy of the transaction dimensionality reduction data, and the risk classification model's prediction of the transaction dimensionality reduction data.
[0162] Specifically, a support vector machine is trained using a loss function with energy entropy, and the model parameters are optimized to minimize the overall loss L. qsvm , can be represented as:
[0163]
[0164] In the formula, L qsvm (θ q ) represents the total loss function, θ q Let C represent the model parameters, and y represent the regularization coefficient. i This represents the label of the dimensionality-reduced data for the i-th transaction. α represents the model's prediction of the dimensionality-reduced data for the i-th transaction. q Represents the energy entropy weight. represents the hinge loss, and MVF is the number of transaction dimensionality-reduced data input into the support vector machine in this round of training.
[0165] Furthermore, The calculation method can be expressed as:
[0166]
[0167] In the formula, φ(x) i) is the dimensionality-reduced transaction data x i Functions mapped to higher-dimensional space; b q is the bias term; <,> represents the vector dot product.
[0168] Step 404: Calculate the parameter values in the next iteration based on the dynamic adjustment factor, the parameters of the current iteration, and the loss function value.
[0169] Specifically, in each training cycle, the parameters are adjusted based on the model's current performance. The parameter adjustment method using a dynamic immune adjustment parameter update strategy can be expressed as follows:
[0170]
[0171] In the formula, η q Indicates the learning rate. This represents the loss function with respect to the parameter θ. q gradient, γ q Represents the dynamic adjustment factor, Δθ qprev This indicates the amount of parameter update in the previous step.
[0172] In one possible implementation, the dynamic adjustment factor can be a preset value. In this embodiment, the dynamic adjustment factor is determined based on the maximum value of the preset dynamic adjustment factor, the minimum value of the preset dynamic adjustment factor, the preset baseline loss function value, the difference between the loss function value of the current iteration and the loss function value of the previous iteration.
[0173] Dynamic adjustment factor γ q It can be represented as:
[0174]
[0175] In the formula, γ max and γ min These represent the maximum and minimum values of the dynamic adjustment factor, respectively; Δperf represents the difference between the loss function values of the current period and the previous period, perf base This represents the baseline loss function value. The dynamic adjustment factor is used to influence parameter tuning, thereby improving the smoothness of parameter tuning during iteration.
[0176] Step 405: Repeat steps 402 and 405 until the preset iteration stop condition is met.
[0177] Step 406: Determine the final values of the parameters of the risk classification model. Based on the final values of the parameters of the risk classification model, determine the risk classification model.
[0178] The risk classification model is trained by inputting the dimensionality-reduced transaction data into a classifier. This application adopts a support vector machine classification algorithm based on learnable energy entropy. By using an energy entropy term in the loss function of the support vector machine, the risk classification model can take into account the energy state of the dimensionality-reduced transaction data when making classification decisions, thereby better handling overlapping or closely distributed data categories.
[0179] To improve the performance of feature extraction, feature reduction, and risk classification models, a large number of transaction sample data are required. However, in practical applications, the collection, labeling, and preprocessing of transaction sample data for training are time-consuming and labor-intensive. Furthermore, insufficient training samples can lead to poor model generalization ability and affect model accuracy. Therefore, training data augmentation is used to generate training samples.
[0180] Figure 5 This is a flowchart illustrating a method for augmenting a training data model according to an embodiment of this application, as shown below. Figure 5 As shown:
[0181] Step 501: Determine the initial parameters of the data augmentation model.
[0182] Specifically, the data augmentation model includes a generator and a discriminator. Initializing the parameters of the data augmentation model is equivalent to initializing the parameters of the generator and discriminator. Specifically, the parameter initialization method for the generator G and the discriminator D is expressed as follows:
[0183]
[0184] In the formula, ~ indicates that it follows a specific distribution, θ g θ represents the parameters of the generator. d σ represents the parameters of the discriminator. cg This represents the standard deviation at initialization. Preferably, σ cg Set it to 0.1.
[0185] Step 502: Pre-train the discriminator using a real transaction dataset.
[0186] Specifically, multiple real transaction data points are acquired, and the loss function L of the discriminator in this step... d Represented as:
[0187]
[0188] In the formula, x represents actual transaction data, and p data This represents the distribution of real transaction data.
[0189] Step 503: Calculate the structural similarity loss function value of the generator based on the real transaction data and the generated transaction data output by the generator.
[0190] In one embodiment, structural similarity loss The similarity between the generated transaction data and the real transaction data output by the generator in the feature space is evaluated, and the calculation method is expressed as follows:
[0191]
[0192] In the formula, μ x and μ G(z) These are the root mean square values of the features of real transaction data and generated transaction data, respectively, σ x and σ G(z) These are the standard deviations of real transaction data and generated transaction data, σ and σ, respectively. xG(z) It is the covariance between the actual transaction data and the generated transaction data, and c1 and c2 are the first constant coefficient and the second constant coefficient, respectively. Preferably, c1 and c2 are set to 0.3 and 0.7, respectively.
[0193] Step 504: Calculate the generator's loss function value based on the generator's structural similarity loss function value.
[0194] During generator training, the parameters of the discriminator are fixed, and the loss function L of the generator G is... g () is represented as:
[0195]
[0196] In the formula, z is the noise vector, and p z For noise distribution, α ga and β ga These are the first and second weighting factors of the loss function, respectively. This represents the structural similarity loss. Preferably, α ga and β ga Set to 0.3 and 0.7.
[0197] Step 505: Calculate the loss function value of the discriminator based on the variance of the generated transaction data output by the generator and the discriminator influence factor.
[0198] During discriminator training, the generator parameters are fixed, and the loss function L of discriminator D is... d () is represented as:
[0199]
[0200] In the formula, λ de λ is the discriminator influence factor. de The initial value can be 0.01 or 0.03.
[0201] The discriminator influence factor is determined based on the gradient value of the structural similarity loss function. The discriminator influence factor λ in the generator is automatically adjusted according to the quality of the generated transaction data. de To gradually optimize the nonlinear mapping capability in the data generation process, the adjustment method is expressed as follows:
[0202]
[0203] In the formula, The updated discriminator influence factor, γ ce For learning rate, Indicates the relationship with λ de The gradient of γ. Preferably, γ ce Set to 0.03.
[0204] Where, gradient The calculation method is expressed as follows:
[0205]
[0206] In the formula, It is the gradient of structural similarity loss relative to the generated data. It is the gradient of the generated data relative to the discriminator's influence factor.
[0207] Step 506: Calculate the parameters of the generator in the next iteration based on the generator's loss function value; calculate the parameters of the discriminator in the next iteration based on the discriminator's loss function value.
[0208] The generator's parameters are updated in the next iteration based on the generator's loss function value, and the discriminator's parameters are updated in the next iteration based on the discriminator's loss function value. Furthermore, the α value in the generator's loss function... ga and β ga These are the first weighting factor and the second weighting factor, respectively, α ga and β ga In each iteration, updates are also made based on structural similarity.
[0209] Specifically, based on the feedback from the structural similarity loss, the adversarial loss weights are adjusted so that the model, while pursuing data authenticity, also enhances the structural details of the data. The adjustment method is expressed as follows:
[0210]
[0211] In the formula, δ vf To adjust the factor, Represents partial derivatives, and These are the first and second weighting factors of the updated loss function, respectively. Preferably, δ vfSet to 0.001.
[0212] Furthermore, the partial derivatives of the loss function are calculated as follows:
[0213]
[0214] Step 507: Repeat steps 503 to 506 until the preset iteration stop condition is met.
[0215] Step 508: Determine the final values of the generator parameters in the data augmentation model, and determine the generator based on the final values of the generator parameters.
[0216] To improve the quality and diversity of generated transaction data, this application employs a loss function that combines adversarial loss and a novel structural similarity loss. The adversarial loss ensures that the generated transaction data closely approximates the distribution of real transaction data, while the structural similarity loss emphasizes the preservation of structural and textural details in the generated transaction data to improve the stability of the data augmentation model.
[0217] Figure 6 This is a schematic diagram of the internal modules of a transaction risk identification device 6000 provided in an embodiment of this application. Figure 6 As shown, the device may include a first processing module 601, a second processing module 602, a third processing module 603, and a determination module 604. Optionally, it may also include a storage module for storing computer instructions or programs. The first processing module 601, the second processing module 602, and the third processing module 603 may call the computer instructions or programs stored in the storage module.
[0218] The system comprises three processing modules: a first processing module 601, which inputs transaction data into a feature extraction model to obtain transaction feature data, wherein the transaction feature data represents the multidimensional feature information of the transaction data; the transaction data includes multiple transaction attribute information; the feature extraction model is obtained by iterating through a population algorithm with model parameters as individuals; a second processing module 602, which inputs the transaction feature data into a feature dimensionality reduction model to obtain transaction dimensionality reduction data, wherein the transaction dimensionality reduction data represents the dimensionality reduction feature information of the transaction feature data; the feature dimensionality reduction model performs dimensionality reduction processing on samples through manifold learning; and a third processing module 603, which inputs the transaction dimensionality reduction data into a risk classification model to obtain category labels for the transaction data, wherein the category labels represent the risk level of the transaction data; the risk classification model performs classification using a support vector machine based on energy entropy.
[0219] In one possible implementation, the apparatus further includes a determining module 604, which is used to determine the initial population of individuals for the feature extraction model. Each individual represents a set of model parameters for the feature extraction model, and any set of model parameters is determined by a weight vector and a bias vector. The first processing module 601 is further used to perform individual iteration on the initial population individuals to achieve population iteration until the optimal individual that satisfies the iteration termination condition is obtained. The determining module 604 is further used to determine the feature extraction model based on the optimal individual. In each iteration, the first processing module 601 is specifically used to calculate the fitness function value of an individual based on its dynamic stability and accuracy. The accuracy of the individual characterizes the predictive accuracy of the feature extraction model corresponding to the individual in transaction risk identification, and the dynamic stability of the individual characterizes the sensitivity of the weight vector in the individual to the loss function. The determining module 604 is further used to determine the individuals in the next population iteration based on the fitness function values of each individual.
[0220] In one possible implementation, the determining module 604 is further configured to determine the initial parameters of the feature dimensionality reduction model, which includes an encoder and a decoder. The second processing module 602 is further configured to determine the final values of the parameters of the feature dimensionality reduction model by performing multiple iterations on the encoder and the decoder. The determining module 604 is further configured to determine the feature dimensionality reduction model based on the final values of the parameters of the feature dimensionality reduction model. In each iteration, the second processing module 602 is specifically configured to: encode the transaction feature data according to the encoder to obtain transaction feature encoded data; calculate the manifold constraint loss based on the transaction feature encoded data and the dimensionality-reduced data corresponding to the nearest neighbor transaction feature data; decode the transaction feature encoded data according to the decoder to obtain transaction feature decoded data; obtain the reconstruction loss based on the transaction feature data and the transaction feature decoded data; calculate the total loss function based on the reconstruction loss and the manifold constraint loss; and the determining module 604 is further configured to determine the parameters in the next iteration based on the total loss function and the parameters of the feature dimensionality reduction model in the current iteration.
[0221] In one possible implementation, the second processing module 602 is further configured to perform random masking processing on the transaction feature data.
[0222] In one possible implementation, the determining module 604 is further configured to determine the initial parameters of the risk classification model, and the third processing module 603 is further configured to determine the final values of the parameters of the risk classification model by performing multiple iterations on the risk classification model; the determining module 604 is further configured to determine the risk classification model based on the final values of the parameters of the risk classification model; in each iteration, the third processing module 603 is specifically configured to calculate the energy of the transaction dimensionality reduction data based on the distance between the transaction dimensionality reduction data and the support vectors; the support vectors are transaction dimensionality reduction data whose distance from the decision boundary is less than a set threshold; calculate the loss function value based on the parameters of the risk classification model in this iteration, the energy of the transaction dimensionality reduction data, and the prediction of the transaction dimensionality reduction data by the risk classification model; and calculate the value of the parameters in the next iteration based on the dynamic adjustment factor, the parameters of this iteration, and the loss function value.
[0223] In one possible implementation, the determining module 604 is further configured to determine the initial parameters of the data augmentation model, the data augmentation model including a generator and a discriminator; the device further includes a fourth processing module 605, the fourth processing module 605 being configured to acquire multiple pieces of real transaction data, perform multiple iterations on the generator and the discriminator based on the multiple pieces of real transaction data, and determine the final value of the generator's parameters in the data augmentation model; the determining module 604 is further configured to determine the generator based on the final value of the generator's parameters; in each iteration, the fourth processing module 605 is specifically configured to... Based on the real transaction data and the generated transaction data output by the generator, the structural similarity loss function value of the generator is calculated; based on the structural similarity loss function value of the generator, the loss function value of the generator is calculated; based on the variance of the generated transaction data output by the generator and the discriminator influence factor, the loss function value of the discriminator is calculated; the discriminator influence factor is determined based on the gradient value of the structural similarity loss function value; based on the loss function value of the generator, the parameters of the generator in the next iteration are updated; based on the loss function value of the discriminator, the parameters of the discriminator in the next iteration are calculated.
[0224] Figure 7 A schematic diagram of a transaction risk identification device 7000 provided in an embodiment of the present invention. (See attached diagram.) Figure 7 As shown, it includes at least one processor 701 and a memory 702 connected to at least one processor 701. In this embodiment, the specific connection medium between the processor 701 and the memory 702 is not limited. Figure 7 Taking the connection between the processor 701 and the memory 702 via a bus as an example, the bus can be divided into address bus, data bus, control bus, etc.
[0225] In this embodiment of the invention, the memory 702 stores instructions that can be executed by at least one processor 701. By executing the instructions stored in the memory 702, the at least one processor 701 can implement the steps of the above-described transaction risk identification method.
[0226] The processor 701 is the control center of the computer device, capable of connecting various parts of the computer device via various interfaces and lines. It performs resource configuration by running or executing instructions stored in the memory 702 and accessing data stored in the memory 702. Optionally, the processor 701 may include one or more processing units. The processor 701 may integrate an application processor and a modem processor. The application processor primarily handles the operating system, user interface, and applications, while the modem processor primarily handles wireless communication. It is understood that the modem processor may not be integrated into the processor 701. In some embodiments, the processor 701 and the memory 702 may be implemented on the same chip; in other embodiments, they may be implemented on separate chips.
[0227] The processor 701 can be a general-purpose processor, such as a central processing unit (CPU), digital signal processor, application-specific integrated circuit (ASIC), field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware component, capable of implementing or executing the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0228] Memory 702, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. Memory 702 may include at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory, random access memory (RAM), static random access memory (SRAM), programmable read-only memory (PROM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), magnetic storage, magnetic disk, optical disk, etc. Memory 702 can be any other medium capable of carrying or storing desired program code in the form of instructions or data structures that can be accessed by a computer, but is not limited thereto. Memory 702 in the embodiments of this application may also be a circuit or any other device capable of implementing storage functions for storing program instructions and / or data.
[0229] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0230] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0231] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0232] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0233] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A method for identifying transaction risks, characterized in that, The method includes: Transaction data is input into a feature extraction model to obtain transaction feature data, which represents the multidimensional feature information of the transaction data; the transaction data includes multiple transaction attribute information; the feature extraction model is obtained by iterating through a population algorithm, with model parameters as individuals. The transaction feature data is input into a feature dimensionality reduction model to obtain transaction dimensionality reduction data, which represents the dimensionality reduction feature information of the transaction feature data; the feature dimensionality reduction model is to perform dimensionality reduction processing on the samples through manifold learning. The reduced-dimensional transaction data is input into a risk classification model to obtain category labels for the transaction data, which characterize the risk level of the transaction data; the risk classification model performs classification using a support vector machine based on energy entropy. The risk classification model is performed using a support vector machine based on energy entropy, including: The initial parameters of the risk classification model are determined, and the final values of the parameters of the risk classification model are determined by performing multiple iterations on the risk classification model. The risk classification model is determined based on the final values of the parameters of the risk classification model. The iteration process for each round is as follows: The energy of the transaction dimensionality-reduced data is calculated based on the distance between the transaction dimensionality-reduced data and the support vectors; the support vectors are the transaction dimensionality-reduced data whose distance from the decision boundary is less than a set threshold. The energy of the transaction dimensionality reduction data In the formula, E q (x) represents the energy entropy of the reduced-dimensionality data x in the transaction, x qi Let σ represent the support vector. q The energy diffusion coefficient is represented by ||xx. qi || 2 Represent x and x qi The square of the Euclidean distance between them; The loss function value is calculated based on the parameters of the risk classification model in this iteration, the energy of the transaction dimensionality reduction data, and the prediction of the transaction dimensionality reduction data by the risk classification model. The loss function is: Where, θ q Let C represent the parameters of the risk classification model in this iteration, and y represent the regularization coefficient. i This represents the label of the dimensionality-reduced data for the i-th transaction. α represents the prediction of the risk classification model for the dimensionality-reduced data of the i-th transaction. q Represents the energy entropy weight. The hinge loss is represented by MVF, which is the number of transaction dimensionality-reduced data input into the support vector machine in this round of training. The value of the parameter in the next iteration is calculated based on the dynamic adjustment factor, the parameter of the current iteration, and the loss function value; the dynamic adjustment factor is determined based on the preset maximum value of the dynamic adjustment factor, the preset minimum value of the dynamic adjustment factor, the preset baseline loss function value, the difference between the loss function value of the current iteration and the loss function value of the previous iteration.
2. The method according to claim 1, characterized in that, The feature extraction model is obtained by iterating through a population algorithm, using model parameters as individuals. It includes: An initial population of individuals for the feature extraction model is determined, where each individual represents a set of model parameters for the feature extraction model, and any set of model parameters is determined by a weight vector and a bias vector; population iteration is achieved by iterating through the initial population individuals until the optimal individual that satisfies the iteration termination condition is obtained; Based on the optimal individual, determine the feature extraction model; The population iteration process is as follows: The fitness function value of an individual is calculated based on its dynamic stability and accuracy. The accuracy of an individual represents the predictive accuracy of the feature extraction model corresponding to that individual in identifying transaction risks. The dynamic stability of an individual represents the sensitivity of the weight vector in that individual to the loss function. The individuals in the next population iteration are determined based on the fitness function values of each individual.
3. The method according to claim 1, characterized in that, The feature dimensionality reduction model reduces the dimensionality of samples through manifold learning, including: The initial parameters of the feature dimensionality reduction model are determined. The feature dimensionality reduction model includes an encoder and a decoder. The final values of the parameters of the feature dimensionality reduction model are determined by performing multiple rounds of iteration on the encoder and the decoder. The feature dimensionality reduction model is determined based on the final values of the parameters of the feature dimensionality reduction model; The iteration process for each round is as follows: The transaction feature data is encoded using the encoder to obtain transaction feature encoded data; The manifold constraint loss is calculated based on the dimensionality-reduced data corresponding to the transaction feature encoding data and the nearest neighbor transaction feature data of the transaction feature data. The transaction feature encoded data is decoded using the decoder to obtain transaction feature decoded data; Based on the transaction feature data and the transaction feature decoding data, the reconstruction loss is obtained; Calculate the total loss function based on the reconstruction loss and the manifold constraint loss; Based on the total loss function and the parameters of the feature dimensionality reduction model in this iteration, the parameters for the next iteration are determined.
4. The method according to claim 3, characterized in that, Before encoding the transaction feature data according to the encoder, the method further includes: The transaction feature data is then subjected to random masking.
5. The method according to claim 1, characterized in that, The method further includes generating samples through a data augmentation model, wherein the data augmentation model is obtained in the following manner: Determine the initial parameters of the data augmentation model, which includes a generator and a discriminator; Multiple real transaction data are acquired, and the generator and the discriminator are iterated multiple times based on the multiple real transaction data to determine the final parameter values of the generator in the data augmentation model; The generator is determined based on the final values of the generator's parameters; The iteration process for each round is as follows: Calculate the structural similarity loss function value of the generator based on the real transaction data and the generated transaction data output by the generator; Calculate the loss function value of the generator based on the structural similarity loss function value of the generator; The discriminator's loss function value is calculated based on the variance of the generated transaction data output by the generator and the discriminator's influence factor; the discriminator's influence factor is determined based on the gradient value of the structural similarity loss function. The parameters of the generator in the next iteration are calculated based on the loss function value of the generator; the parameters of the discriminator in the next iteration are calculated based on the loss function value of the discriminator.
6. The method according to any one of claims 1 to 5, characterized in that, The multiple transaction attribute information includes at least one of the following: transaction identifier, transaction timestamp, transaction address, transaction amount, transaction status, smart contract call information, and blockchain height.
7. A transaction risk identification device, characterized in that, include: The first processing module is used to input transaction data into a feature extraction model to obtain transaction feature data, wherein the transaction feature data represents the multidimensional feature information of the transaction data; the transaction data includes multiple transaction attribute information; the feature extraction model is obtained by iterating individual models using a population algorithm with model parameters as individuals. The second processing module is used to input the transaction feature data into the feature dimensionality reduction model to obtain transaction dimensionality reduction data, wherein the transaction dimensionality reduction data represents the dimensionality reduction feature information of the transaction feature data. The feature dimensionality reduction model reduces the dimensionality of samples through manifold learning. The third processing module is used to input the transaction dimensionality reduction data into a risk classification model to obtain the category label of the transaction data, and the category label represents the risk level of the transaction data. The risk classification model is performed using a support vector machine based on energy entropy. The first processing module is used to determine the initial parameters of the risk classification model. The second processing module is further used to determine the final values of the parameters of the risk classification model through multiple iterations. The third processing module is also used to determine the risk classification model based on the final values of the parameters. In each iteration, the third processing module is specifically used to calculate the energy of the reduced-dimensional transaction data based on the distance between the reduced-dimensional transaction data and the support vectors. The support vectors are reduced-dimensional transaction data whose distance from the decision boundary is less than a set threshold. The energy of the reduced-dimensional transaction data... In the formula, E q (x) represents the energy entropy of the reduced-dimensionality data x in the transaction, x qi Let σ represent the support vector. q The energy diffusion coefficient is represented by ||xx. qi || 2 Represent x and x qi The square of the Euclidean distance between them; Based on the parameters of the risk classification model in this iteration, the energy of the transaction dimensionality reduction data, and the prediction of the transaction dimensionality reduction data by the risk classification model, the loss function value is calculated; the loss function is: Where, θ q Let C represent the parameters of the risk classification model in this iteration, and y represent the regularization coefficient. i This represents the label of the dimensionality-reduced data for the i-th transaction. α represents the prediction of the risk classification model for the dimensionality-reduced data of the i-th transaction. q Represents the energy entropy weight. The hinge loss is represented by MVF, which is the number of transaction dimensionality-reduced data input into the support vector machine in this round of training. The value of the parameter in the next iteration is calculated based on the dynamic adjustment factor, the parameter of the current iteration, and the loss function value; the dynamic adjustment factor is determined based on the preset maximum value of the dynamic adjustment factor, the preset minimum value of the dynamic adjustment factor, the preset baseline loss function value, the difference between the loss function value of the current iteration and the loss function value of the previous iteration.
8. A transaction risk identification device, characterized in that, include: Memory is used to store computer programs or instructions; A processor is configured to invoke a computer program or instructions stored in the memory to perform the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores instructions that, when read and executed by a computer, cause the computer to perform the method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, The computer program product stores instructions that, when read and executed by a computer, cause the computer to perform the method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Transaction risk early warning method and device
CN113052703A
Vehicle driving scene recognition model construction method and device
CN118427692A
Financial risk intelligent analysis method based on big data
CN118505394A