A method, device, storage medium and electronic device for training a classification model

By identifying the invalid dimensions of the graph neural network model and optimizing the loss function, the problem of training sample dependency was solved, and the classification accuracy of the model was improved.

CN116363418BActive Publication Date: 2026-02-13ZHEJIANG LAB +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310240413.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-06
Publication Date
2026-02-13
Estimated Expiration
2043-03-06

AI Technical Summary

Technical Problem

In current technologies, the accuracy of graph neural network models depends on the quality of the training samples, and there is a lack of effective methods to improve model accuracy.

Method used

By identifying the invalid dimensions of each sub-network layer, calculating the invalid dimensions of nodes, and determining the loss based on the output results of these dimensions and the training sample labels, the classification model is trained with the goal of minimizing the total loss.

Benefits of technology

It improves the classification accuracy of graph neural network models and reduces the impact of invalid dimensions on the output results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116363418B_ABST
    Figure CN116363418B_ABST
Patent Text Reader

Abstract

The specification discloses a method, device, storage medium and electronic equipment for training a classification model. The method determines invalid dimensions in input dimensions corresponding to each sub-network layer, determines results output by each calculation node on the invalid dimensions corresponding to each sub-network layer which are invalid for the output result of the classification model, determines a first loss according to the output results, determines a total loss according to a second loss determined based on a training sample label and the first loss, and trains the classification model with the total loss being minimum, thereby reducing the influence of the results output by each calculation node on the invalid dimensions corresponding to each sub-network layer on the output result of the classification model and improving the classification accuracy of the classification model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a method, apparatus, storage medium, and electronic device for training a classification model. Background Technology

[0002] With the continuous development of machine learning-related technologies, classification models are being applied more and more widely.

[0003] Different types of models can be trained to determine the classification results for different types of data. For example, for image data, a Convolutional Neural Network (CNN) model can be trained to classify images. In the scenario of classifying graph data, a Graph Neural Network (GNN) model can be used to classify graph data. Generally, the nodes involved in the computation in a GNN model are called computation nodes.

[0004] Currently, when training GNN models using supervised learning, the accuracy of the trained model largely depends on the quality of the training samples, and there is a lack of methods to further improve the accuracy of the trained GNN model. Therefore, this specification provides a method for training a classification model. Summary of the Invention

[0005] This specification provides a method, apparatus, storage medium, and electronic device for training a classification model, in order to partially solve the aforementioned problems existing in the prior art.

[0006] The following technical solution is adopted in this specification:

[0007] This specification provides a method for training a classification model, wherein the classification model includes multiple sub-network layers, and the method includes:

[0008] The training samples and their labels are determined based on the nodes in the graph data;

[0009] The training samples are input into the classification model to obtain the classification results of the nodes in the graph data corresponding to the training samples, as output by the classification model.

[0010] For each sub-network layer in the classification model, determine the input data for each input dimension in that sub-network layer, and based on the input data for each input dimension and the model parameters of each computation node in that sub-network layer, determine the invalid dimensions corresponding to each computation node in that sub-network layer.

[0011] Based on the invalid dimensions corresponding to each computing node in the sub-network layer, determine the invalid dimensions corresponding to the sub-network layer from each input dimension of the sub-network layer;

[0012] The first loss is determined based on the output of each computation node on the invalid dimension corresponding to each sub-network layer, and the second loss is determined based on the annotation and the output of the classification model.

[0013] Based on the first loss and the second loss, the total loss is determined, and the classification model is trained with the minimum total loss as the optimization objective.

[0014] Optionally, based on the input data for each input dimension and the model parameters of each computation node in the sub-network layer, invalid dimensions corresponding to each computation node in the sub-network layer are determined, specifically including:

[0015] For each computation node in the sub-network layer, the model parameters corresponding to each input dimension of the computation node are determined from the model parameters of the sub-network layer;

[0016] For each input dimension in this sub-network layer, the output result of the computing node for that input dimension is determined based on the parameters of the computing node corresponding to that input dimension and the input data of that input dimension.

[0017] Based on the output results of each computation node in the sub-network layer corresponding to each input dimension, the invalid dimensions corresponding to each computation node in the sub-network layer are determined.

[0018] Optionally, based on the output results of each computation node in the sub-network layer corresponding to each input dimension, the invalid dimensions corresponding to each computation node in the sub-network layer are determined, specifically including:

[0019] For each computation node in the sub-network layer, the output results of the computation node for each input dimension are normalized to obtain the first result corresponding to each input dimension of the computation node.

[0020] For each input dimension in the sub-network layer, if the first result corresponding to the input dimension of the computing node is not greater than the first preset threshold, the input dimension corresponding to the computing node is determined to be an invalid dimension.

[0021] Optionally, based on the invalid dimensions corresponding to each computation node in the sub-network layer, the invalid dimensions corresponding to the sub-network layer are determined from the input dimensions of the sub-network layer, specifically including:

[0022] For each input dimension in this sub-network layer, the invalid dimension corresponding to each computing node is determined as the computing node for that input dimension, and is used as the target computing node for that input dimension;

[0023] The number of non-target computation nodes in each input dimension of the sub-network layer is normalized to obtain the second result corresponding to each input dimension of the sub-network layer;

[0024] For each input dimension in the sub-network layer, if the second result corresponding to the input dimension is not greater than the second preset threshold, the input dimension is an invalid dimension corresponding to the sub-network layer.

[0025] Optionally, the first loss is determined based on the output results of each computation node on the invalid dimension corresponding to each sub-network layer, specifically including:

[0026] For each sub-network layer, the first sub-loss is determined by the sum of the outputs of each computation node on the invalid dimension corresponding to that sub-network layer.

