Transaction risk identification method and device
Through population algorithm extraction, manifold learning dimensionality reduction and energy entropy support vector machine classification, it solves the problem that traditional blockchain risk management methods are difficult to cope with complex attacks and fraud, and improves the accuracy of transaction risk identification and model generalization capabilities.
Patent Information
- Application Number
- CN202411314262.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-20
- Publication Date
- 2025-01-17
- Estimated Expiration
- 2044-09-20
AI Technical Summary
Traditional blockchain risk management methods rely on static rules and are difficult to deal with complex and changeable attacks and fraud strategies. Due to the decentralization characteristics, it is difficult for a single node to fully grasp the transaction situation on the entire network, resulting in limitations in data acquisition and processing.
The population algorithm is used for feature extraction, popular learning is used for feature dimensionality reduction, and risk classification is performed based on the support vector machine of energy entropy. The transaction data is processed through three neural network models to improve the accuracy of transaction risk identification.
Effectively respond to complex and changeable attacks and fraud strategies, improve the accuracy of transaction risk identification, reduce the complexity of feature space, and maintain important geometric and topological properties of transaction data, and enhance the model's generalization ability of unknown samples. .
Smart Images

Figure CN119323424A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data analysis technology, and in particular to a transaction risk identification method and device. Background Art
[0002] As a distributed technology, blockchain has the characteristics of ensuring that data cannot be tampered with and is open and transparent through encryption technology. It has been widely used in many 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 field, how to effectively identify and manage risks in transactions and prevent fraud and attacks is one of the core issues that blockchain technology needs to solve.
[0003] Traditional blockchain risk management mainly relies on static rules, which are often unable to effectively deal with complex and ever-changing attacks and fraud strategies. In addition, due to the decentralized nature of the blockchain network, it is difficult for a single node to fully grasp the transaction status of the entire network, which makes traditional methods limited in data acquisition and processing. Summary of the invention
[0004] The present application provides a transaction risk identification method and device for improving the accuracy of transaction risk identification.
[0005] In a first aspect, an embodiment of the present application provides a transaction risk identification method, which can be executed by a transaction risk identification device, and 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 performing individual iteration of a population algorithm using model parameters as individuals; the transaction feature data is input into a feature dimension reduction model to obtain transaction dimension reduction data, wherein the transaction dimension reduction data represents the dimension reduction feature information of the transaction feature data; the feature dimension reduction model performs dimension reduction processing on samples through popular learning; the transaction dimension reduction data is input into a risk classification model to obtain a category label of the transaction data, wherein the category label represents the risk level of the transaction data; the risk classification model is classified by a support vector machine based on energy entropy.
[0006] By adopting the above method and processing transaction data through three neural network models, it is possible to cope with complex and changing attacks and fraud strategies, and improve the accuracy of transaction risk identification.
[0007] In a possible implementation method, the feature extraction model is obtained by performing individual iteration through a population algorithm with model parameters as individuals, including: determining the initial population individuals of the feature extraction model, each individual representing a set of model parameters of the feature extraction model, and any set of model parameters is determined by a weight vector and a bias vector; performing individual iteration on the initial population individuals to achieve population iteration until an optimal individual that meets the iteration termination condition is obtained; determining the feature extraction model based on the optimal individual; wherein each population iteration process is as follows: calculating the fitness function value of the individual based on the dynamic stability of the individual and the accuracy of the individual, the accuracy of the individual representing the prediction accuracy of the feature extraction model corresponding to the individual in transaction risk identification, and the dynamic stability of the individual representing the sensitivity of the weight vector in the individual to the loss function; determining the individual in the next population iteration based on the fitness function value of each individual.
[0008] The feature extraction model adopts a population algorithm, which effectively improves the stability of the feature extraction model and the accuracy of feature extraction.
[0009] In a possible implementation method, the feature dimension reduction model performs dimension reduction processing on samples through popular learning, including: determining initial parameters of the feature dimension reduction model, the feature dimension reduction model includes an encoder and a decoder, and determining final values of the parameters of the feature dimension reduction model by performing multiple rounds of iterations on the encoder and the decoder; determining the feature dimension reduction model according to the final values of the parameters of the feature dimension reduction model; wherein each round of iteration process is as follows: encoding the transaction feature data according to the encoder to obtain transaction feature encoding data; calculating the popular constraint loss according to the reduced-dimensional data corresponding to the transaction feature encoding data and the transaction feature data of the nearest neighbor of the transaction feature data; decoding the transaction feature encoding data according to the decoder to obtain transaction feature decoded data; obtaining the reconstruction loss according to the transaction feature data and the transaction feature decoded data; calculating the total loss function according to the reconstruction loss and the popular constraint loss; determining the parameters in the next round of iteration according to the total loss function and the parameters of the feature dimension reduction model in this round of iteration.
[0010] The use of the above-mentioned feature dimensionality reduction model not only reduces the complexity of the feature space, but also maintains the important geometric and topological properties of the transaction data, making the feature dimensionality reduction model more able to reflect the inherent structure of the transaction data.
[0011] In a possible implementation method, before encoding the transaction feature data according to the encoder, the method further includes: performing random masking on the transaction feature data.
[0012] In a possible implementation method, the risk classification model is classified by a support vector machine based on energy entropy, including: determining the initial parameters of the risk classification model, and determining the final values of the parameters of the risk classification model by performing multiple rounds of iterations on the risk classification model; determining the risk classification model according to the final values of the parameters of the risk classification model; wherein each round of iteration process is as follows: calculating the energy of the transaction dimensionality reduction data according to the distance between the transaction dimensionality reduction data and the support vector; the support vector is the transaction dimensionality reduction data whose distance from the decision boundary is less than a set threshold; calculating the loss function value according to the parameters of the risk classification model in this round of iteration, the energy of the transaction dimensionality reduction data and the prediction of the risk classification model on the transaction dimensionality reduction data; calculating the value of the parameter in the next round of iteration according to the dynamic adjustment factor, the parameters of the current round of iteration and the loss function value.
[0013] The above-mentioned risk classification model is adopted to make the classification process more accurate through the energy entropy characteristics, and can effectively handle the boundary problems of different categories of data.
[0014] In one possible implementation method, 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 benchmark loss function value, and a difference between the loss function value of this iteration and the loss function value of the previous iteration.
[0015] In a possible implementation method, the method further includes generating samples through a data augmentation model, and the data augmentation model is obtained in the following manner: determining initial parameters of the data augmentation model, the data augmentation model including a generator and a discriminator; obtaining multiple real transaction data, and performing multiple rounds of iterations on the generator and the discriminator according to the multiple real transaction data to determine the final value of the parameters of the generator in the data augmentation model; determining the generator according to the final value of the parameters of the generator; wherein each round of iteration process is as follows: calculating the structural similarity loss function value of the generator according to the real transaction data and the generated transaction data output by the generator; calculating the loss function value of the generator according to the structural similarity loss function value of the generator; calculating the loss function value of the discriminator according to the variance of the generated transaction data output by the generator and the discriminator influence factor; the discriminator influence factor is determined according to the gradient value of the structural similarity loss function value; calculating the parameters of the generator in the next round of iteration according to the loss function value of the generator; calculating the parameters of the discriminator in the next round of iteration according to the loss function value of the discriminator.
[0016] The use of the above data augmentation model improves the quality and diversity of transaction data used for training, and effectively enhances the model's generalization ability for unknown samples.
[0017] In a possible implementation method, the multiple transaction attribute information includes at least one of the following: transaction identification, transaction timestamp, transaction address, transaction amount, transaction status, smart contract call information, and blockchain height.
[0018] In a second aspect, an embodiment of the present application provides a transaction risk identification device, which includes a first processing module, which is used to input 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 performing individual iteration of a population algorithm using model parameters as individuals; a second processing module is used to input the transaction feature data into a feature dimension reduction model to obtain transaction dimension reduction data, wherein the transaction dimension reduction data represents the dimension reduction feature information of the transaction feature data; the feature dimension reduction model performs dimension reduction processing on samples through popular learning; a third processing module is used to input the transaction dimension reduction data into a risk classification model to obtain a category label of the transaction data, wherein the category label represents the risk level of the transaction data; the risk classification model is classified by a support vector machine based on energy entropy.
[0019] In a possible implementation, the device also includes a determination module, which is used to determine the initial population individuals of the feature extraction model, each individual represents a set of model parameters of the feature extraction model, and any set of model parameters is determined by a weight vector and a bias vector; the first processing module is also used to implement population iteration by performing individual iteration on the initial population individuals until an optimal individual that meets the iteration termination condition is obtained; the determination module is also used to determine the feature extraction model based on the optimal individual; in each round of iteration, the first processing module is specifically used to calculate the fitness function value of the individual based on the dynamic stability of the individual and the accuracy of the individual, the accuracy of the individual characterizing the prediction accuracy of the feature extraction model corresponding to the individual in transaction risk identification, and the dynamic stability of the individual characterizing the sensitivity of the weight vector in the individual to the loss function; the determination module is also used to determine the individuals in the next population iteration based on the fitness function values of each individual.
[0020] In a possible implementation, the determination module is further used to determine initial parameters of the feature dimensionality reduction model, the feature dimensionality reduction model includes an encoder and a decoder, and the second processing module is further used to determine the final values of the parameters of the feature dimensionality reduction model by performing multiple rounds of iterations on the encoder and the decoder; the determination module is further used to determine the feature dimensionality reduction model according to the final values of the parameters of the feature dimensionality reduction model; in each round of iteration, the second processing module is specifically used to encode the transaction feature data according to the encoder to obtain transaction feature encoding data; calculate the popular constraint loss according to the reduced-dimensional data corresponding to the transaction feature encoding data and the transaction feature data of the nearest neighbors of the transaction feature data; decode the transaction feature encoding 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 popular constraint loss; the determination module is further used to determine the parameters in the next round of iteration according to the total loss function and the parameters of the feature dimensionality reduction model in this round of iteration.
[0021] In a possible implementation, the second processing module is further configured to perform random mask processing on the transaction feature data.
[0022] In a possible implementation, the determination module is also used to determine the initial parameters of the risk classification model, and the third processing module is also used to determine the final values of the parameters of the risk classification model by performing multiple rounds of iterations on the risk classification model; the determination module is also used to determine the risk classification model based on the final values of the parameters of the risk classification model; in each round of iteration, the third processing module is specifically used to calculate the energy of the transaction dimensionality reduction data based on the distance between the transaction dimensionality reduction data and the support vector; the support vector is the transaction dimensionality reduction data whose distance from the decision boundary is less than a set threshold; the loss function value is calculated based on the parameters of the risk classification model in this round of iteration, the energy of the transaction dimensionality reduction data and the prediction of the risk classification model for the transaction dimensionality reduction data; the value of the parameter in the next round of iteration is calculated based on the dynamic adjustment factor, the parameters of the current round of iteration and the loss function value.
[0023] In a possible implementation, the determination module is further used to determine initial parameters of a data augmentation model, wherein the data augmentation model includes a generator and a discriminator; the device further includes a fourth processing module, wherein the fourth processing module is used to obtain a plurality of real transaction data, and perform multiple rounds of iterations on the generator and the discriminator according to the plurality of real transaction data to determine final values of parameters of the generator in the data augmentation model; the determination module is further used to determine the generator according to the final values of the parameters of the generator; in each round of iteration, the fourth processing module is specifically used to, according to the real transaction data, According to the generated transaction data output by the generator, the structural similarity loss function value of the generator is calculated; according to the structural similarity loss function value of the generator, the loss function value of the generator is calculated; according to 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 according to the gradient value of the structural similarity loss function value; according to the loss function value of the generator, the parameters of the generator in the next round of iteration are updated; according to the loss function value of the discriminator, the parameters of the discriminator in the next round of iteration are calculated.
[0024] In a third aspect, an embodiment of the present application further provides a transaction risk identification device, which includes a memory and a processor, wherein 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 a method in any possible implementation of the first aspect.
[0025] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which instructions are stored. When a computer reads and executes the instructions, the computer executes a method in any possible implementation of the first aspect.
[0026] In a fifth aspect, an embodiment of the present application provides a computer program product, wherein instructions are stored in the computer program product. When a computer reads and executes the instructions, the computer executes the method in any possible implementation of the first aspect above. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0028] Figure 1 A flowchart corresponding to a transaction risk identification method provided in an embodiment of the present application;
[0029] Figure 2 A flowchart corresponding to a method for training a feature extraction model provided in an embodiment of the present application;
[0030] Figure 3 A flowchart corresponding to a method for training a feature dimensionality reduction model provided in an embodiment of the present application;
[0031] Figure 4 A flowchart corresponding to a method for training a risk classification model provided in an embodiment of the present application;
[0032] Figure 5 A flowchart corresponding to a method for training a data expansion model provided in an embodiment of the present application;
[0033] Figure 6 A schematic diagram of the internal modules of a transaction risk identification device 6000 provided in an embodiment of the present application;
[0034] Figure 7 A schematic diagram of the structure of a transaction risk identification device 7000 provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0036] Existing transaction risk identification methods often rely on static rules. For example, a static rule is that an account receives large transfers greater than or equal to 5 times in a day, and large transfers are transfers greater than or equal to 500,000. If an account matches the static rule, the account is a suspicious account. However, methods based on static rules cannot effectively respond to complex and changing attacks. In addition, the data between blockchain nodes is not synchronized in real time, and it is relatively difficult to obtain data from all nodes in real time.
[0037] Based on this, an embodiment of the present application provides a transaction risk identification method for improving the accuracy of transaction risk identification. Figure 1 A flowchart of a transaction risk identification method provided in an embodiment of the present application. The 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 transaction data into a feature extraction model to obtain transaction feature data.
[0039] Specifically, the transaction data in the embodiment of the present application is obtained by collecting transaction activity records on the blockchain node. The transaction data obtained after preprocessing the transaction activity records includes multiple transaction attribute information, and the multiple transaction attribute information includes at least one of the following: transaction identification, transaction timestamp, transaction address, transaction amount, transaction status, smart contract call information, blockchain height. Exemplarily, multiple transaction attribute information may include a1: transaction ID, indicating the unique identification of the transaction; a2: timestamp, indicating the exact time of the transaction; a3: sender address, indicating the blockchain address that initiated the transaction; a4: receiver address, indicating the blockchain address that received the transaction; a5: transaction amount, indicating the amount of funds involved in the transaction; a6: transaction fee, indicating the fee paid for the transaction activity in the blockchain network; a7: block height, indicating 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 the smart contract is triggered; a 10 : Additional data, indicating any additional transaction metadata, which can be represented in the form of a structured vector. It should be noted that in practical applications, the attributes of transaction data are usually more than 10 attributes, which may reach dozens or even hundreds. The embodiment of the present application does not limit the number of transaction data attribute information and the representation form of transaction data.
[0040] The transaction risk identification device is installed in the node of the blockchain. After acquiring the transaction data in real time, the transaction data is input 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 a feature dimension reduction model to obtain transaction dimension reduction data.
[0042] The transaction dimension reduction data represents the dimension reduction feature information of the transaction feature data, that is, the feature information of the transaction feature data after dimension reduction.
[0043] Step 103, the transaction risk identification device inputs the transaction dimension reduction data into the risk classification model to obtain a category label of the transaction data, and the category label represents the risk level of the transaction data.
[0044] Exemplarily, after the transaction data is processed by the feature extraction model, the feature dimensionality reduction model and the risk classification model, the category label of the transaction data is output. The category label represents the risk level of the transaction data. If the categories to which the transaction data may belong include normal, suspicious and fraudulent categories, the category label can be 0, 1 and 2, where 0 corresponds to normal, 1 corresponds to suspicious, and 2 corresponds to fraud. It can be understood that the categories to which the transaction data may belong can also include multiple categories, and the embodiments of the present application do not limit this.
[0045] The 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. At the same time, the category labels for the transaction data are used to update the blockchain system and enhance the security of blockchain node transactions.
[0046] The above-mentioned feature extraction model, feature dimensionality reduction model and risk classification model are all models that have been trained and tested. Among them, the feature extraction model is obtained by taking the model parameters as individuals and performing individual iteration through the population algorithm; the feature dimensionality reduction model is obtained by reducing the dimensionality of the samples through popular learning; and the risk classification model is obtained by classification through a support vector machine based on energy entropy.
[0047] Figure 2 A flowchart corresponding to a method for training a feature extraction model provided in an embodiment of the present application is shown in FIG. Figure 2 As shown:
[0048] Step 201, determining the initial population individuals of the feature extraction model.
[0049] Specifically, in the initialization stage, an initial population with multiple individuals is generated, each individual represents a set of model parameters of the feature extraction model, and any set of model parameters is determined by a weight vector and a bias vector. Let P (0) is the initial population, each individual p i is a parameter vector containing the weights and biases of the neural network, which can be expressed as:
[0050]
[0051] Where Nu is the number of individuals in the population, W i is the weight matrix, b i is the bias vector. The weight matrix and bias vector are randomly generated and represent the initial population of each individual p. i It is random to ensure the diversity of the population. represents the direct concatenation of vectors. In one possible implementation, P (0) The initialization method is random initialization.
[0052] Step 202, calculating the fitness function value of the individual according to the dynamic stability of the individual and the accuracy of the individual.
[0053] In the dynamic evaluation stage, combined with the attractor properties of the dynamic trajectory, the performance of the individual is evaluated according to the individual's dynamic stability and individual accuracy. The individual's accuracy represents the prediction accuracy of the feature extraction model corresponding to the individual in transaction risk identification. The individual's dynamic stability represents the sensitivity of the weight vector in the individual to the loss function. The evaluation method 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 ) represents the accuracy of the feature extraction model on the labeled training transaction data. It represents the proportion of correctly predicted transaction data to the total transaction data in the labeled training transaction data. Acc(p i ) is calculated by the preset Softmax output. It should be noted that since the training transaction data is a historical sample, the category label of the training transaction data is known. Stab(p i ) represents the dynamic stability of the parameters, Stab(p i ) is smaller, which means that the weight parameter is less sensitive to the change of the loss function, that is, the individual parameter is more stable. Ts and β Ts are performance hyperparameters and stability hyperparameters respectively. Preferably, α Ts and β Ts Set to 0.7 and 0.3 respectively.
[0056] Among them, the accuracy Acc(p i ) can be calculated as:
[0057]
[0058] In the formula, N represents the total transaction data volume, It takes 1 when the prediction is correct and 0 when it is wrong.
[0059] Parameter dynamic stability Stab(p i ) can be calculated as:
[0060]
[0061] In the formula, δ sta is the attenuation coefficient, is the loss function of the network, w ij is an individual p iThe jth weight parameter in , 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, prevent gradient explosion or disappearance, and improve the stability of model training.
[0063] Step 203, calculate the loss function.
[0064] Define κ(t) as the regularization strength of the t-th iteration model, and κ(t+1) as the regularization strength of the t+1-th iteration. The calculation method can be expressed as:
[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 They are the hyperparameters of the fitness gradient and the learning progress, respectively. g(t) is the fitness gradient, which measures the rate of change of the fitness function over time. L(t) is the learning progress, which represents the performance improvement of each iteration model on the training transaction dataset. pe is the fractal dimension adjustment factor, Ds(p (t) ) is a fractal dimension calculation function. Preferably, α pe and β pe Set to 0.3 and 0.7 respectively.
[0069] In one embodiment, Ds(p) is defined as the local fractal dimension at the parameter vector p, and a small radius ∈ is defined around the parameter vector p. br The local area of the sphere, calculate the number of individuals N(∈ br ), then the calculation method of fractal dimension can be expressed as:
[0070]
[0071] Preferably, ∈ br Set to 0.0001.
[0072] Furthermore, the loss function of the model is The calculation method can be expressed as:
[0073]
[0074] Where R(W) is the L2 norm of the weight vector W, which is used to calculate the sum of the squares of the weights; For multi-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 is the true label of the i-th sample in the c-th category (usually one-hot encoded, 1 if it belongs to the category and 0 if it does not). is the predicted probability that the i-th sample belongs to the c-th class.
[0077] Step 204, determining the individuals in the next population iteration according to the fitness function values of each individual.
[0078] Individuals move in the ecological niche according to their fitness function. Excellent individuals occupy the dominant ecological niche, and weaker individuals explore new ecological niches or are eliminated. The adjustment method can be expressed as:
[0079]
[0080] In the formula, f avg is the average fitness of all individuals in the current population, η vd is the interaction level adjustment factor, p best is the parameter of the current optimal individual, γ vd and λ vd are the update step size hyperparameter and the learning strategy hyperparameter respectively. Preferably, γ vd Set to 0.1, λ vd Set to 0.05, η vd Set to 0.1.
[0081] The new individual may inherit the characteristics of two or more excellent individuals, which can be expressed 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 is a randomly generated crossover factor between 0 and 1; p parent1 and p parent2 are two randomly selected parent individuals.
[0085] The mutation mechanism based on nonlinear dynamics theory is used to perform mutation and mutation operations, so that individual parameters can perform random jumps in a larger range, which can be expressed as:
[0086] p′ i =p i +∈ bg ·randn() ·mask()
[0087] mask()=rand(size(pi))<μ bg
[0088] In the formula, ∈ bg is the mutation intensity, μ bg is the probability of mutation, randn() generates a normally distributed random number; mask() generates a random number with p i A random binary mask of the same size, controlling which parameters will mutate; size(p i ) is a length measurement function. Preferably, ∈ bg Set to 0.01, μ bg Set to 0.1.
[0089] Perform global dynamic update. The entire population is updated according to the theory of ecological dynamic system. The strategies of excellent individuals will be imitated and spread, while the unsuitable strategies will gradually disappear. It can be expressed as:
[0090] P (t+1) = sort(P (t) ,f)
[0091] In the formula, the sort function sorts the population according to the fitness f(), retains individuals with high fitness, and eliminates individuals with low fitness.
[0092] Step 205: Repeat steps 202 to 204 until a preset iteration stop condition is met.
[0093] Specifically, in one embodiment, the preset stopping condition for iteration may be a preset maximum number of iterations. Preferably, the preset maximum number of iterations is set to 1000 times. The iteration stopping condition may also be that the loss function remains at a low level throughout multiple rounds of model training iterations.
[0094] Step 206, determining the best individual that meets the iteration stop condition, and determining the feature extraction model based on the best individual.
[0095] Exemplarily, the best 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 best individual. In one embodiment, the first three best individuals that meet the iteration stop condition can also be determined, and the first three best individuals represent three sets of parameters of the feature extraction model. According to the three sets of parameters and the weights corresponding to the three sets of parameters, the final parameters of the feature extraction model are calculated, and then the feature extraction model is determined.
[0096] The transaction data is input into the feature extraction model to train the feature extraction model. This application uses a 3-layer fully connected neural network for feature extraction. In the prior art, some solutions use neural networks for feature extraction. In some neural network structures, gradient vanishing, gradient explosion, or falling into local optimal solutions may be encountered, affecting the stability of training and the performance of the model. The embodiment of this application uses a neural network model of a population algorithm, which is inspired by the niche theory in ecology. Each species looks for its optimal position in the ecosystem to achieve an advantage in the competition 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 A flowchart corresponding to a method for training a feature dimensionality reduction model provided in an embodiment of the present application is shown in FIG. Figure 3 As shown:
[0098] Step 301, determining the initial parameters of the feature dimensionality reduction model.
[0099] Specifically, the feature dimensionality reduction model includes an encoder and a decoder. The initial parameters of the feature dimensionality reduction model are initialized by initializing the parameters of the encoder and the decoder.
[0100] The initialization method is random initialization, which can be expressed as:
[0101]
[0102] Where W e and W d are the weight matrices of the encoder and decoder respectively; b e and b d is the corresponding bias vector; σ 2 represents the initialization standard deviation. Preferably, σ 2 Set to 0.01.
[0103] Step 302: perform manifold structure sampling based on transaction feature data.
[0104] In one embodiment, the k-nearest neighbor algorithm is used to calculate the k-nearest neighbor of each transaction feature data point x. i Sampling is performed and the average distance of its k nearest neighbors is calculated, which can be expressed as:
[0105]
[0106] In the formula, x i Represents the current data point; NN k (x i ) is x i The k nearest neighbors of ; ∥x i -x j ∥ 2 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 transaction feature data is compressed according to the encoder to obtain a low-dimensional potential representation z i , calculated as:
[0109] z i =Sig(W e ·(1+γ csd β csd )·x i +b e )
[0110] Where Sig() is the Sigmoid activation function; β csd is the dynamic coding adjustment coefficient; γ csd 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 i ) and kurtosis K(x i ), which can be expressed as:
[0112]
[0113] In the formula, μ pk and σ pkd x i The mean and standard deviation of , k is the dimension of transaction feature data.
[0114] Furthermore, the adjustment coefficient β csd The calculation method can be expressed as:
[0115]
[0116] Where tanh() is the hyperbolic tangent function.
[0117] Step 304 , calculating the popular constraint loss based on the dimensionality-reduced data corresponding to the transaction feature encoding data and the transaction feature data of the nearest neighbor of the transaction feature data.
[0118] The calculation method of manifold constraint loss can be expressed as:
[0119]
[0120] In the formula, z i and z j They are x i and x j Representation in low-dimensional space, L manifold is the manifold constraint loss.
[0121] Step 305: decode the transaction feature encoded data according to the decoder to obtain transaction feature decoded data.
[0122] The transaction feature decoding data can be expressed as:
[0123]
[0124] Step 306: Obtain reconstruction loss based on the transaction feature data and the transaction feature decoding data.
[0125] The reconstruction loss can be expressed as:
[0126]
[0127] Where nur represents the number of transaction feature data input into the encoder in this round of iteration.
[0128] Step 307: Calculate the total loss function according to the reconstruction loss and the popularity constraint loss.
[0129] The total loss function is:
[0130]
[0131] In the formula, is the transaction feature decoding data, λ kc is the regularization parameter of the manifold constraint. Preferably, λ kc Set to 0.2.
[0132] Step 308, determining the parameters in the next round of iteration according to the total loss function and the parameters of the feature dimensionality reduction model in the current round of iteration.
[0133] Specifically, the gradient descent method is used to optimize the model parameters and continuously reduce the total loss, and each parameter is 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 a preset iteration stop condition is met.
[0135] Step 310, determining final values of parameters of the feature dimensionality reduction model, and determining the feature dimensionality reduction model according to the final values of the parameters of the feature dimensionality reduction model.
[0136] The transaction feature data is input into the feature dimensionality reduction model to train the feature dimensionality reduction model. This application uses an autoencoder neural network algorithm for feature dimensionality reduction. The autoencoder neural network includes two parts: an encoder and a decoder. The function of the encoder is to map the features of the high-dimensional transaction feature data to a low-dimensional latent space, and the decoder attempts to reconstruct the original input from this low-dimensional latent space. This application adopts the manifold learning principle so that the network can better understand and retain the intrinsic structure of the transaction data after feature extraction.
[0137] In a 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, and the random mask is used to simulate the partial loss of transaction feature data. Specifically, for each transaction feature data x i , generate a random mask m i can be expressed as:
[0139] m i = Bernoulli(p)
[0140] In the formula, m i is applied to x i The mask of , each element independently takes the value 0 or 1; Bernoulli(p) represents the Bernoulli distribution, p is the probability that the mask element is 1.
[0141] Further, the Bernoulli distribution is a discrete distribution used to simulate a random variable with one of two possible outcomes. In one embodiment, the Bernoulli random variable m ij The generation method can be expressed as:
[0142]
[0143] Where U is a random number drawn from the uniform distribution Uniform(0,1), pr is the preset threshold parameter, indicating m ij= 1. If U is less than p, then m ij is set to 1; if U is greater than or equal to p, then m ij is set to 0. Preferably, pr is set to 0.45.
[0144] After random masking, x i =x i ⊙m i , ⊙ represents the corresponding multiplication of elements.
[0145] The mask transformation mechanism is adopted to enhance the robustness of the model to noise and outliers in the input transaction feature data.
[0146] Figure 4 A flow chart corresponding to a method for training a risk classification model provided in an embodiment of the present application is shown in FIG. Figure 4 As shown:
[0147] Step 401, determining initial parameters of the risk classification model.
[0148] Specifically, the risk classification model is classified by a support vector machine. The initial parameters of the support vector machine are initialized and can be expressed as:
[0149]
[0150] In the formula, θ q0 Represents the initialized model parameters; represents a normal distribution with mean 0 and covariance the identity matrix.
[0151] Step 402: Calculate the energy of the transaction dimensionality reduction data according to the distance between the transaction dimensionality reduction data and the support vector.
[0152] Specifically, the energy entropy function is defined to quantify the energy of the transaction dimension reduction data near the classification boundary. The energy entropy function calculates the energy of the transaction dimension reduction data based on the distance from the decision boundary. The energy entropy function E q The calculation method can be expressed as:
[0153]
[0154] In the formula, E q (x) represents the energy entropy of the transaction dimension reduction data x, x qi represents the support vector, σ q represents the energy diffusion coefficient, nse represents the number of support vectors, ∥xx qi ∥ 2 Represents x and x qi The square of the Euclidean distance between them.
[0155] In the support vector machine algorithm, support vectors are transaction data points that fall on the decision boundary, or transaction data points with a small gap from the decision boundary after dimension reduction. Assume that in the tth iteration, the model parameters are The support vector can be determined by the following process:
[0156]
[0157] This means that the support vectors are those such that A point close to 1.
[0158] Furthermore, the energy diffusion coefficient σ q According to the statistical characteristics of the transaction dimension reduction data set, it can be expressed as:
[0159]
[0160] In the formula, μ x represents the mean of a transaction dimension reduction data; ndr represents the number of transaction dimension reduction data in the transaction dimension reduction data set, x i Represents the i-th transaction dimension reduction data point in the transaction dimension reduction dataset.
[0161] Step 403, calculate the loss function value according to the parameters of the risk classification model in this round of iteration, the energy of the transaction dimensionality reduction data and the prediction of the risk classification model on the transaction dimensionality reduction data.
[0162] Specifically, the 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 , which can be expressed as:
[0163]
[0164] Where, L qsvm (θ q ) represents the total loss function, θ q represents the model parameters, C represents the regularization coefficient, and y i represents the label of the dimensionality reduction data of the i-th transaction, represents the model's prediction of the dimensionality reduction data of the i-th transaction, α q represents the energy entropy weight, represents hinge loss, and mvf is the number of transaction dimension reduction data input into the support vector machine in this round of training.
[0165] Further, The calculation method can be expressed as:
[0166]
[0167] In the formula, φ(x i) is the transaction data x after dimension reduction i Functions mapped to high-dimensional space; b q is the bias term; <,> represents the vector dot product.
[0168] Step 404, calculating the value of the parameter in the next iteration according to the dynamic adjustment factor, the parameter of the current iteration and the loss function value.
[0169] Specifically, in each training cycle, the parameters are adjusted according to the current performance of the model. The parameter update strategy of dynamic immune adjustment can be expressed as:
[0170]
[0171] Where η q represents the learning rate, Denotes the loss function with respect to the parameter θ q The gradient of q represents the dynamic adjustment factor, Δθ qprev Indicates the parameter update amount of the previous step.
[0172] In one possible implementation, the dynamic adjustment factor may be a preset value. In an embodiment of the present application, 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, and the difference between the loss function value of this iteration and the loss function value of the previous iteration.
[0173] Dynamic adjustment factor γ q It can be expressed as:
[0174]
[0175] In the formula, γ max and γ min are the maximum and minimum values of the dynamic adjustment factor respectively; Δperf represents the difference between the loss function value of the current cycle and the previous cycle, and perf base Represents the value of the baseline loss function. The dynamic adjustment factor is used to influence parameter adjustment to improve the smoothness of parameter adjustment during the iteration process.
[0176] Step 405, repeating steps 402 and 405 until a preset iteration stop condition is met.
[0177] Step 406, determining final values of parameters of the risk classification model, and determining the risk classification model according to the final values of the parameters of the risk classification model.
[0178] The transaction dimension reduction data is input into the classifier to train the risk classification model. This application adopts a support vector machine classification algorithm based on learnable energy entropy. By adopting the 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 transaction dimension reduction data when making classification decisions, thereby better handling overlapping or closely distributed data categories.
[0179] In order to achieve better results in training feature extraction models, feature dimensionality reduction models, and risk classification models, multiple transaction sample data are required. However, in actual applications, the collection, acquisition, labeling, and preprocessing of transaction sample data for training are time-consuming and labor-intensive, and insufficient training samples can easily lead to poor model generalization ability and affect the accuracy of the model. Therefore, the training data augmentation model is used to generate training samples through the data augmentation model.
[0180] Figure 5 A flowchart corresponding to a method for training a data expansion model provided in an embodiment of the present application is shown in FIG. Figure 5 As shown:
[0181] Step 501, determine the initial parameters of the data expansion model.
[0182] Specifically, the data augmentation model includes a generator and a discriminator. Initializing the parameters of the data augmentation model is to initialize the parameters of the generator and the discriminator. Specifically, the parameter initialization method of the generator G and the discriminator D is expressed as:
[0183]
[0184] In the formula, ~ means obeying a specific distribution, θ g represents the parameters of the generator, θ d represents the parameters of the discriminator, σ cg represents the standard deviation at initialization. Preferably, σ cg Set to 0.1.
[0185] Step 502: Pre-train the discriminator using a real transaction dataset.
[0186] Specifically, obtain multiple real transaction data. The loss function L of the discriminator in this step is d It is expressed as:
[0187]
[0188] In the formula, x is the real transaction data, p data This is the distribution of real transaction data.
[0189] Step 503, 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.
[0190] In one embodiment, the structural similarity loss Evaluate the similarity between the generated transaction data output by the generator and the real transaction data in the feature space. The calculation method is expressed as:
[0191]
[0192] In the formula, μ x and μ G(z) are the average feature RMS values of real transaction data and generated transaction data, σ x and σ G(z) are the standard deviations of real transaction data and generated transaction data, σ xG(z) is the covariance between the real transaction data and the generated transaction data, 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 loss function value of the generator according to the structural similarity loss function value of the generator.
[0194] When training the generator, the parameters of the discriminator are fixed, and the loss function L of the generator G is g () is expressed as:
[0195]
[0196] Where z is the noise vector, p z is the noise distribution, α ga and β ga are the first and second weight factors of the loss function, respectively. is the structural similarity loss. Preferably, α ga and β ga Set to 0.3 and 0.7.
[0197] Step 505, calculating the loss function value of the discriminator according to the variance of the generated transaction data output by the generator and the discriminator influence factor.
[0198] When training the discriminator, the generator parameters are fixed and the loss function L of the discriminator D is d () is expressed as:
[0199]
[0200] In the formula, λ de is the discriminator influence factor, λ de The initial value of 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. According to the quality of the generated transaction data, the discriminator influence factor λ in the generator is automatically adjusted. de , in order to gradually optimize the nonlinear mapping ability in the data generation process, the adjustment method is expressed as:
[0202]
[0203] In the formula, is the updated discriminator influence factor, γ ce is the learning rate, Represents the de Preferably, γ ce Set to 0.03.
[0204] Among them, the gradient The calculation method is expressed as:
[0205]
[0206] In the formula, is the gradient of the structural similarity loss with respect to the generated data, is the gradient of the generated data with respect to the discriminator’s influence factor.
[0207] Step 506, calculate the parameters of the generator in the next iteration according to the loss function value of the generator; calculate the parameters of the discriminator in the next iteration according to the loss function value of the discriminator.
[0208] The parameters of the generator in the next iteration are updated according to the loss function value of the generator, and the parameters of the discriminator in the next iteration are updated according to the loss function value of the discriminator. In addition, α in the loss function value of the generator ga and β ga are the first weight factor and the second weight factor, α ga and β ga In each iteration, the structure is also updated based on the similarity.
[0209] Specifically, according to the feedback of the structural similarity loss, the adversarial loss weight is adjusted so that the model can enhance the structural details of the data while pursuing the authenticity of the data. The adjustment method is expressed as:
[0210]
[0211] In the formula, δ vf is the adjustment factor, represents the partial derivative, and are the first weight factor and the second weight factor of the updated loss function respectively. Preferably, δ vfSet to 0.001.
[0212] Furthermore, the partial derivative of the loss function is calculated as:
[0213]
[0214] Step 507, repeating steps 503 to 506 until a preset iteration stop condition is met.
[0215] Step 508, determine the final values of the parameters of the generator in the data augmentation model, and determine the generator according to the final values of the parameters of the generator.
[0216] In order to improve the quality and diversity of generated transaction data, the loss function adopted in this application combines adversarial loss and a new structural similarity loss. The adversarial loss ensures that the generated transaction data is close to the real transaction data in distribution, and the structural similarity loss emphasizes the retention of the structure and texture details of the generated transaction data to improve the stability of the data augmentation model.
[0217] Figure 6 Schematic diagram of the internal modules of a transaction risk identification device 6000 provided in an embodiment of the present 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, and optionally, also includes a storage module, the storage module is used to store computer instructions or programs, and the first processing module 601, the second processing module 602 and the third processing module 603 can call the computer instructions or programs in the storage module.
[0218] Among them, the first processing module 601 is used to input the transaction data into the feature extraction model to obtain transaction feature data, and the transaction feature data represents the multi-dimensional feature information of the transaction data; the transaction data includes multiple transaction attribute information; the feature extraction model is obtained by individual iteration of the model parameters through the population algorithm; the second processing module 602 is used to input the transaction feature data into the feature dimension reduction model to obtain transaction dimension reduction data, and the transaction dimension reduction data represents the dimension reduction feature information of the transaction feature data; the feature dimension reduction model performs dimension reduction processing on the samples through popular learning; the third processing module 603 is used to input the transaction dimension reduction data into the 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 classified by a support vector machine based on energy entropy.
[0219] In a possible implementation, the device also includes a determination module 604, which is used to determine the initial population individuals of the feature extraction model, each individual represents a set of model parameters of 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 also used to implement population iteration by performing individual iteration on the initial population individuals until an optimal individual that meets the iteration termination condition is obtained; the determination module 604 is also used to determine the feature extraction model based on the optimal individual; in each round of iteration, the first processing module 601 is specifically used to calculate the fitness function value of the individual based on the dynamic stability of the individual and the accuracy of the individual, the accuracy of the individual characterizing the prediction accuracy of the feature extraction model corresponding to the individual in transaction risk identification, and the dynamic stability of the individual characterizing the sensitivity of the weight vector in the individual to the loss function; the determination module 604 is also used to determine the individuals in the next population iteration based on the fitness function values of each individual.
[0220] In a possible implementation, the determination module 604 is further used to determine initial parameters of the feature dimension reduction model, the feature dimension reduction model includes an encoder and a decoder, and the second processing module 602 is further used to determine the final values of the parameters of the feature dimension reduction model by performing multiple rounds of iterations on the encoder and the decoder; the determination module 604 is further used to determine the feature dimension reduction model according to the final values of the parameters of the feature dimension reduction model; in each round of iteration, the second processing module 602 is specifically used to encode the transaction feature data according to the encoder to obtain transaction feature encoding data; calculate the popular constraint loss according to the reduced-dimensional data corresponding to the transaction feature encoding data and the transaction feature data of the nearest neighbor of the transaction feature data; decode the transaction feature encoding data according to the decoder to obtain transaction feature decoding data; obtain the reconstruction loss according to the transaction feature data and the transaction feature decoding data; calculate the total loss function according to the reconstruction loss and the popular constraint loss; the determination module 604 is further used to determine the parameters in the next round of iteration according to the total loss function and the parameters of the feature dimension reduction model in this round of iteration.
[0221] In a possible implementation, the second processing module 602 is further configured to perform random mask processing on the transaction feature data.
[0222] In a possible implementation, the determination module 604 is also used to determine the initial parameters of the risk classification model, and the third processing module 603 is also used to determine the final values of the parameters of the risk classification model by performing multiple rounds of iterations on the risk classification model; the determination module 604 is also used to determine the risk classification model based on the final values of the parameters of the risk classification model; in each round of iteration, the third processing module 603 is specifically used to calculate the energy of the transaction dimensionality reduction data based on the distance between the transaction dimensionality reduction data and the support vector; the support vector is the transaction dimensionality reduction data whose distance from the decision boundary is less than a set threshold; the loss function value is calculated based on the parameters of the risk classification model in this round of iteration, the energy of the transaction dimensionality reduction data and the prediction of the risk classification model for the transaction dimensionality reduction data; the value of the parameter in the next round of iteration is calculated based on the dynamic adjustment factor, the parameters of the current round of iteration and the loss function value.
[0223] In a possible implementation, the determination module 604 is further used 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 is used to obtain a plurality of real transaction data, perform multiple rounds of iterations on the generator and the discriminator according to the plurality of real transaction data, and determine the final value of the parameter of the generator in the data augmentation model; the determination module 604 is further used to determine the generator according to the final value of the parameter of the generator; in each round of iteration, the fourth processing module 605 is specifically used to , calculate the structural similarity loss function value of the generator according to the real transaction data and the generated transaction data output by the generator; calculate the loss function value of the generator according to the structural similarity loss function value of the generator; calculate the loss function value of the discriminator according to the variance of the generated transaction data output by the generator and the discriminator influence factor; the discriminator influence factor is determined according to the gradient value of the structural similarity loss function value; update the parameters of the generator in the next round of iteration according to the loss function value of the generator; calculate the parameters of the discriminator in the next round of iteration according to the loss function value of the discriminator.
[0224] Figure 7 A schematic diagram of the structure of a transaction risk identification device 7000 provided in an embodiment of the present invention. Figure 7 As shown, it includes at least one processor 701 and a memory 702 connected to the at least one processor 701. The specific connection medium between the processor 701 and the memory 702 is not limited in the embodiment of the present application. Figure 7 For example, the processor 701 and the memory 702 are connected via a bus. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0225] In the embodiment of the present invention, the memory 702 stores instructions that can be executed by at least one processor 701 , and the at least one processor 701 can implement the steps of the above-mentioned transaction risk identification method by executing the instructions stored in the memory 702 .
[0226] Among them, the processor 701 is the control center of the computer device, which can use various interfaces and lines to connect various parts of the computer device, and perform resource settings by running or executing instructions stored in the memory 702 and calling data stored in the memory 702. Optionally, the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, etc., and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned 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, and in some embodiments, they may also be implemented separately on independent chips.
[0227] Processor 701 can be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application-specific integrated circuit (ASIC), a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component, and can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware processor for execution, or can be executed by a combination of hardware and software modules in the processor.
[0228] The memory 702 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer executable programs and modules. The memory 702 may include at least one type of storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory, a random access memory (Random Access Memory, RAM), a static random access memory (Static Random Access Memory, SRAM), a programmable read-only memory (Programmable Read Only Memory, PROM), a read-only memory (Read Only Memory, ROM), an electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, EEPROM), a magnetic memory, a disk, an optical disk, etc. The memory 702 is any other medium that can be used to carry or store a desired program code in the form of an instruction or data structure and can be accessed by a computer, but is not limited thereto. The memory 702 in the embodiment of the present application can also be a circuit or any other device that can realize a storage function, for storing program instructions and / or data.
[0229] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0230] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0231] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0232] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0233] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A transaction risk identification method, characterized in that: The method comprises: Inputting transaction data into a feature extraction model to obtain transaction feature data, wherein the transaction feature data represents multi-dimensional feature information of the transaction data; the transaction data includes a plurality of transaction attribute information; the feature extraction model is obtained by performing individual iteration using a population algorithm with model parameters as individuals; Inputting the transaction feature data into a feature dimension reduction model to obtain transaction dimension reduction data, wherein the transaction dimension reduction data represents dimension reduction feature information of the transaction feature data; the feature dimension reduction model performs dimension reduction processing on samples through popular learning; The transaction dimension reduction data is input into a risk classification model to obtain a category label of the transaction data, wherein the category label represents the risk level of the transaction data; the risk classification model is classified by a support vector machine based on energy entropy.
2. The method according to claim 1, characterized in that The feature extraction model is obtained by taking the model parameters as individuals and performing individual iteration through a population algorithm, including: Determine an initial population individual of the feature extraction model, each individual represents a set of model parameters of the feature extraction model, and any set of model parameters is determined by a weight vector and a bias vector; implement population iteration by performing individual iteration on the initial population individuals until an optimal individual that meets an iteration termination condition is obtained; Determining the feature extraction model according to the optimal individual; Among them, each population iteration process is as follows: The fitness function value of the individual is calculated according to the dynamic stability and accuracy of the individual, wherein the accuracy of the individual represents the prediction accuracy of the feature extraction model corresponding to the individual in identifying transaction risks, and the dynamic stability of the individual represents the sensitivity of the weight vector in the 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 is to reduce the dimensionality of samples through popular learning, including: Determining initial parameters of the feature dimensionality reduction model, the feature dimensionality reduction model includes an encoder and a decoder, and determining final values of the parameters of the feature dimensionality reduction model by performing multiple rounds of iterations on the encoder and the decoder; Determining the feature dimensionality reduction model according to the final values of the parameters of the feature dimensionality reduction model; The process of each iteration is as follows: Encoding the transaction feature data according to the encoder to obtain transaction feature encoded data; Calculating a popular constraint loss based on the dimensionally reduced data corresponding to the transaction feature encoding data and the transaction feature data of the nearest neighbor of the transaction feature data; Decoding the transaction feature coded data according to the decoder to obtain transaction feature decoded data; Obtaining a reconstruction loss according to the transaction feature data and the transaction feature decoding data; Calculating a total loss function according to the reconstruction loss and the popularity constraint loss; The parameters in the next round of iteration are determined according to the total loss function and the parameters of the feature dimensionality reduction model in the current round of iteration.
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 subjected to random masking processing.
5. The method according to claim 1, characterized in that The risk classification model is classified by a support vector machine based on energy entropy, including: Determining initial parameters of the risk classification model, and determining final values of the parameters of the risk classification model by performing multiple rounds of iterations on the risk classification model; Determining the risk classification model according to final values of parameters of the risk classification model; The process of each iteration is as follows: Calculating the energy of the transaction dimensionality reduction data according to the distance between the transaction dimensionality reduction data and the support vector; the support vector is the transaction dimensionality reduction data whose distance from the decision boundary is less than a set threshold; Calculating a loss function value according to the parameters of the risk classification model in this round of iteration, the energy of the transaction dimensionality reduction data, and the prediction of the transaction dimensionality reduction data by the risk classification model; The value of the parameter in the next iteration is calculated according to the dynamic adjustment factor, the parameter of the current iteration and the loss function value.
6. The method according to claim 5, characterized in that 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 reference loss function value, and a difference between the loss function value of this iteration and the loss function value of the previous iteration.
7. 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: Determining initial parameters of a data augmentation model, wherein the data augmentation model includes a generator and a discriminator; Acquire multiple pieces of real transaction data, perform multiple rounds of iterations on the generator and the discriminator according to the multiple pieces of real transaction data, and determine final values of parameters of the generator in the data augmentation model; Determine the generator according to the final value of the parameter of the generator; The process of each iteration is as follows: Calculate the structural similarity loss function value of the generator according to the real transaction data and the generated transaction data output by the generator; Calculating the loss function value of the generator according to the structural similarity loss function value of the generator; Calculating the loss function value of the discriminator according to the variance of the generated transaction data output by the generator and the discriminator influence factor; the discriminator influence factor is determined according to the gradient value of the structural similarity loss function value; The parameters of the generator in the next round of iteration are calculated according to the loss function value of the generator; the parameters of the discriminator in the next round of iteration are calculated according to the loss function value of the discriminator.
8. The method according to any one of claims 1 to 7, characterized in that The multiple transaction attribute information includes at least one of the following: transaction identification, transaction timestamp, transaction address, transaction amount, transaction status, smart contract call information, and blockchain height.
9. A transaction risk identification device, characterized in that: include: A first processing module is used to input the transaction data into a feature extraction model to obtain transaction feature data, wherein the transaction feature data represents multi-dimensional feature information of the transaction data; the transaction data includes a plurality of transaction attribute information; the feature extraction model is obtained by performing individual iteration using a population algorithm with model parameters as individuals; A second processing module is used to input the transaction feature data into a feature dimension reduction model to obtain transaction dimension reduction data, wherein the transaction dimension reduction data represents dimension reduction feature information of the transaction feature data; The feature dimensionality reduction model is to reduce the dimensionality of samples through popular learning; A third processing module is used to input the transaction dimension reduction data into a risk classification model to obtain a category label of the transaction data, wherein the category label represents the risk level of the transaction data; The risk classification model is classified by a support vector machine based on energy entropy.
10. A transaction risk identification device, characterized in that: include: Memory, used to store computer programs or instructions; A processor, configured to call a computer program or instruction stored in the memory to execute the method according to any one of claims 1 to 8.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when a computer reads and executes the instructions, the computer executes the method according to any one of claims 1 to 8.
12. A computer program product, characterized in that The computer program product stores instructions, and when a computer reads and executes the instructions, the computer executes the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Risk transaction identification method and device, server and storage medium
CN110309840A
Transaction risk early warning method and device
CN113052703A
Method and device for determining risk value of transaction data information and storage medium
CN117010901A
Vehicle driving scene recognition model construction method and device
CN118427692A
Financial risk intelligent analysis method based on big data
CN118505394A