Risk detection information generation method and device, equipment, medium and program product
By replacing the key parameter vectors in the parameter matrix of the risk control detection model, the problems of large number of parameters and long output time in the field of risk control of deep learning models are solved, and efficient and accurate risk control detection information generation is achieved.
Patent Information
- Application Number
- CN202511403525.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-28
- Publication Date
- 2026-01-16
AI Technical Summary
Deep learning models suffer from large parameter counts and long output times in the risk control field, making it impossible to meet the requirements of high accuracy and low latency.
By replacing the key parameter vectors in the parameter matrix of the target network module in the risk control detection model, a replaced risk control detection model is generated, which reduces the amount of computation and improves the model accuracy.
While ensuring model accuracy, the computational load and output latency of the risk control detection model were reduced, enabling efficient generation of risk control detection information.
Smart Images

Figure CN121350656A_ABST
Abstract
Description
Technical Field
[0001] The embodiments disclosed herein relate to the field of artificial intelligence, specifically to risk detection information generation methods, apparatus, devices, media, and program products. Background Technology
[0002] Currently, with the continuous development of artificial intelligence, deep learning models are being used more and more widely in the field of risk control. However, deep learning models often suffer from problems such as a large number of parameters and long output time. For the model calculation of risk control detection models in the field of risk control, the common approach is to achieve model calculation through approximate calculation.
[0003] However, the inventors discovered that when using the above method for model calculation, the following technical problems often arise:
[0004] The risk control field has high accuracy requirements (for example, model accuracy must be within three decimal places), which means that approximate calculation methods cannot meet these requirements. In addition, risk control requires low latency, and approximate calculation methods cannot accelerate model inference or reduce latency.
[0005] The information disclosed in this background section is only intended to enhance the understanding of the background of the inventive concept, and therefore may contain information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0006] The summary portion of this disclosure is intended to provide a brief overview of the concepts, which will be described in detail in the detailed description portion. This summary portion is not intended to identify key or essential features of the claimed technical solutions, nor is it intended to limit the scope of the claimed technical solutions.
[0007] Some embodiments of this disclosure provide methods, apparatus, electronic devices, media, and program products for generating risk detection information to address the technical problems mentioned in the background section above.
[0008] In a first aspect, some embodiments of this disclosure provide a method for generating risk detection information, including: acquiring target risk control data and a pre-trained risk control detection model; replacing at least one parameter matrix corresponding to a target network module in the risk control detection model with a key parameter vector to obtain a replaced risk control detection model; and inputting the target risk control data into the replaced risk control detection model to obtain risk control detection information.
[0009] Optionally, the above-mentioned key parameter vector replacement of at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model includes: for each parameter matrix in the above-mentioned at least one parameter matrix, performing a replacement step: determining at least one key parameter vector corresponding to the above parameter matrix; for each column of parameter vectors in the above parameter matrix, replacing the above parameter vectors with target key parameter vectors, wherein the target key parameter vector is the key parameter vector with the most similar vector semantics among the above-mentioned at least one key parameter vectors; replacing at least one parameter matrix in the above-mentioned target network module with the replaced at least one parameter matrix to obtain the replaced risk control detection model.
[0010] Optionally, determining at least one key parameter vector corresponding to the parameter matrix includes: performing clustering processing on multiple columns of parameter vectors in the parameter matrix to obtain a parameter vector cluster set; and determining the cluster center set of the parameter vector clusters corresponding to the parameter vector cluster set as the at least one key parameter vector.
[0011] Optionally, after acquiring the target risk control data and the pre-trained risk control detection model, the method further includes: determining the computational cost of generating risk control detection information using a model pre-computation method based on the feature dimensions corresponding to the target risk control data and the model parameter matrix corresponding to the risk control detection model; and performing key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model, including: in response to determining that the computational cost of the model meets the computational cost condition, performing key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model.
[0012] Optionally, the above-mentioned clustering of multiple column parameter vectors in the parameter matrix to obtain a parameter vector cluster set includes: obtaining current memory usage information; determining the number of clusters to be clustered based on the current memory usage information and the computational cost of the model; and clustering the multiple column parameter vectors in the parameter matrix according to the number of clusters to obtain a parameter vector cluster set.
[0013] Optionally, the above-mentioned clustering process of multiple column parameter vectors in the parameter matrix to obtain parameter vector clusters includes: determining an initial number of target parameter column vectors in the parameter matrix as an initial cluster center set; for each parameter column vector in the parameter matrix, assigning the parameter column vector to the cluster corresponding to the nearest initial cluster center; in response to determining that the number of replacements corresponding to the assigned vector clusters has reached a target number, for the assigned vector clusters, performing the following determination steps: determining the two cluster centers with the closest vector distance in the cluster center set corresponding to the assigned vector clusters, respectively as the first cluster center and the second cluster center; in response to determining that the number of replacements corresponding to the assigned vector clusters has reached a target number, performing the following determination steps: determining the two cluster centers with the closest vector distance in the cluster center set corresponding to the assigned vector clusters, respectively as the first cluster center and the second cluster center; in response to determining that the number of replacements corresponding to the assigned vector clusters has reached a target number, performing the following determination steps: determining the two cluster centers with the closest vector distance in the cluster center set corresponding to the assigned vector clusters, respectively as the first cluster center and the second cluster center; in response to determining that the number of replacements corresponding to the assigned vector clusters has reached a target number, performing the following determination steps: determining the number of replacements corresponding to the assigned vector clusters; ... If the vector distance between the first cluster center and the second cluster center is less than the target distance, the first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center are fused to obtain a processed vector cluster. The reset vector cluster set includes the first vector cluster and the second vector cluster. The cluster center corresponding to the processed vector cluster is re-determined, and the first and second vector clusters in the reset vector cluster set are replaced with the processed vector cluster to obtain a replaced vector cluster set. In response to determining that the number of replacements corresponding to the replaced vector cluster set has reached the target number, the replaced vector cluster set is determined as the parameter vector cluster set.
[0014] Optionally, the above method further includes: in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number, using the replaced vector cluster set as the reset vector cluster set, and continuing to perform the above determination step.
[0015] Optionally, after the above-mentioned response to determining that the vector distance between the first cluster center and the second cluster center is less than the target distance, performing cluster fusion on the first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center to obtain the processed vector cluster, the above method further includes: in response to determining that the vector distance between the first cluster center and the second cluster center is greater than or equal to the target distance, reselecting cluster centers from the first vector cluster and the second vector cluster respectively to obtain reselected first cluster center and reselected second cluster center, wherein the cluster distance between the reselected first cluster center and the reselected second cluster center is less than the target distance; replacing the first vector cluster and the second vector cluster in the rearranged vector cluster set with the reselected first vector cluster and the reselected second vector cluster respectively to obtain the processed vector cluster, wherein the cluster center of the reselected first vector cluster is the reselected first cluster center, and the cluster center of the reselected second vector cluster is the reselected second cluster center.
[0016] Optionally, in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number, the replaced vector cluster set is used as the reset vector cluster set, and the above determination step is continued, including: in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number and the number of clusters corresponding to the replaced vector cluster set is less than the target number of clusters, the vector cluster with the highest maximum vector distance is selected from the replaced vector cluster set as the target vector cluster, where the maximum vector distance is the distance between the two farthest vectors in the vector cluster; the target vector cluster is split to obtain a split vector cluster set; the target vector cluster in the replaced vector cluster set is replaced with the split vector cluster set to obtain a vector cluster set after replacement, which is used as the reset vector cluster set, and the above determination step is continued.
[0017] Secondly, some embodiments of this disclosure provide a risk detection information generation apparatus, including: an acquisition unit configured to acquire target risk control data and a pre-trained risk control detection model; a replacement unit configured to replace at least one parameter matrix corresponding to a target network module in the risk control detection model with a key parameter vector to obtain a replaced risk control detection model; and an input unit configured to input the target risk control data into the replaced risk control detection model to obtain risk control detection information.
[0018] Optionally, the replacement unit can be configured to: for each parameter matrix in the at least one parameter matrix, perform a replacement step: determine at least one key parameter vector corresponding to the parameter matrix; for each column of parameter vectors in the parameter matrix, replace the parameter vector with a target key parameter vector, wherein the target key parameter vector is the key parameter vector among the at least one key parameter vectors that is most similar in vector semantics to the parameter vector; replace at least one parameter matrix in the target network module with the replaced at least one parameter matrix to obtain the replaced risk control detection model.
[0019] Optionally, the replacement unit can be configured to: perform clustering processing on the multiple columns of parameter vectors in the above parameter matrix to obtain a parameter vector cluster set; and determine the parameter vector cluster center set corresponding to the above parameter vector cluster set as at least one of the above key parameter vectors.
[0020] Optionally, the apparatus further includes: determining the computational load of the model for generating risk control detection information based on the feature dimension corresponding to the target risk control data and the model parameter matrix corresponding to the risk control detection model using a model pre-calculation method; and the replacement unit can be configured to: in response to determining that the computational load of the model meets the computational load condition, perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model.
[0021] Optionally, the replacement unit can be configured to: obtain current memory usage information; determine the number of clusters to be clustered on the multi-column parameter vectors based on the current memory usage information and the computational cost of the model; and perform clustering on the multi-column parameter vectors in the parameter matrix based on the number of clusters to obtain a parameter vector cluster set.
[0022] Optionally, the replacement unit can be configured to: determine an initial number of target parameter column vectors in the parameter matrix as an initial cluster center set; for each parameter column vector in the parameter matrix, assign the parameter column vector to the cluster set corresponding to the nearest initial cluster center; in response to determining that the replacement count corresponding to the assigned vector cluster set reaches a target count, for the assigned vector cluster set, perform the following determination steps: determine the two cluster centers with the closest vector distance in the cluster center set corresponding to the assigned vector cluster set, respectively, as the first cluster center and the second cluster center; in response to determining that the vector distance between the first cluster center and the second cluster center is less than the target distance, perform cluster fusion on the first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center to obtain a processed vector cluster, wherein the assigned vector cluster set includes: the first vector cluster and the second vector cluster; redetermine the cluster center corresponding to the processed vector cluster, and replace the first vector cluster and the second vector cluster in the assigned vector cluster set with the processed vector cluster to obtain a replaced vector cluster set; in response to determining that the replacement count corresponding to the replaced vector cluster set reaches a target count, determine the replaced vector cluster set as the parameter vector cluster set.
[0023] Optionally, the replacement unit can be configured to: in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number, use the replaced vector cluster set as the reset vector cluster set and continue to perform the determination step.
[0024] Optionally, the replacement unit can be configured to: in response to determining that the vector distance between the first cluster center and the second cluster center is greater than or equal to the target distance, reselect cluster centers from the first vector cluster and the second vector cluster respectively to obtain reselected first cluster centers and reselected second cluster centers, wherein the cluster distance between the reselected first cluster centers and the reselected second cluster centers is less than the target distance; replace the first vector cluster and the second vector cluster in the normalized vector cluster set with the reselected first vector cluster and the reselected second vector cluster respectively to obtain processed vector clusters, wherein the cluster center of the reselected first vector cluster is the reselected first cluster center, and the cluster center of the reselected second vector cluster is the reselected second cluster center.
[0025] Optionally, the replacement unit can be configured to: in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number and the number of clusters corresponding to the replaced vector cluster set is less than the target number of clusters, select the vector cluster with the highest maximum vector distance from the replaced vector cluster set as the target vector cluster, where the maximum vector distance is the distance between the two farthest vectors in the vector cluster; split the target vector cluster to obtain a split vector cluster set; replace the target vector cluster in the replaced vector cluster set with the split vector cluster set to obtain a vector cluster set after replacement, which is used as the rearranged vector cluster set, and continue to perform the above determination steps.
[0026] Thirdly, some embodiments of this disclosure provide an electronic device, including: one or more processors; and a storage device having one or more programs stored thereon, such that when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any implementation of the first aspect.
[0027] Fourthly, some embodiments of this disclosure provide a computer-readable medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the method as described in any implementation of the first aspect.
[0028] Fifthly, some embodiments of this disclosure provide a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the implementations of the first aspect above.
[0029] The above embodiments of this disclosure have the following beneficial effects: Through the risk detection information generation method of some embodiments of this disclosure, risk control detection information can be generated efficiently and quickly while ensuring output accuracy and reducing output latency in the risk control field. Specifically, the reason for the inaccurate output and output latency of the relevant risk control detection information is that the model performs poorly in edge processing of various objects in the image. Based on this, the risk detection information generation method of some embodiments of this disclosure first acquires target risk control data and a pre-trained risk control detection model. Here, the target risk control data serves as the input to the model. The risk control detection model serves as a deep learning model for risk control detection, facilitating the output of risk control detection information. Then, key parameter vector replacement is performed on at least one parameter matrix corresponding to the target network module in the above-mentioned risk control detection model to obtain the replaced risk control detection model. Here, by replacing at least one parameter matrix with a key parameter vector, the computational load between the input content and the parameter matrix can be avoided. Only the key parameter vector needs to be calculated. By removing parameters that have no activation effect from the input, the number of computational parameters in the model's calculation process can be reduced. This reduces output latency while maintaining model accuracy, meeting the output requirements of risk control scenarios. Finally, inputting the target risk control data into the replaced risk control detection model can efficiently generate risk control detection information. In summary, by replacing at least one parameter matrix corresponding to the target network module with a key parameter vector, the computational load in the model calculation process can be reduced and output latency can be lowered while maintaining model accuracy. Attached Figure Description
[0030] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and elements are not necessarily drawn to scale.
[0031] Figure 1 This is a schematic diagram illustrating an application scenario of a risk detection information generation method according to some embodiments of this disclosure;
[0032] Figure 2 These are flowcharts of some embodiments of the risk detection information generation method according to this disclosure;
[0033] Figure 3 These are flowcharts of some other embodiments of the risk detection information generation method according to this disclosure;
[0034] Figure 4 This is a schematic diagram of the structure of a risk control detection model in some embodiments of the risk detection information generation method according to this disclosure;
[0035] Figure 5 These are schematic diagrams illustrating the structure of some embodiments of the risk detection information generation apparatus according to this disclosure;
[0036] Figure 6 This is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. Detailed Implementation
[0037] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0038] It should also be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings. Unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other.
[0039] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0040] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0041] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0042] Before performing any of the operations involving the collection, storage, and use of user personal information (such as target risk control data) disclosed in this disclosure, the relevant organizations or individuals shall fulfill their obligations, including conducting personal information security impact assessments, informing personal information subjects, and obtaining prior authorization and consent from personal information subjects.
[0043] This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0044] Figure 1 This is a schematic diagram of an application scenario of a risk detection information generation method according to some embodiments of the present disclosure.
[0045] exist Figure 1In this application scenario, firstly, the electronic device 101 can acquire target risk control data 102 and a pre-trained risk control detection model 103. In this application scenario, the target risk control data 102 can be "risk control data A". The pre-trained risk control detection model 103 can include a target network module. The target network module can include parameter matrix A, parameter matrix B, and parameter matrix C. Then, the electronic device 101 can perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the above-mentioned risk control detection model 104 to obtain a replaced risk control detection model 104. In this application scenario, the replaced risk control detection model 104 can include: a replaced parameter matrix A after replacing parameter matrix A, a replaced parameter matrix B after replacing parameter matrix B, and a replaced parameter matrix C after replacing parameter matrix C. Finally, the electronic device 101 can input the above-mentioned target risk control data 102 into the above-mentioned replaced risk control detection model 104 to obtain risk control detection information 105.
[0046] It should be noted that the aforementioned electronic device 101 can be either hardware or software. When the electronic device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the electronic device is software, it can be installed in the hardware devices listed above. It can be implemented as, for example, multiple software programs or software modules used to provide distributed services, or as a single software program or software module. No specific limitations are made here.
[0047] It should be understood that Figure 1 The number of electronic devices shown is merely illustrative. Any number of electronic devices can be used depending on the implementation requirements.
[0048] Continue to refer to Figure 2 The flowchart 200 illustrates some embodiments of a risk detection information generation method according to the present disclosure. The risk detection information generation method includes the following steps:
[0049] Step 201: Obtain the target risk control data and the pre-trained risk control detection model.
[0050] In some embodiments, the entity executing the above-described risk detection information generation method (e.g.) Figure 1The electronic device 101 shown can acquire target risk control data and a pre-trained risk control detection model via wired or wireless connection. The target risk control data can be data to be detected. In practice, target risk control data can be credit data or data from the e-commerce field. The corresponding risk control detection can be detection of credit risk or fraudulent transaction risk. The risk control detection model can be a neural network model used for risk control detection. Depending on the data domain corresponding to the target risk control data, the corresponding risk control detection model is also a deep learning model pre-trained in the same data domain. For example, the risk control detection model can be a Transformer-based deep learning model. The risk control detection model can also be a deep learning model including an FFN (Feed-Forward Network) module. It should be noted that the risk control detection model can be a deep learning model with at least one parameter matrix having a higher number of parameters than the target number of parameters. This at least one parameter matrix can be a matrix with pre-determined parameters after training. That is, at least one parameter matrix is a parameter matrix in the risk control detection model trained on the risk control dataset with a higher number of parameters than the target number of parameters. The number of target parameters can be measured by multiplying the number of rows and columns of the parameter matrix. Since at least one parameter matrix corresponds to a huge number of parameters, the risk control detection model suffers from high computational load, consumes a large amount of resources, and wastes significant computing resources.
[0051] Step 202: Replace at least one parameter matrix corresponding to the target network module in the above risk control detection model with a key parameter vector to obtain the replaced risk control detection model.
[0052] In some embodiments, the execution entity can perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain a replaced risk control detection model. The target network module can be the network module in the risk control detection model to be vector-replaced. That is, the risk control detection model can include multiple network modules. Each network module includes a set of parameter matrices. The parameter matrix can be model parameters in matrix form. The parameters in the parameter matrix can be model parameters after model training. At least one parameter matrix can be a matrix whose matrix dimension satisfies the target condition. In practice, the target condition can be that the result of multiplying the number of rows by the number of columns is higher than the target value. The target value can represent that the parameter matrix is a matrix with a large number of parameters. For example, the target value can be a value set by experienced experts for the risk control detection model. That is, the target value can represent that the parameter matrix is a matrix with a large corresponding computational load. For example, the parameter matrix can be a 4000*2800 matrix. After inputting data into the risk control detection model, the computational load between the data and the parameter matrix is huge, resulting in a significant waste of computational resources and a long output time. The target network module can be a network module selected based on the model structure of the risk control detection model that represents a large computational load. For example, for a risk control detection model that is a Transformer model, the corresponding target network module can be a Feedforward Neural Network (FNN) module. Key parameter vector replacement can involve replacing the vectors in the parameter matrix with key parameter vectors. Key parameter vectors can be parameter vectors representing the key parameters in the parameter matrix. By replacing key parameter vectors, less important parameters in the parameter matrix can be replaced with important parameters, thus reducing the computational load while maintaining accuracy. For example, for a parameter matrix of [[1,2,3,6],[2,3,4,5],[2,3,4,6]], the corresponding key vector is [2,3,4,6]. We can replace [1,2,3,6] with [2,3,4,6]. The resulting risk control detection model can be the risk control detection model with the vectors in the parameter matrix replaced by key parameter vectors.
[0053] In a specific example, the key parameter vector can be generated through the following steps:
[0054] First, for each parameter matrix in at least one parameter matrix, perform the following replacement steps:
[0055] Sub-step 1: Determine the column vectors corresponding to the parameter matrix to obtain the column vector sequence.
[0056] Sub-step 2 involves dividing each column vector in the above column vector sequence into multiple column vector subsequences.
[0057] Sub-step 3: For each column vector subsequence in the multi-column vector subsequence, perform the following processing steps:
[0058] The first sub-step involves determining the mean column vector corresponding to each column vector in the above column vector subsequence, which serves as the key parameter vector.
[0059] The second sub-step involves selecting column vectors in the column vector subsequence whose vector distance from the aforementioned key parameter vectors is less than the target value, and using these as target column vectors.
[0060] The third sub-step involves replacing the target column vector in the vector subsequence with the key parameter vector, resulting in the replaced vector subsequence.
[0061] Sub-step 4 involves combining the obtained multiple replaced vector subsequences into a parameter matrix to obtain the replaced parameter matrix.
[0062] In some optional implementations of certain embodiments, the execution entity may perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain a replaced risk control detection model, including the following steps:
[0063] First, for each parameter matrix in at least one of the above parameter matrices, perform the replacement step:
[0064] Sub-step 1: Determine at least one key parameter vector corresponding to the above parameter matrix. The at least one key parameter vector can be any vector in the parameter matrix to be replaced.
[0065] As an example, firstly, the execution entity can divide the parameter matrix into multiple vector sequences based on the column partitioning method. Then, for each vector sequence, the mean vector is determined. The mean vector can be obtained by averaging the individual vectors in the vector sequence. Finally, at least one mean vector is determined as at least one key parameter vector.
[0066] Sub-step 2 involves replacing each column of the parameter vector in the parameter matrix with a target key parameter vector. This target key parameter vector is the one among the at least one key parameter vectors that is semantically most similar to the original parameter vector. Vector semantic similarity characterizes the degree of similarity between the corresponding contents of the vectors. In practice, vector semantic similarity can be measured using a similarity score. Vector semantic similarity can be a value between 0 and 1; a higher value indicates greater similarity between the two vectors.
[0067] The second step involves replacing at least one parameter matrix in the target network module with a replaced parameter matrix to obtain the replaced risk control detection model. The replaced parameter matrix can be the parameter matrix after replacing the key parameter vectors. There is a one-to-one correspondence between the parameter matrices in the replaced parameter matrix and the parameter matrices in the at least one parameter matrix.
[0068] Optionally, the aforementioned execution entity may determine at least one key parameter vector corresponding to the aforementioned parameter matrix, including the following steps:
[0069] The first step is to cluster the parameter vectors in the parameter matrix to obtain parameter vector clusters. Here, because the parameter matrix has a large dimension for the corresponding vectors, the number of column vector parameters is also large. A column parameter vector can be a single parameter vector from the parameter matrix. Within each parameter vector cluster, the parameter vectors share similar parameter values. Each parameter vector cluster has a unique cluster center vector.
[0070] As an example, the aforementioned execution entity can use the k-means clustering algorithm to cluster the multiple columns of parameter vectors in the parameter matrix to obtain a set of parameter vector clusters.
[0071] The second step is to determine the cluster center set of the parameter vectors corresponding to the above parameter vector cluster set as at least one of the above key parameter vectors.
[0072] Step 203: Input the target risk control data into the replaced risk control detection model to obtain risk control detection information.
[0073] In some embodiments, the aforementioned executing entity may input the aforementioned target risk control data into the aforementioned replaced risk control detection model to obtain risk control detection information. This risk control detection information may be a risk control detection result. For example, the risk control detection information may be one of the following: a result indicating the presence of risk control risk, or a result indicating the absence of risk control risk.
[0074] Optionally, the aforementioned execution entity may perform clustering processing on the multi-column parameter vectors in the aforementioned parameter matrix to obtain a parameter vector cluster set, including the following steps:
[0075] The first step is to obtain current memory usage information. This information can represent the memory usage at the current time. For example, it could be a percentage of memory usage, such as 20%.
[0076] The second step is to determine the number of clusters to be used for clustering the multi-column parameter vectors based on the current memory usage and the computational load of the model. When memory usage is low, a higher computational load can be supported, allowing for a larger number of clusters to improve accuracy. Conversely, when memory usage is high, a lower computational load can be supported, allowing for fewer cluster centers to reduce memory consumption while maintaining accuracy.
[0077] As an example, the aforementioned execution entity can determine the number of clusters corresponding to the current memory usage information and model computation volume based on the association table. The association table represents the relationship between memory usage information, model computation volume, and the number of clusters.
[0078] The third step is to perform clustering on the multiple columns of parameter vectors in the parameter matrix based on the number of clusters mentioned above, to obtain a parameter vector cluster set.
[0079] Optionally, the aforementioned execution entity may perform clustering processing on the multi-column parameter vectors in the aforementioned parameter matrix to obtain a parameter vector cluster set, including the following steps:
[0080] The first step is to determine an initial number of target parameter column vectors in the parameter matrix mentioned above, which will serve as the initial cluster center set. The initial number can be a pre-set number of clusters based on experience. The initial cluster centers can be preliminarily determined cluster centers. The target parameter column vectors can be parameter column vectors selected from the parameter matrix.
[0081] As an example, the aforementioned execution entity can randomly select an initial number of target parameter column vectors from the parameter matrix as the initial cluster center set.
[0082] The second step involves assigning each parameter column vector in the parameter matrix to the cluster set corresponding to its nearest initial cluster center. This assignment of parameter column vectors to their respective initial cluster centers achieves vector partitioning. The distance can be the distance between vectors, which can be measured using cosine similarity.
[0083] As an example, for each parameter column vector, determine the cosine distances between the parameter column vector and each initial cluster center. Add the parameter column vector to the cluster set corresponding to the initial cluster center with the smallest cosine distance.
[0084] Third, in response to the determination that the number of replacements corresponding to the rearranged vector clusters has reached the target number, the following determination steps are performed for the rearranged vector clusters:
[0085] Sub-step 1 involves identifying the two cluster centers with the closest vector distance from the corresponding cluster center set after the vector cluster set is rearranged, designated as the first cluster center and the second cluster center, respectively. The number of replacements can be the number of vector cluster replacement operations performed. The minimum distance among the distances between all cluster centers is the distance between the first and second cluster centers.
[0086] Sub-step 2, in response to determining that the vector distance between the first cluster center and the second cluster center is less than the target distance, performs cluster fusion on the first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center to obtain the processed vector cluster. The resulting vector cluster set includes the first vector cluster and the second vector cluster. The target distance is the distance value set during the clustering process used to determine whether the first cluster center and the second cluster center should belong to the same cluster. When the vector distance between the first cluster center and the second cluster center is less than the target distance, it indicates that the vector group distances between the vector groups corresponding to the first cluster center and the second cluster center are similar. Cluster fusion facilitates further, more precise determination of the cluster centers for the first and second vector clusters.
[0087] Sub-step 3 involves redetermining the cluster center corresponding to the processed vector clusters, and replacing the first and second vector clusters in the rearranged vector cluster set with the processed vector clusters to obtain the replaced vector cluster set.
[0088] As an example, the aforementioned execution entity can first average the vectors of the first and second cluster centers to obtain an average vector. Then, it selects the vector with the smallest vector distance from the first and second vector clusters to the average vector as the cluster center corresponding to the processed vector cluster.
[0089] As another example, firstly, the aforementioned execution entity can filter out the vector region with the highest vector density from the processed vector clusters. Then, the center vector within the vector region is determined as the cluster center corresponding to the processed vector cluster.
[0090] Sub-step 4: In response to determining that the number of replacements for the replaced vector clusters has reached the target number, the replaced vector clusters are defined as the parameter vector clusters. The target number can be the number of replacements. The target number is also a parameter in the clustering process. Setting the target number can characterize the termination condition of the clustering process. A reasonable target number setting can reduce the number of executions of the clustering process and reduce the waste of computational resources while ensuring accurate clustering.
[0091] Optionally, the steps also include:
[0092] In response to the determination that the number of replacements corresponding to the replaced vector clusters has not reached the target number and / or that the vector transformations of the rearranged vector cluster sequence satisfy the target vector transformation condition, the executing entity may use the replaced vector clusters as the rearranged vector clusters and continue to execute the above determination steps. The vector transformation satisfying the target vector transformation condition indicates that the transformation of the vector clusters tends to be stable. The target vector transformation condition may be that the number of vector transformations is less than the target number. The rearranged vector cluster sequence may be the rearranged vector clusters under the most recent number of replacements. The rearranged vector clusters are ordered according to their generation time.
[0093] Optionally, after the above-mentioned response to determining that the vector distance between the first cluster center and the second cluster center is less than the target distance, performing cluster fusion on the first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center to obtain the processed vector cluster, the above method further includes:
[0094] The first step involves reselecting cluster centers from the first and second vector clusters in response to the determination that the vector distance between the first and second cluster centers is greater than or equal to the target distance. This results in reselected first and second cluster centers. The cluster distance between the reselected first and second cluster centers is less than the target distance. Here, the determination that the vector distance is greater than or equal to the target distance indicates that the selected cluster centers of the first and second vector clusters are too far apart, and the selected cluster centers are not precise enough. Therefore, reselection of cluster centers is necessary.
[0095] The second step is to replace the first and second vector clusters in the rearranged vector cluster set with the newly selected first and second vector clusters, respectively, to obtain the processed vector clusters. The cluster center of the newly selected first vector cluster is the newly selected first cluster center, and the cluster center of the newly selected second vector cluster is the newly selected second cluster center.
[0096] Optionally, in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number, the replacement vector cluster set is used as the normalized vector cluster set, and the above determination step is continued. This may include the following steps:
[0097] The first step involves selecting the target vector cluster from the replaced vector cluster set if the number of replacements has not reached the target number and the number of clusters in the replaced vector cluster set is less than the target number of clusters. The target vector cluster is the vector cluster with the highest maximum vector distance, where the maximum vector distance is the distance between the two farthest vectors in the cluster. The target number of clusters can be a pre-set cluster number parameter during the clustering process. The target number of clusters ensures that the final vector cluster set has a higher number of clusters than a certain value.
[0098] As an example, firstly, for each replaced vector cluster in the set of replaced vector clusters, the aforementioned execution entity can determine the distance between the two farthest vectors in the replaced vector cluster, which is taken as the maximum vector distance. Then, the vector cluster with the highest maximum vector distance is selected from the set of replaced vector clusters as the target vector cluster.
[0099] The second step is to split the target vector cluster into a split vector cluster set. The number of clusters corresponding to the split vector clusters can be determined based on the number of clusters corresponding to the replaced vector cluster set.
[0100] As an example, the aforementioned execution entity can divide the target vector cluster according to the vector density to obtain a split vector cluster set.
[0101] The third step is to replace the target vector cluster in the replaced vector cluster set with the split vector cluster set to obtain the vector cluster set after the replacement, which is then used as the rearranged vector cluster set. The above determination steps are then performed again.
[0102] The above embodiments of this disclosure have the following beneficial effects: Through the risk detection information generation method of some embodiments of this disclosure, risk control detection information can be generated efficiently and quickly while ensuring output accuracy and reducing output latency in the risk control field. Specifically, the reason for the inaccurate output and output latency of the relevant risk control detection information is that the model performs poorly in edge processing of various objects in the image. Based on this, the risk detection information generation method of some embodiments of this disclosure first acquires target risk control data and a pre-trained risk control detection model. Here, the target risk control data serves as the input to the model. The risk control detection model serves as a deep learning model for risk control detection, facilitating the output of risk control detection information. Then, key parameter vector replacement is performed on at least one parameter matrix corresponding to the target network module in the above-mentioned risk control detection model to obtain the replaced risk control detection model. Here, by replacing at least one parameter matrix with a key parameter vector, the computational load between the input content and the parameter matrix can be avoided. Only the key parameter vector needs to be calculated. By removing parameters that have no activation effect from the input, the number of computational parameters in the model's calculation process can be reduced. This reduces output latency while maintaining model accuracy, meeting the output requirements of risk control scenarios. Finally, inputting the target risk control data into the replaced risk control detection model can efficiently generate risk control detection information. In summary, by replacing at least one parameter matrix corresponding to the target network module with a key parameter vector, the computational load in the model calculation process can be reduced and output latency can be lowered while maintaining model accuracy.
[0103] Further reference Figure 3 The diagram illustrates a flow 300 of another embodiment of the risk detection information generation method according to the present disclosure. This risk detection information generation method includes the following steps:
[0104] Step 301: Obtain the target risk control data and the pre-trained risk control detection model.
[0105] Step 302: Based on the feature dimensions corresponding to the target risk control data and the model parameter matrix corresponding to the risk control detection model, the computational load of the model for generating risk control detection information is determined using the model pre-calculation method.
[0106] In some embodiments, the executing entity (e.g. Figure 1The electronic device 101 shown can determine the computational complexity of generating risk control detection information by using a model pre-computation method, based on the feature dimensions corresponding to the target risk control data and the model parameter matrix corresponding to the risk control detection model. The feature dimensions can be the number of features and the feature value dimension of each attribute feature involved in the risk control data. The feature value dimension can characterize the value category of the attribute feature. For example, the target risk control data corresponds to an attribute feature with a value of 50 (i.e., the binning result of each feature is 50). The risk control detection model includes a word embedding module and a risk control detection module. The word embedding module can be a network layer that performs word embedding processing on the risk control data (e.g., user behavior data). In practice, the word embedding module can be an Embedding lookup table module. The computational complexity of the model corresponding to the word embedding module can be determined based on the Embedding table. The dimension corresponding to the Embedding table is "the total number of features * the result of feature binning". For example, the dimension corresponding to the Embedding table is "927 * 50". The model pre-computation method can be a method for calculating the computational complexity of the model. For example, the model pre-computation method can be a hierarchical decomposition method.
[0107] As an example, the aforementioned execution entity can multiply the computational cost corresponding to the Embedding table and the computational cost corresponding to the risk control detection module to obtain the model computational cost.
[0108] See Figure 4 The diagram shows the structural schematic of the risk control detection model.
[0109] like Figure 4As shown, the target risk control data may include: feature parameters feat_g_1, feat_g_2, feat_g_3, feat_g_4, feat_g_5, feat_g_6, and text information. Performing data type conversion (corresponding to Cast in the diagram), bias term addition (corresponding to Add in the diagram), embedding table lookup (corresponding to Gather in the diagram), and matrix transformation (corresponding to Reshape in the diagram) on the feature parameter feat_g_1 yields a 1*2740 feature vector. Similarly, performing various operations (data type conversion, bias term addition, embedding table lookup, and matrix transformation) on the feature parameter feat_g_2 yields a 1*100 feature vector. Performing various operations (data type conversion, embedding table lookup, and matrix transformation) on the feature parameter feat_g_3 yields a 1*4 feature vector. After performing various operations on the feature parameter feat_g_4 (data type conversion, embedding table lookup, and matrix transformation), a 1*4 feature vector is obtained. After performing various operations on the feature parameter feat_g_5 (data type conversion, bias term addition, embedding table lookup, and matrix transformation), a 1*8 feature vector is obtained. After performing various operations on the feature parameter feat_g_6 (data type conversion, bias term addition, embedding table lookup, and matrix transformation), a 1*852 feature vector is obtained. Transform processing is applied to the text (corresponding to text-to-vector conversion), resulting in a 1*312 feature vector. The risk control detection module can include 7 FFN modules. Each FFN module includes: a Matmul layer (i.e., matrix multiplication layer), an Add layer, and a ReLU layer (activation function layer). The computational dimensions corresponding to the seven FFN modules are "4020*4020", "4020*4020", "4020*8040", "4020*8040", "4020*12060", "4020*12060", and "4020*16080". Therefore, the computational size of the risk control detection model is 927*50*(4020*2+8040*2+12060*2+16080)*10 bytes = 29812320000, approximately 29GB. Thus, the target risk control detection model occupies a significant amount of memory.
[0110] Step 303: In response to determining that the computational load of the above model meets the computational load condition, key parameter vector replacement is performed on at least one parameter matrix corresponding to the target network module in the above risk control detection model to obtain the replaced risk control detection model.
[0111] In some embodiments, in response to determining that the computational load of the model meets the computational load condition, the execution entity may perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain a replaced risk control detection model. The computational load condition may be that the model's computational load exceeds a set computational load and the memory occupied by the model exceeds a set memory limit.
[0112] Step 304: Input the target risk control data into the replaced risk control detection model to obtain risk control detection information.
[0113] from Figure 3 It can be seen from this that, with Figure 2 Compared to the description of some corresponding embodiments, Figure 3 In some corresponding embodiments, the process 300 of the risk detection information generation method, by pre-training the risk control detection model, can effectively reduce the amount of computation and output latency in a timely manner, taking into account the memory usage and computational limitations under the current situation.
[0114] Further reference Figure 5 As an implementation of the methods shown in the above figures, this disclosure provides some embodiments of a risk detection information generation device, which are similar to... Figure 2 Corresponding to the method embodiments shown, this risk detection information generation device can be specifically applied to various electronic devices.
[0115] like Figure 5 As shown, a risk detection information generation device 500 includes: an acquisition unit 501, a replacement unit 502, and an input unit 503. The acquisition unit 501 is configured to acquire target risk control data and a pre-trained risk control detection model; the replacement unit 502 is configured to replace at least one parameter matrix corresponding to a target network module in the risk control detection model with a key parameter vector to obtain a replaced risk control detection model; the input unit 503 is configured to input the target risk control data into the replaced risk control detection model to obtain risk control detection information.
[0116] In some optional implementations of some embodiments, the replacement unit 502 may be further configured to: for each parameter matrix in the at least one parameter matrix, perform a replacement step: determine at least one key parameter vector corresponding to the parameter matrix; for each column of parameter vectors in the parameter matrix, replace the parameter vector with a target key parameter vector, wherein the target key parameter vector is the key parameter vector among the at least one key parameter vectors that is most similar in vector semantics to the parameter vector; replace at least one parameter matrix in the target network module with the replaced at least one parameter matrix to obtain the replaced risk control detection model.
[0117] In some optional implementations of some embodiments, the replacement unit 502 may be further configured to: perform clustering processing on the multiple columns of parameter vectors in the parameter matrix to obtain a parameter vector cluster set; and determine the parameter vector cluster center set corresponding to the parameter vector cluster set as at least one key parameter vector.
[0118] In some optional implementations of certain embodiments, the apparatus 500 further includes a determining unit (not shown in the figure). This determining unit can be configured to: determine the computational load of the model used to generate the risk control detection information based on the feature dimensions corresponding to the target risk control data and the model parameter matrix corresponding to the risk control detection model, using a model pre-calculation method.
[0119] In some optional implementations of some embodiments, the replacement unit 502 may be further configured to: in response to determining that the computational amount of the model meets the computational amount condition, perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model.
[0120] In some optional implementations of certain embodiments, the replacement unit 502 may be further configured to: obtain current memory usage information; determine the number of clusters for clustering the multi-column parameter vectors based on the current memory usage information and the computational load of the model; and perform clustering on the multi-column parameter vectors in the parameter matrix based on the number of clusters to obtain a parameter vector cluster set.
[0121] In some optional implementations of certain embodiments, the replacement unit 502 may be further configured to: determine an initial number of target parameter column vectors in the parameter matrix as an initial cluster center set; for each parameter column vector in the parameter matrix, assign the parameter column vector to the cluster set corresponding to the nearest initial cluster center; in response to determining that the replacement count corresponding to the assigned vector cluster set has reached a target number, for the assigned vector cluster set, perform the following determination steps: determine the two cluster centers with the closest vector distance in the cluster center set corresponding to the assigned vector cluster set, respectively as the first cluster center and the second cluster center; in response to determining The vector distance between the first cluster center and the second cluster center is less than the target distance. The first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center are fused to obtain a processed vector cluster. The reset vector cluster set includes the first vector cluster and the second vector cluster. The cluster center corresponding to the processed vector cluster is re-determined, and the first and second vector clusters in the reset vector cluster set are replaced with the processed vector cluster to obtain a replaced vector cluster set. In response to determining that the number of replacements corresponding to the replaced vector cluster set has reached the target number, the replaced vector cluster set is determined as the parameter vector cluster set.
[0122] In some optional implementations of some embodiments, the replacement unit 502 may be further configured to: in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number and / or that the vector transformation of the reset vector cluster set sequence satisfies the target vector transformation condition, the replaced vector cluster set is used as the reset vector cluster set, and the above determination step is continued.
[0123] In some optional implementations of certain embodiments, the replacement unit 502 may be further configured to: in response to determining that the vector distance between the first cluster center and the second cluster center is greater than or equal to the target distance, reselect cluster centers from the first vector cluster and the second vector cluster respectively to obtain reselected first cluster centers and reselected second cluster centers, wherein the cluster distance between the reselected first cluster centers and the reselected second cluster centers is less than the target distance; replace the first vector cluster and the second vector cluster in the normalized vector cluster set with the reselected first vector cluster and the reselected second vector cluster respectively to obtain processed vector clusters, wherein the cluster center of the reselected first vector cluster is the reselected first cluster center, and the cluster center of the reselected second vector cluster is the reselected second cluster center.
[0124] In some optional implementations of certain embodiments, the replacement unit 502 may be further configured to: in response to determining that the number of replacements corresponding to the replaced vector cluster set has not reached the target number and the number of clusters corresponding to the replaced vector cluster set is less than the target number of clusters, select the vector cluster with the highest maximum vector distance from the replaced vector cluster set as the target vector cluster, where the maximum vector distance is the distance between the two farthest vectors in the vector cluster; split the target vector cluster to obtain a split vector cluster set; replace the target vector cluster in the replaced vector cluster set with the split vector cluster set to obtain a vector cluster set after replacement, which is used as the rearranged vector cluster set, and continue to perform the above determination steps.
[0125] It is understandable that the units recorded in the risk detection information generation device 500 are related to the reference. Figure 2 The steps in the described method correspond to each other. Therefore, the operations, features, and beneficial effects described above for the method also apply to the risk detection information generation device 500 and the units contained therein, and will not be repeated here.
[0126] The following is for reference. Figure 6 It illustrates electronic devices suitable for implementing some embodiments of this disclosure (e.g., Figure 1 A schematic diagram of the structure of electronic device 101)600 in the middle. Figure 6 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments of this disclosure.
[0127] like Figure 6 As shown, the electronic device 600 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory 602 or a program loaded from a storage device 608 into a random access memory 603. The random access memory 603 also stores various programs and data required for the operation of the electronic device 600. The processing unit 601, the read-only memory 602, and the random access memory 603 are interconnected via a bus 604. An input / output interface 605 is also connected to the bus 604.
[0128] Typically, the following devices can be connected to the input / output interface 605: input devices 606 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 608 including, for example, magnetic tape, hard disk, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively. Figure 6 Each box shown can represent a device or multiple devices as needed.
[0129] In particular, according to some embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, some embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a read-only memory 602. When the computer program is executed by the processing device 601, it performs the functions defined above in the methods of some embodiments of this disclosure.
[0130] It should be noted that, in some embodiments of this disclosure, the computer-readable medium described above may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In some embodiments of this disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In some embodiments of this disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0131] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.
[0132] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device. The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: acquire target risk control data and a pre-trained risk control detection model; perform key parameter vector replacement on at least one parameter matrix corresponding to the target network module in the aforementioned risk control detection model to obtain a replaced risk control detection model; and input the aforementioned target risk control data into the replaced risk control detection model to obtain risk control detection information.
[0133] Computer program code for performing operations of some embodiments of this disclosure can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, and conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0134] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0135] The units described in some embodiments of this disclosure can be implemented in software or hardware. The described units can also be housed in a processor; for example, a processor may be described as including an acquisition unit, a replacement unit, and an input unit. The names of these units do not necessarily limit the unit itself; for example, an acquisition unit may also be described as "a unit for acquiring target risk control data and a pre-trained risk control detection model."
[0136] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0137] Some embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements any of the risk detection information generation methods described above.
[0138] The above description is merely a selection of preferred embodiments of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in the embodiments of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features with similar functions disclosed in the embodiments of this disclosure.
Claims
1. A risk detection information generation method, comprising: obtaining target risk control data and a pre-trained risk control detection model; performing key parameter vector replacement on at least one parameter matrix corresponding to a target network module in the risk control detection model to obtain a replaced risk control detection model; inputting the target risk control data into the replaced risk control detection model to obtain risk control detection information.
2. The method of claim 1, wherein, The key parameter vector replacement on the at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model comprises: for each parameter matrix in the at least one parameter matrix, performing a replacement step: determining at least one key parameter vector corresponding to the parameter matrix; for each column parameter vector in the parameter matrix, replacing the parameter vector with a target key parameter vector, the target key parameter vector being a key parameter vector in the at least one key parameter vector that is most similar in semantic to the parameter vector; replacing at least one parameter matrix in the target network module with at least one replaced parameter matrix to obtain a replaced risk control detection model.
3. The method of claim 2, wherein, The determination of the at least one key parameter vector corresponding to the parameter matrix comprises: performing clustering processing on multiple column parameter vectors in the parameter matrix to obtain a parameter vector cluster set; determining a parameter vector cluster center set corresponding to the parameter vector cluster set as the at least one key parameter vector.
4. The method of claim 3, wherein, After the obtaining of the target risk control data and the pre-trained risk control detection model, the method further comprises: determining a model calculation amount for generating risk control detection information according to a feature dimension corresponding to the target risk control data and a model parameter matrix corresponding to the risk control detection model using a model pre-computation method; and The key parameter vector replacement on the at least one parameter matrix corresponding to the target network module in the risk control detection model to obtain the replaced risk control detection model comprises: in response to determining that the model calculation amount satisfies a calculation amount condition, performing key parameter vector replacement on at least one parameter matrix corresponding to a target network module in the risk control detection model to obtain a replaced risk control detection model.
5. The method of claim 4, wherein, The clustering processing on the multiple column parameter vectors in the parameter matrix to obtain a parameter vector cluster set comprises: obtaining current memory occupation information; determining a cluster number for clustering processing on multiple column parameter vectors according to the current memory occupation information and the model calculation amount; performing clustering processing on the multiple column parameter vectors in the parameter matrix according to the cluster number to obtain a parameter vector cluster set.
6. The method of claim 3, wherein, The clustering processing on the multiple column parameter vectors in the parameter matrix to obtain a parameter vector cluster set comprises: determining an initial number of target parameter column vectors in the parameter matrix as an initial cluster center set; for each parameter column vector in the parameter matrix, assigning the parameter column vector to a cluster set corresponding to the nearest initial cluster center; in response to determining that a replacement number corresponding to the assigned vector cluster set reaches a target number, performing the following determination step for the assigned vector cluster set: determining two cluster centers closest to the vector distance in the cluster center set corresponding to the vector cluster set after the arrangement as a first cluster center and a second cluster center respectively; in response to determining that the vector distance between the first cluster center and the second cluster center is less than the target distance, performing cluster fusion on the first vector cluster corresponding to the first cluster center and the second vector cluster corresponding to the second cluster center to obtain a processed vector cluster, wherein the vector cluster set after the arrangement includes the first vector cluster and the second vector cluster; redetermining the cluster center corresponding to the processed vector cluster, and replacing the first vector cluster and the second vector cluster in the vector cluster set after the arrangement with the processed vector cluster to obtain a replaced vector cluster set; in response to determining that the replacement number corresponding to the replaced vector cluster set reaches the target number, determining the replaced vector cluster set as the parameter vector cluster set.
7. The method of claim 6, wherein, The method further includes: in response to determining that the replacement number corresponding to the replaced vector cluster set does not reach the target number and / or the vector transformation of the vector cluster set after the arrangement meets the target vector transformation condition, continuing to execute the determining step with the replaced vector cluster set as the vector cluster set after the arrangement.
8. The method of claim 6, wherein, After the response to determining that the vector distance between the first cluster center and the second cluster center is less than the target distance, the method further includes: in response to determining that the vector distance between the first cluster center and the second cluster center is greater than or equal to the target distance, reselecting the cluster center from the first vector cluster and the second vector cluster respectively to obtain a reselected first cluster center and a reselected second cluster center, wherein the cluster distance between the reselected first cluster center and the reselected second cluster center is less than the target distance; replacing the first vector cluster and the second vector cluster in the vector cluster set after the arrangement with the reselected first vector cluster and the reselected second vector cluster respectively to obtain a processed vector cluster, the cluster center of the reselected first vector cluster being the reselected first cluster center, and the cluster center of the reselected second vector cluster being the reselected second cluster center.
9. The method of claim 7, wherein, The response to determining that the replacement number corresponding to the replaced vector cluster set does not reach the target number, and continuing to execute the determining step with the replaced vector cluster set as the vector cluster set after the arrangement, includes: in response to determining that the replacement number corresponding to the replaced vector cluster set does not reach the target number and the cluster number corresponding to the replaced vector cluster set is less than a target cluster number, filtering out a vector cluster with the highest maximum vector distance from the replaced vector cluster set as a target vector cluster, the maximum vector distance being the distance between the two vectors farthest apart in the vector cluster; splitting the target vector cluster to obtain a split vector cluster set; replacing the target vector cluster in the replaced vector cluster set with the split vector cluster set to obtain a vector cluster set after the second replacement as the vector cluster set after the arrangement, and continuing to execute the determining step.
10. A risk detection information generation device, comprising: An acquisition unit configured to acquire target risk control data and a pre-trained risk control detection model; A replacement unit configured to replace at least one parameter matrix corresponding to a target network module in the risk control detection model with a key parameter vector to obtain a replaced risk control detection model; An input unit configured to input the target risk control data into the replaced risk control detection model to obtain risk control detection information. 11.An electronic device, comprising: one or more processors; a memory device having one or more programs stored thereon, when the one or more programs are executed by the one or more processors, the one or more processors implement the method of any one of claims 1-9.
12. A computer readable medium having stored thereon a computer program, wherein, The computer program is executed by the processor to implement the method of any one of claims 1-9. 13.A computer program product comprising a computer program which, when executed by a processor, implements the method according to any one of claims 1-9.
Citation Information
Patent Citations
Risk control model modeling method and device and risk control method and device
CN116361745A
General network compression framework and compression method based on sequence recommendation system
WO2021159448A1