[0027] The first loss is determined by the sum of all first sub-losses.

[0028] Optionally, the total loss is determined based on the first loss and the second loss, specifically including:

[0029] Determine the weight of the first loss;

[0030] The weighted first loss is determined based on the first loss and the weight;

[0031] The total loss is determined based on the weighted first loss and the second loss.

[0032] Optionally, the sub-network layers of the classification model are arranged in order from the input sub-network layer to the output sub-network layer;

[0033] The method further includes:

[0034] For each input dimension of the current sub-network layer, if the input dimension is invalid, then the output dimension of the previous sub-network layer corresponding to the current sub-network layer is invalid.

[0035] For each computation node in the previous sub-network layer of the current sub-network layer, if the output dimension corresponding to the computation node is the same as the output dimension, then the computation node is regarded as an invalid node.

[0036] In the sub-network layer preceding the current sub-network layer, the input dimension corresponding to the invalid node is the invalid dimension of that sub-network layer.

[0037] This specification provides an apparatus for training a classification model, the classification model comprising multiple sub-network layers, the apparatus comprising:

[0038] A determination module is used to determine training samples and their annotations, wherein the training samples are determined based on nodes in the graph data;

[0039] The classification module is used to input the training samples into the classification model and obtain the classification results of the nodes in the graph data corresponding to the training samples output by the classification model.

[0040] The first calculation module is used to determine the input data of each input dimension in each sub-network layer of the classification model, and to determine the invalid dimension corresponding to each calculation node in the sub-network layer based on the input data of each input dimension and the model parameters of each calculation node in the sub-network layer.

[0041] The second calculation module is used to determine the invalid dimension corresponding to the sub-network layer from each input dimension of the sub-network layer based on the invalid dimension corresponding to each calculation node in the sub-network layer.

[0042] The loss module is used to determine the first loss based on the output results of each computation node on the invalid dimension corresponding to each sub-network layer, and to determine the second loss based on the annotation and the output results of the classification model.

[0043] The training module is used to determine the total loss based on the first loss and the second loss, and to train the classification model with the goal of minimizing the total loss.

[0044] Optionally, the first calculation module is specifically configured to, for each calculation node in the sub-network layer, determine the model parameters corresponding to each input dimension of the calculation node from the model parameters of the sub-network layer; for each input dimension in the sub-network layer, determine the output result of the calculation node corresponding to the input dimension based on the parameters of the calculation node corresponding to the input dimension and the input data of the input dimension; and determine the invalid dimensions corresponding to each calculation node in the sub-network layer based on the output results of each calculation node corresponding to each input dimension in the sub-network layer.

[0045] Optionally, the first calculation module is specifically used to normalize the output results of each calculation node corresponding to each input dimension for each calculation node in the sub-network layer to obtain the first result corresponding to each input dimension of the calculation node; and for each input dimension in the sub-network layer, when the first result corresponding to the input dimension of the calculation node is not greater than the first preset threshold, the input dimension corresponding to the calculation node is determined to be an invalid dimension.

[0046] Optionally, the second calculation module is specifically used to determine, for each input dimension in the sub-network layer, the invalid dimension corresponding to each calculation node is the calculation node of the input dimension, and is used as the target calculation node of the input dimension; normalize the number of non-target calculation nodes of each input dimension in the sub-network layer to obtain the second result corresponding to each input dimension in the sub-network layer; and for each input dimension in the sub-network layer, when the second result corresponding to the input dimension is not greater than a second preset threshold, the input dimension is the invalid dimension corresponding to the sub-network layer.

[0047] Optionally, the loss module is specifically used to determine a first sub-loss for each sub-network layer based on the sum of the results output by each computation node on the invalid dimension corresponding to that sub-network layer; and to determine a first loss based on the sum of all first sub-losses.

[0048] Optionally, the loss module is specifically used to determine the weight of the first loss; determine the weighted first loss based on the first loss and the weight; and determine the total loss based on the weighted first loss and the second loss.

[0049] Optionally, the sub-network layers of the classification model are arranged in order from the input sub-network layer to the output sub-network layer;

[0050] The first calculation module is further configured to: for each input dimension of the current sub-network layer, if the input dimension is invalid, then the output dimension of the previous sub-network layer corresponding to the input dimension is invalid; for each calculation node in the previous sub-network layer of the current sub-network layer, if the output dimension corresponding to the calculation node is the output dimension, then the calculation node is regarded as an invalid node; in the previous sub-network layer of the current sub-network layer, the input dimension corresponding to the invalid node is the invalid dimension of the sub-network layer.

[0051] This specification provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method for training a classification model.

[0052] This specification provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to perform the aforementioned tasks.

[0053] The above-mentioned technical solutions adopted in this specification can achieve the following beneficial effects:

[0054] This method identifies invalid dimensions in the input dimensions of each sub-network layer, thus determining the output of each computation node on the invalid dimensions of each sub-network layer that are ineffective for the classification model's output. Based on these outputs, a first loss is determined. The total loss is then determined based on a second loss determined by the training sample annotations and the first loss. The classification model is trained with the minimum total loss, thereby reducing the impact of the outputs of each computation node on the invalid dimensions of each sub-network layer on the classification model's output and improving the classification accuracy of the model. Attached Figure Description

[0055] The accompanying drawings, which are included to provide a further understanding of this specification and form part of this specification, illustrate exemplary embodiments and are used to explain this specification, but do not constitute an undue limitation thereof. In the drawings:

[0056] Figure 1 This is a flowchart illustrating a method for training a classification model provided in this specification.

[0057] Figure 2 This is a schematic diagram of the structure of the L-sub-network layer of a classification model provided in this specification.

[0058] Figure 3 This is a schematic diagram of the structure of a device for training a classification model provided in this specification;

[0059] Figure 4 This specification provides a corresponding Figure 1 A schematic diagram of the structure of an electronic device. Detailed Implementation

[0060] To make the objectives, technical solutions, and advantages of this specification clearer, the technical solutions of this specification will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of them. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this specification.

[0061] The technical solutions provided in the various embodiments of this specification are described in detail below with reference to the accompanying drawings.

[0062] Figure 1 This is a flowchart illustrating a method for training a classification model provided in this specification, including the following steps:

[0063] S100: Determine the training samples and their labels, wherein the training samples are determined based on the nodes in the graph data.

[0064] This manual provides a method for training a classification model. This method can be executed by any electronic device with computing capabilities, such as a computer or server. However, due to the large amount of data required for model training and the high computational demands, a server is generally used for model training. For ease of description, this manual will use the server-side training process of this classification model as an example in subsequent explanations.

[0065] Specifically, the classification model described in this specification is a model used to classify nodes in graph data, namely a GNN model. This classification model consists of multiple sub-network layers, wherein the input layer for the input data and the output layer for the classification result are both the aforementioned sub-network layers. Of course, the layers between the output layers are also the aforementioned sub-network layers.

[0066] In one or more embodiments of this specification, the graph data consists of nodes and edges between them. Node attributes describe the nodes, and the attributes of the edges between nodes describe the relationships between them. Before training the classification model, the server first needs to determine the training samples and their labels based on the graph data.

[0067] Specifically, the size of the input data for the classification model can be preset as needed, and the number of nodes in the input layer of the classification model is determined based on the size of the input data. Therefore, the server can determine the subgraph data corresponding to each node in the graph data, based on the size of the input layer of the classification model, as training samples. This subgraph data may include the attributes of the node and the attributes of the edges connected to the node. Of course, the subgraph data may also include subgraph data composed of nodes with a specified number of hops centered on the current node. This specification does not limit the composition of the training samples; it can be set according to the structure of the classification model or the needs of the training model.

[0068] In addition, since the classification model outputs the classification results of the training samples, the server can also determine the labels corresponding to the training samples.

[0069] For example, assuming the above classification model is used to classify users by risk, the graph data can be built based on business data of users' actions. Here, the nodes in the graph data are the nodes corresponding to users, and the edges between users represent the business transactions performed between them. The attributes of the nodes corresponding to users can include user information, and the attributes of the edges can include transaction information, complaint information, etc.

[0070] The server can generate training samples for each node based on the subgraph data corresponding to that node. The labeling of the training samples generated based on whether the user corresponding to that node has undergone risk control procedures is determined. For example, if user A has undergone transaction restriction procedures, the training sample generated based on the node for user A in the graph data is labeled as a high-risk user. Alternatively, the server can also determine the labeling of the training samples based on whether the attributes of the edges contained in the training samples are abnormal. For example, if the transaction information contained in the edge data between user A and user B is abnormal, the training sample generated based on the node for user A in the graph data is labeled as a high-risk user.

[0071] S102: Input the training sample into the classification model to obtain the classification result of the node in the graph data corresponding to the training sample output by the classification model.

[0072] In one or more embodiments of this specification, after determining the training samples and their labels, the server inputs the training samples into the classification model and determines the classification result of the node corresponding to the training sample output by the classification model.

[0073] For example, when training the classification model to classify users by risk, the above training samples are input into the classification model, and the classification results of each node in the user relationship graph corresponding to the training samples are obtained from the output of the classification model: the user is a risky user, and the user is a non-risky user.

[0074] In addition, in one or more embodiments of this specification, since this specification aims to solve the problem that the GNN model cannot be further trained based on the interpretability of CNN, the server can pre-train the classification model after determining the training samples and their labels to obtain the pre-trained classification model, and then determine the classification result of the training samples output by the pre-trained model.

[0075] S104: For each sub-network layer in the classification model, determine the input data for each input dimension in the sub-network layer, and determine the invalid dimensions corresponding to each computing node in the sub-network layer based on the input data for each input dimension and the model parameters of each computing node in the sub-network layer.

[0076] In one or more embodiments of this specification, as described above, each sub-network layer in the classification model contains multiple computational nodes, and each sub-network layer corresponds to multiple input dimensions. For each input dimension, each computational node has a model parameter corresponding to that input dimension, and each computational node corresponds to an output dimension. Therefore, the number of computational nodes in a sub-network layer is the same as the number of output dimensions of that sub-network layer. The server can then, for each sub-network layer, determine the proportion of each input dimension of that computational node to the output result of that computational node based on the input data of each input dimension of that sub-network layer and the model parameters of each computational node in that sub-network layer, determine the contribution of each input dimension to the output result of that computational node, and determine the invalid dimensions corresponding to that computational node based on the determined contribution.

[0077] For ease of description, we will use the l-sub-network layer as an example. For example... Figure 2As shown, the l-sub-network layer (L-sub-network layer in the figure) contains Q computation nodes, each with Q output dimensions. The l-sub-network layer has P input dimensions. For each input dimension, each computation node has a corresponding model parameter. For the q-th computation node, the model parameter for the p-th input dimension is w. qp w qp That is, the model parameters of the q-th output dimension (i.e., the q-th computation node) and the p-th input dimension of the l-th sub-network layer.

[0078] After inputting the training samples into the classification model, each computation node in the l-th sub-network layer has P input data, each corresponding to an input dimension. The input data of the p-th input dimension in the l-th layer is then used as the basis. Then the output result of the q-th computation node corresponding to the p-th input dimension is: The output of the q-th computation node is the sum of the outputs for each input dimension of that computation node, i.e.

[0079] The output of each computation node in sub-network layer l is the input data of one input dimension of network layer l+1, and the output of each computation node in sub-network layer l+1 is the input data of one input dimension of network layer l+2. This process is passed down layer by layer. It can be seen that the output of each computation node in the current sub-network layer will affect the output of the classification model. The output of each computation node is the sum of the outputs of each computation node for each input dimension. For each input dimension, the factors that affect the output of the computation node for that input dimension are the model parameters of the computation node for that input dimension. Therefore, the factors that affect the output of the classification model are the model parameters of each computation node in each sub-network layer for each input dimension.

[0080] Clearly, for each input dimension in the sub-network layer, for each computation node, the larger the proportion of the output result of that computation node corresponding to that dimension in its total output, the greater the influence of the parameters of that computation node on the output result of the classification model. Conversely, the smaller the proportion of the output result of that computation node corresponding to that input dimension in its total output, the smaller the influence of the parameters of that computation node on the output result of the classification model. Therefore, when the proportion of the output result of that computation node corresponding to that input dimension in its total output is less than a certain preset threshold, it indicates that the contribution of that input dimension to the output result of that computation node is small, and this input dimension is determined as an invalid dimension corresponding to that computation node in the sub-network layer.

[0081] For each computation node in each sub-network layer, and for each dimension, the invalid dimension corresponding to the computation node in that sub-network layer is determined based on the proportion of the output result of the computation node corresponding to the input dimension to the total output result of the computation node. The invalid dimension of the sub-network layer is then determined based on the invalid dimension corresponding to the computation node in that sub-network layer.

[0082] For example, when this classification model is applied to classify users by risk, for each computation node in each sub-network layer, the invalid dimension corresponding to that computation node in that sub-network layer is determined to have a small impact on the output of the classification model (i.e., risk classification of users / merchants) for that input dimension. When an input dimension is determined to be an invalid dimension for a computation node in that sub-network layer, it means that when the model determines whether a user is risky, the output of that input dimension at that computation node will not affect the classification result. In other words, for that computation node, the existence of that input dimension has no impact on determining whether the user corresponding to this training sample is risky; therefore, that input dimension is an invalid dimension for that computation node.

[0083] For each sub-network layer of the classification model, this method aims to first determine the invalid dimensions of each computation node in the sub-network, then determine the invalid dimensions of each sub-network layer, and finally make the output of the classification model more accurate by weakening the output of each computation node on the invalid dimensions of each sub-network layer.

[0084] Specifically, this method requires determining the model parameters of each computation node in each sub-network layer of the classification model, and then determining the input data for each input dimension in the sub-network layer.

[0085] It should be noted that this specification does not limit the methods for determining the model parameters of each computation node in this sub-network layer.

[0086] The training samples are input into the classification model. The feature extraction layer determines the input data (features) for each input dimension of the first sub-network layer. Then, the model parameters for each computation node in the first sub-network layer are determined. When l=1, the output results of each computing node in the first sub-network layer are determined. The set of output results of each computing node in the first sub-network layer is the output result of the first sub-network layer, which is also the input data of the next layer of the first sub-network layer—the second sub-network layer. By analogy, the input data of each sub-network layer in the classification model corresponding to its respective input dimension can be determined.

[0087] Next, this method can determine the invalid dimensions corresponding to each computation node in the sub-network layer based on the input data of each input dimension and the model parameters of each computation node in the sub-network layer.。

[0088] First, as described above, based on the input data for each input dimension and the model parameters of each computation node in the sub-network layer, calculate the output result of each computation node in the sub-network layer corresponding to each input dimension. Then, based on the output result of each computation node in the sub-network layer corresponding to each input dimension, determine the invalid dimensions corresponding to each computation node in the sub-network layer.

[0089] Specifically, in addition to the above, for each computing node in each sub-network layer, for each dimension, the invalid dimension corresponding to the computing node in the sub-network layer is determined according to the proportion of the output result of the computing node corresponding to the input dimension to the total output result of the computing node. Furthermore, the output result of the computing node corresponding to the input dimension can be normalized and then compared with the first preset threshold to determine the invalid dimension corresponding to the computing node in the sub-network layer.

[0090] Because for a given computation node, the larger its output for that input dimension, the greater the proportion of its output for that input dimension to the total output of that computation node. Therefore, for this computation node, the proportion of its output for that input dimension can be determined by directly comparing the magnitudes of its output for each input dimension. However, for different computation nodes, the value ranges of their outputs for each input dimension may be inconsistent. For example, node 'a' might have outputs for each input dimension ranging from 0 to 1, while node 'a' might have outputs for each input dimension ranging from 10 to 100. This makes it difficult to measure the magnitude of the outputs for each input dimension from different computation nodes. Therefore, the output for that input dimension of the computation node is normalized and then compared with a first preset threshold to determine the invalid dimension corresponding to that computation node in the sub-network layer.

[0091] For each computation node in the sub-network layer, the output results of each input dimension of the computation node are normalized so that the output results of each input dimension of different computation nodes are all in the range of 0 to 1, thus obtaining the first result corresponding to each input dimension of the computation node.

[0092] For each computation node in this sub-network layer, for each input dimension, the computation node has a corresponding first result for that input dimension. This first result is used as an indicator to evaluate whether the input dimension corresponding to the computation node is valid or invalid.

[0093] For each input dimension in the sub-network layer, if the first result corresponding to the input dimension of the computing node is not greater than the first preset threshold, the input dimension corresponding to the computing node is determined to be an invalid dimension.

[0094] Specifically, the normalization formula is as follows:

[0095]

[0096] That is, the output result of the q-th computation node of the l-th sub-network layer corresponding to the p-th input dimension. That is, the minimum result among the output results of each input dimension in the q-th computation node of the l-th sub-network layer. That is, the maximum result among the output results of the q-th computation node in the l-th sub-network layer corresponding to each input dimension, where ∈ is the minimum value (avoiding...). ), That is, the first result.

[0097] Furthermore,

[0098]

[0099] If λ is the first preset threshold, then when hour, When the p-th input dimension corresponding to the q-th computation node of the l-th sub-network layer is determined to be an invalid dimension, hour, Determine the p-th input dimension corresponding to the q-th computation node of the l-th sub-network layer as the valid dimension. This is an indicator that shows whether the p-th input dimension corresponding to the q-th computation node of the l-th sub-network layer is a valid dimension.

[0100] S106: Based on the invalid dimensions corresponding to each computing node in the sub-network layer, determine the invalid dimensions corresponding to the sub-network layer from each input dimension of the sub-network layer.

[0101] For each computation node in each sub-network layer, the invalid dimension of that sub-network layer is determined based on the invalid dimension corresponding to that computation node. This is because directly designating the invalid dimension of a computation node as invalid might affect the output results of other computation nodes for that input dimension. For example, if only one computation node has an invalid dimension for a given input dimension, directly designating that input dimension as invalid and then constructing a loss from the output results of each computation node for that invalid dimension would reduce the accuracy of the classification model. Therefore, for each input dimension, it is necessary to count the number of invalid dimensions corresponding to each computation node to determine whether the input dimension is invalid.

[0102] After determining the invalid dimensions corresponding to each computing node in the sub-network layer, for each input dimension of the sub-network layer, the invalid dimensions corresponding to each computing node are determined as the computing nodes of that input dimension, and are used as the target computing nodes of that input dimension. The number of non-target computing nodes of each input dimension in the sub-network layer is normalized to obtain the second result corresponding to each input dimension in the sub-network layer. For each input dimension of the sub-network layer, when the second result corresponding to the input dimension is not greater than the second preset threshold, the input dimension is the invalid dimension corresponding to the sub-network layer.

[0103] Because in step S104, using This indicates that the p-th input dimension corresponding to the q-th computation node in the l-th sub-network layer is an invalid dimension (target computation node), therefore it cannot be used for... Summation determines the number of target computation nodes, but it can also determine the number of non-target computation nodes. Specifically:

[0104]

[0105] Let Q represent the number of non-target computation nodes in each input dimension of this sub-network layer, and let Q represent the total number of computation nodes in this sub-network layer. Normalizing the number of non-target computation nodes in each input dimension of this sub-network layer yields the second result corresponding to each input dimension of this sub-network layer. The formula is as follows:

[0106]

[0107] Among them, when the number of non-target computation nodes in the p-th input dimension of the sub-network layer is at its maximum, This represents the number of non-target computation nodes in the p-th input dimension of the sub-network layer, and ∈ has the same meaning as the above formula.

[0108] Furthermore, δ is a second preset threshold, which is the threshold value corresponding to the second result of the input dimension. When the input dimension is not greater than the second preset threshold δ, the input dimension is an invalid dimension corresponding to the sub-network layer. When the second result corresponding to the input dimension is... When the input dimension is greater than the second preset threshold δ, the input dimension is the effective dimension corresponding to the sub-network layer, expressed by the following formula:

[0109]

[0110] When training this classification model to classify users by risk, the invalid dimensions of each sub-network layer are determined based on the invalid dimensions corresponding to each computation node in each sub-network layer. In other words, the parameters of each computation node corresponding to which input dimension in each sub-network layer are determined have a small impact on the risk classification results of users output by the classification model.

[0111] S108: Determine the first loss based on the output results of each computation node on the invalid dimension corresponding to each sub-network layer, and determine the second loss based on the annotation and the output results of the classification model.

[0112] When training this classification model to classify users by risk, determining which input dimension in each sub-network layer corresponds to the parameters of each computation node has a smaller impact on the risk classification result output by the classification model (i.e., identifying invalid dimensions in each sub-network layer). However, the parameters of each computation node corresponding to each invalid dimension in each sub-network layer affect the output result of the invalid dimension corresponding to each computation node in each sub-network layer. Therefore, by reducing the impact of the output result of the invalid dimension corresponding to each computation node in each sub-network layer on the risk classification result of the classification model for users / merchants, the accuracy of the classification model can be improved by training the model.

[0113] Specifically, for each sub-network layer, the first sub-loss can be determined by summing the outputs of each computation node on the invalid dimension corresponding to that sub-network layer, and the first loss can be determined by summing all the first sub-losses.

[0114] Specifically, the first loss can be determined using the following formula. weaken :

[0115]

[0116] in, This represents the sum of the outputs of each computation node on the invalid dimension corresponding to the l-th sub-network layer, i.e., the first sub-loss. Indicates when When the value is less than 0, take 0. This represents the summation of the first sub-losses over all sub-network layers, yielding the first loss (Loss). weaken .

[0117] It should be noted that this specification does not limit the method of determining the second loss based on the label and the output of the classification model. The second loss can be determined based on the cross-entropy of the label and the output of the classification model, or other methods can be used.

[0118] S110: Determine the total loss based on the first loss and the second loss, and train the classification model with the minimum total loss as the optimization objective.

[0119] Specifically, first determine the weight of the first loss. The weighted first loss is determined based on the first loss and this weight. Based on the weighted first loss and second loss Loss origDetermine the total loss. all .

[0120]

[0121] Furthermore, the weight of the second loss can be determined, the weighted second loss can be determined, and the total loss can be determined based on the weighted first loss and the weighted second loss.

[0122] The classification model is trained with the goal of minimizing the total loss. When the classification model is applied to classify users, training the model with the goal of minimizing the total loss can reduce the impact of the parameters of the computation nodes corresponding to each invalid dimension on the user risk classification results, thereby improving the accuracy of the classification model.

[0123] The classification model for classifying users is trained using the method described above.

[0124] The server can generate input data for each node based on the subgraph data corresponding to that node. Specifically, it can determine the attributes of the node, the attributes of the edges connected to the node, and the attributes of nodes one hop from the node based on the subgraph data. These determined attributes are encoded and arranged in a preset order to form a multi-dimensional vector, which is the input data generated based on the subgraph data of that node. The input data of that node is then input into the classification model to obtain the risk classification result output by the model, i.e., whether the user is a risky user. Based on the risk classification result, it is determined whether risk control is needed for that user.

[0125] As can be seen from the above method, for each sub-network layer in the classification model, this method first determines the invalid dimension corresponding to each computing node in the sub-network layer based on the input data of each input dimension in the sub-network layer and the model parameters of each computing node in the sub-network layer, further determines the invalid dimension corresponding to the sub-network layer, determines the first loss based on the output results of each computing node on the invalid dimension corresponding to each sub-network layer, and determines the second loss based on the annotation and the output results of the classification model, and then trains the classification model based on the first loss and the second loss.

[0126] This method identifies the invalid dimensions corresponding to each sub-network layer, thus determining the output results of each computation node on the invalid dimensions of each sub-network layer that are ineffective for the classification model's output. Based on these results, a first loss is determined. The total loss is then determined based on a second loss determined by the training sample annotations and the first loss. The classification model is trained with the minimum total loss, reducing the impact of the output results of each computation node on the invalid dimensions of each sub-network layer on the classification model's output. This method is based on the supervised training of GNN models and incorporates the idea of ​​interpreting the model structure in GNN models, thereby improving the classification accuracy of GNN models.

[0127] Furthermore, the sub-network layers of this classification model are arranged in order from the input sub-network layer to the output sub-network layer.

[0128] In the above method for training the classification model, when determining whether the p-th input dimension corresponding to the q-th computation node of the l-th sub-network layer is a valid dimension, it can be further optimized:

[0129]

[0130] That is, when the q-th input dimension of the (l+1)th sub-network layer is an invalid dimension, the p-th input dimension corresponding to the q-th computation node of the l-th sub-network layer is also an invalid dimension, because the input data corresponding to the q-th input dimension of the (l+1)th sub-network layer is the sum of the output results corresponding to the p-th input dimension of the q-th computation node of the l-th sub-network layer.

[0131] For each input dimension of the current sub-network layer, if the input dimension is invalid, then the output dimension of the previous sub-network layer corresponding to the current sub-network layer is invalid.

[0132] For each computation node in the previous sub-network layer of the current sub-network layer, if the output dimension corresponding to the computation node is the same as the output dimension, then the computation node is regarded as an invalid node.

[0133] In the sub-network layer preceding the current sub-network layer, the input dimension corresponding to the invalid node is the invalid dimension of that sub-network layer.

[0134] The above describes one or more implementations of the methods described in this specification. Based on the same idea, this specification also provides corresponding apparatus for training classification models, such as... Figure 3 As shown.

[0135] Figure 3 This is a schematic diagram of an apparatus for training a classification model provided in this specification. The classification model includes multiple sub-network layers, and the apparatus includes:

[0136] The determination module 301 is used to determine training samples and their annotations, wherein the training samples are determined based on nodes in the graph data;

[0137] The classification module 302 is used to input the training samples into the classification model and obtain the classification results of the nodes in the graph data corresponding to the training samples output by the classification model.

[0138] The first calculation module 303 is used to determine the input data of each input dimension in each sub-network layer of the classification model, and to determine the invalid dimension corresponding to each calculation node in the sub-network layer based on the input data of each input dimension and the model parameters of each calculation node in the sub-network layer.

[0139] The second calculation module 304 is used to determine the invalid dimension corresponding to the sub-network layer from each input dimension of the sub-network layer based on the invalid dimension corresponding to each calculation node in the sub-network layer.

[0140] The loss module 305 is used to determine the first loss based on the output results of each computation node on the invalid dimension corresponding to each sub-network layer, and to determine the second loss based on the annotation and the output results of the classification model.

[0141] Training module 306 is used to determine the total loss based on the first loss and the second loss, and to train the classification model with the minimum total loss as the optimization objective.

[0142] Optionally, the first calculation module 303 is specifically configured to: for each calculation node in the sub-network layer, determine the model parameters corresponding to each input dimension of the calculation node from the model parameters of the sub-network layer; for each input dimension in the sub-network layer, determine the output result of the calculation node corresponding to the input dimension based on the parameters of the calculation node corresponding to the input dimension and the input data of the input dimension; and determine the invalid dimensions corresponding to each calculation node in the sub-network layer based on the output results of each calculation node corresponding to each input dimension in the sub-network layer.

[0143] Optionally, the first calculation module 303 is specifically used to normalize the output results of each calculation node corresponding to each input dimension for each calculation node in the sub-network layer to obtain the first result corresponding to each input dimension of the calculation node; and for each input dimension in the sub-network layer, when the first result corresponding to the input dimension of the calculation node is not greater than the first preset threshold, the input dimension corresponding to the calculation node is determined to be an invalid dimension.

[0144] Optionally, the second calculation module 304 is specifically used to determine, for each input dimension in the sub-network layer, the invalid dimension corresponding to each calculation node is the calculation node of the input dimension, and is used as the target calculation node of the input dimension; normalize the number of non-target calculation nodes of each input dimension in the sub-network layer to obtain the second result corresponding to each input dimension in the sub-network layer; and for each input dimension in the sub-network layer, when the second result corresponding to the input dimension is not greater than a second preset threshold, the input dimension is the invalid dimension corresponding to the sub-network layer.

[0145] Optionally, the loss module 305 is specifically used to determine a first sub-loss for each sub-network layer based on the sum of the results output by each computation node on the invalid dimension corresponding to that sub-network layer; and to determine a first loss based on the sum of all first sub-losses.

[0146] Optionally, the loss module 305 is specifically used to determine the weight of the first loss; determine the weighted first loss based on the first loss and the weight; and determine the total loss based on the weighted first loss and the second loss.

[0147] Optionally, the sub-network layers of the classification model are arranged in order from the input sub-network layer to the output sub-network layer;

[0148] The first calculation module 303 is further configured to: for each input dimension of the current sub-network layer, if the input dimension is invalid, then the output dimension of the previous sub-network layer corresponding to the input dimension is invalid; for each calculation node in the previous sub-network layer of the current sub-network layer, if the output dimension corresponding to the calculation node is the output dimension, then the calculation node is regarded as an invalid node; in the previous sub-network layer of the current sub-network layer, the input dimension corresponding to the invalid node is the invalid dimension of the sub-network layer.

[0149] This specification also provides a computer-readable storage medium storing a computer program that can be used to execute the above-described... Figure 1 This provides a method for training a classification model.

[0150] This instruction manual also provides Figure 4 The one shown corresponds to Figure 1 A schematic diagram of the structure of an electronic device. (e.g.) Figure 4 As shown, at the hardware level, this electronic device includes a processor, internal bus, network interface, memory, and non-volatile memory, and may also include other hardware required for business operations. The processor reads the corresponding computer program from the non-volatile memory into memory and then runs it to achieve the above. Figure 1 The method for training the classification model.

[0151] Of course, in addition to software implementation, this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0152] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0153] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0154] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.

[0155] For ease of description, the above devices are described in terms of function, divided into various units. Of course, in implementing this specification, the functions of each unit can be implemented in one or more software and / or hardware components.

[0156] Those skilled in the art will understand that embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0157] This specification is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this specification. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0158] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0159] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes ​ The steps of the function specified in one or more boxes.

[0160] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0161] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0162] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0163] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0164] Those skilled in the art will understand that the embodiments of this specification can be provided as methods, systems, or computer program products. Therefore, this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this specification may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0165] This specification can be described in the general context of computer-executable instructions that are executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This specification can also be practiced in distributed computing environments, where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0166] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0167] The above description is merely an embodiment of this specification and is not intended to limit this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification.

Claims

1. A method for training a classification model, characterized in that, The classification model includes multiple sub-network layers, and is used to classify users by risk. The method includes: The training samples and their labels are determined based on the nodes in the graph data. The graph data is established based on the business data of users performing business. The nodes in the graph data are the nodes corresponding to users. The edges in the graph data represent the business performed between users. The attributes of the nodes corresponding to users include user information, and the attributes of the edges include transaction information and complaint information. The training samples are input into the classification model to obtain the classification results of the nodes in the graph data corresponding to the training samples, as output by the classification model. For each sub-network layer in the classification model, determine the input data for each input dimension in that sub-network layer, and based on the input data for each input dimension and the model parameters of each computation node in that sub-network layer, determine the invalid dimensions corresponding to each computation node in that sub-network layer. Based on the invalid dimensions corresponding to each computing node in the sub-network layer, determine the invalid dimensions corresponding to the sub-network layer from each input dimension of the sub-network layer; The first loss is determined based on the output of each computation node on the invalid dimension corresponding to each sub-network layer, and the second loss is determined based on the annotation and the output of the classification model. Based on the first loss and the second loss, the total loss is determined, and the classification model is trained with the minimum total loss as the optimization objective.

2. The method as described in claim 1, characterized in that, Based on the input data for each input dimension and the model parameters of each computation node in the sub-network layer, determine the invalid dimensions corresponding to each computation node in the sub-network layer, specifically including: For each computation node in the sub-network layer, the model parameters corresponding to each input dimension of the computation node are determined from the model parameters of the sub-network layer; For each input dimension in the sub-network layer, the output result of the computing node for that input dimension is determined based on the parameters of the computing node for that input dimension and the input data for that input dimension. Based on the output results of each computation node in the sub-network layer corresponding to each input dimension, the invalid dimensions corresponding to each computation node in the sub-network layer are determined.

3. The method as described in claim 2, characterized in that, Based on the output results of each computation node in this sub-network layer corresponding to each input dimension, the invalid dimensions corresponding to each computation node in this sub-network layer are determined, specifically including: For each computation node in the sub-network layer, the output results of the computation node for each input dimension are normalized to obtain the first result corresponding to each input dimension of the computation node. For each input dimension in the sub-network layer, if the first result corresponding to the input dimension of the computing node is not greater than the first preset threshold, the input dimension corresponding to the computing node is determined to be an invalid dimension.

4. The method as described in claim 1, characterized in that, Based on the invalid dimensions corresponding to each computation node in the sub-network layer, the invalid dimensions corresponding to the sub-network layer are determined from each input dimension of the sub-network layer, specifically including: For each input dimension in this sub-network layer, the invalid dimension corresponding to each computing node is determined as the computing node for that input dimension, and is used as the target computing node for that input dimension; The number of non-target computation nodes in each input dimension of the sub-network layer is normalized to obtain the second result corresponding to each input dimension of the sub-network layer; For each input dimension in the sub-network layer, if the second result corresponding to the input dimension is not greater than the second preset threshold, the input dimension is an invalid dimension corresponding to the sub-network layer.

5. The method as described in claim 1, characterized in that, The first loss is determined based on the output results of each computation node on the invalid dimension corresponding to each sub-network layer, specifically including: For each sub-network layer, the first sub-loss is determined by the sum of the outputs of each computation node on the invalid dimension corresponding to that sub-network layer. The first loss is determined by the sum of all first sub-losses.

6. The method as described in claim 1, characterized in that, Based on the first loss and the second loss, the total loss is determined, specifically including: Determine the weight of the first loss; The weighted first loss is determined based on the first loss and the weight; The total loss is determined based on the weighted first loss and the second loss.

7. The method as described in claim 1, characterized in that, The sub-network layers of the classification model are arranged in order from the input sub-network layer to the output sub-network layer; The method further includes: For each input dimension of the current sub-network layer, if the input dimension is invalid, then the output dimension of the previous sub-network layer corresponding to the current sub-network layer is invalid. For each computation node in the previous sub-network layer of the current sub-network layer, if the output dimension corresponding to the computation node is the same as the output dimension, then the computation node is regarded as an invalid node. In the sub-network layer preceding the current sub-network layer, the input dimension corresponding to the invalid node is the invalid dimension of that sub-network layer.

8. An apparatus for training a classification model, characterized in that, The classification model includes multiple sub-network layers and is used to classify users by risk. The device includes: The determination module is used to determine training samples and their labels. The training samples are determined based on the nodes in the graph data. The graph data is established based on the business data of users performing business. The nodes in the graph data are the nodes corresponding to users. The edges in the graph data represent the business performed between users. The attributes of the nodes corresponding to users include user information. The attributes of the edges include transaction information and complaint information. The classification module is used to input the training samples into the classification model and obtain the classification results of the nodes in the graph data corresponding to the training samples output by the classification model. The first calculation module is used to determine the input data of each input dimension in each sub-network layer of the classification model, and to determine the invalid dimension corresponding to each calculation node in the sub-network layer based on the input data of each input dimension and the model parameters of each calculation node in the sub-network layer. The second calculation module is used to determine the invalid dimension corresponding to the sub-network layer from each input dimension of the sub-network layer based on the invalid dimension corresponding to each calculation node in the sub-network layer. The loss module is used to determine the first loss based on the output results of each computation node on the invalid dimension corresponding to each sub-network layer, and to determine the second loss based on the annotation and the output results of the classification model. The training module is used to determine the total loss based on the first loss and the second loss, and to train the classification model with the goal of minimizing the total loss.

9. The apparatus as claimed in claim 8, characterized in that, The first calculation module is specifically used to: determine the model parameters corresponding to each input dimension of each calculation node in the sub-network layer from the model parameters of the sub-network layer; determine the output result of each calculation node corresponding to each input dimension based on the parameters of the calculation node corresponding to the input dimension and the input data of the input dimension; and determine the invalid dimensions corresponding to each calculation node in the sub-network layer based on the output results of each calculation node corresponding to each input dimension in the sub-network layer.

10. The apparatus as claimed in claim 9, characterized in that, The first calculation module is specifically used to normalize the output results of each calculation node in the sub-network layer for each input dimension of the calculation node, so as to obtain the first result corresponding to each input dimension of the calculation node. For each input dimension in the sub-network layer, if the first result corresponding to the input dimension of the computing node is not greater than the first preset threshold, the input dimension corresponding to the computing node is determined to be an invalid dimension.

11. The apparatus as claimed in claim 8, characterized in that, The second calculation module is specifically used to determine, for each input dimension in the sub-network layer, the invalid dimension corresponding to each calculation node is the calculation node of the input dimension, and is used as the target calculation node of the input dimension; normalize the number of non-target calculation nodes of each input dimension in the sub-network layer to obtain the second result corresponding to each input dimension in the sub-network layer; for each input dimension in the sub-network layer, when the second result corresponding to the input dimension is not greater than the second preset threshold, the input dimension is the invalid dimension corresponding to the sub-network layer.

12. The apparatus as claimed in claim 8, characterized in that, The loss module is specifically used to determine the first sub-loss for each sub-network layer based on the sum of the outputs of each computation node on the invalid dimension corresponding to that sub-network layer; and to determine the first loss based on the sum of all the first sub-losses.

13. The apparatus as claimed in claim 8, characterized in that, The loss module is specifically used to determine the weight of the first loss; determine the weighted first loss based on the first loss and the weight; and determine the total loss based on the weighted first loss and the second loss.

14. The apparatus as claimed in claim 8, characterized in that, The sub-network layers of the classification model are arranged in order from the input sub-network layer to the output sub-network layer; The first calculation module is further configured to: for each input dimension of the current sub-network layer, if the input dimension is invalid, then the output dimension of the previous sub-network layer corresponding to the input dimension is invalid; for each calculation node in the previous sub-network layer of the current sub-network layer, if the output dimension corresponding to the calculation node is the output dimension, then the calculation node is regarded as an invalid node; in the previous sub-network layer of the current sub-network layer, the input dimension corresponding to the invalid node is the invalid dimension of the sub-network layer.

15. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1 to 7.

16. An electronic device, characterized in that, The method includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Model training method, device and system

    CN112529204A

  • Model training method, device and equipment and readable storage medium

    CN115481670A