A processing method, device, equipment and storage medium
By determining the model target parameters and influence values corresponding to the sample to be tested, the problem of difficult factors affecting the model parameters in the prior art is solved, and the effect of improving the accuracy of the model output results is achieved.
Patent Information
- Application Number
- CN202111290195.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-02
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-11-02
AI Technical Summary
In the prior art, when adjusting neural network model parameters to improve the accuracy of prediction results, it is difficult to determine which factors have an impact on model parameters, resulting in a low accuracy of interpreting the model.
By obtaining the marked sample set, selecting the sample to be tested, determining the empty sample corresponding to the sample to be tested, and determining the model target parameters that match the sample to be tested based on the sample set, the empty sample and the model to be tested, and calculating the impact value of the sample to be tested on the model parameters.
Accurately identify the impact of the samples input to the model on model parameters, thereby adjusting the model parameters to improve the accuracy of the model output results.
Smart Images

Figure CN114186182B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of information machine learning, and in particular to a processing method, apparatus, device and storage medium. Background Art
[0002] It has become the norm to use neural network models to predict results. In related technologies, model parameters in neural network models are usually adjusted to improve the accuracy of prediction results, but it is not certain which factors affect the model parameters. Summary of the invention
[0003] In view of this, embodiments of the present application provide a processing method, an apparatus, a device, and a storage medium.
[0004] The technical solution of this application is implemented as follows:
[0005] The present application provides a processing method, which includes:
[0006] Obtain a labeled sample set, and select a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set;
[0007] Determine a blank sample corresponding to the sample to be tested; wherein the blank sample represents a sample that does not carry feature information;
[0008] Based on the sample set, the empty sample and the model to be tested, determining a model target parameter that matches the sample to be tested;
[0009] Based on the model target parameters, an influence value of the sample to be tested on the model parameters of the model to be tested is determined.
[0010] The present application provides a processing device, including:
[0011] An acquisition module, used to acquire a labeled sample set and select a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set;
[0012] A first determination module is used to determine a blank sample corresponding to the sample to be tested; wherein the blank sample represents a sample that does not carry feature information;
[0013] A second determination module, configured to determine a model target parameter matching the sample to be tested based on the sample set, the empty sample and the model to be tested;
[0014] The third determination module is used to determine the influence value of the sample to be tested on the model parameters of the model to be tested based on the model target parameters.
[0015] The embodiment of the present application also provides an electronic device, including: a processor, a memory, and a communication bus;
[0016] The communication bus is used to realize the communication connection between the processor and the memory;
[0017] The processor is used to execute the program in the memory to implement the above-mentioned processing method.
[0018] Correspondingly, an embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the processing method as described above.
[0019] The processing method, device, equipment and storage medium provided in the embodiment of the present application first obtain a labeled sample set and select a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set; secondly, determine an empty sample corresponding to the sample to be tested; wherein the empty sample represents a sample that does not carry feature information; then, based on the sample set, the empty sample and the model to be tested, determine the model target parameters that match the sample to be tested; finally, based on the model target parameters, determine the impact value of the sample to be tested on the model parameters of the model to be tested. In this way, the impact of the sample input to the model on the model parameters can be accurately identified, so that the model parameters can be adjusted based on the impact to improve the accuracy of the model output results. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of a processing method provided in an embodiment of the present application;
[0021] Figure 2 A flowchart of another processing method provided in an embodiment of the present application;
[0022] Figure 3 A flowchart of another processing method provided in an embodiment of the present application;
[0023] Figure 4 A schematic diagram of the structure of a processing device provided in an embodiment of the present application;
[0024] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0025] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0026] It should be understood that the "embodiments of the present application" or "the aforementioned embodiments" mentioned throughout the specification mean that specific features, structures or characteristics related to the embodiments are included in at least one embodiment of the present application. Therefore, "in the embodiments of the present application" or "in the aforementioned embodiments" appearing throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. In the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0027] Unless otherwise specified, the electronic device performs any step in the embodiments of the present application, and the processor of the electronic device may perform the step. It is also worth noting that the embodiments of the present application do not limit the order in which the electronic device performs the following steps. In addition, the methods used to process data in different embodiments may be the same method or different methods. It should also be noted that any step in the embodiments of the present application can be independently executed by the electronic device, that is, when the electronic device executes any step in the following embodiments, it may not rely on the execution of other steps.
[0028] In order to better understand the embodiments of the present application, the shortcomings existing in the related art are first described.
[0029] In the related technology, the model parameters of the neural network model need to be adjusted to improve the accuracy of the model prediction results. A commonly used solution is to use the best model interpreter (Local Interpretable Model-Agnostic Explanations, LIME) to explain the relevant behaviors in the black box of the neural network model; however, LIME has the disadvantages of slow algorithm speed and poor stability, so there are large differences in the results obtained multiple times, which makes the accuracy of the relevant parameters in the explanation model low.
[0030] Based on the problems existing in the related art, an embodiment of the present application provides a processing method, which is applied to a processing device or an electronic device. The processing method provided in this embodiment can be implemented by a computer program, and when the computer program is executed, each step in the processing method provided in this embodiment is completed. In some embodiments, the computer program can be executed by a processor in a processing device. Figure 1 A flowchart of a processing method provided in an embodiment of the present application is shown in FIG. Figure 1 As shown, the method comprises the following steps:
[0031] Step 101: Obtain a labeled sample set, and select a sample to be tested from the sample set.
[0032] The sample to be tested is any sample in the sample set.
[0033] In an embodiment of the present application, the processing device may respond to an internal input module to obtain the labeled sample set, or may receive a labeled sample set sent by other devices that can interact with the information therewith; wherein the sample set may be in the form of a picture, in the form of text, or in the form of a video.
[0034] Among them, the labeled sample set can be an image that has been labeled and is to be input into a related network model for result determination; illustratively, the labeled sample set can be a set of images that have been labeled for the category to which the image belongs, or a set of images that include labeled objects in the image.
[0035] It should be noted that the number of samples included in the labeled sample set can be one or two or more; at the same time, the sample set can adopt P = (p1, p2, ..., p m ), and the characterization sample set includes m samples. The sample to be tested is any sample in the sample set.
[0036] In a feasible implementation, the labeled sample set is an image, and the sample to be tested can represent any sub-image corresponding to when the image is divided into multiple sub-images.
[0037] In another feasible implementation, the labeled sample set is a sentence, and the sample to be tested can represent any short sentence corresponding to when the sentence is divided into multiple sentences.
[0038] Step 102: Determine a blank sample corresponding to the sample to be tested.
[0039] The empty sample represents a sample that does not carry feature information.
[0040] In the embodiment of the present application, the empty sample representation corresponding to the sample to be tested can replace the sample to be tested according to the attribute information corresponding to the sample to be tested, and is a sample that does not carry any feature information.
[0041] The empty sample matching the sample to be tested may be determined based on the attribute information of the sample to be tested. Meanwhile, the attribute information includes but is not limited to: size information of the sample to be tested, category of the sample to be tested, and location information of the sample to be tested.
[0042] In a feasible implementation, the sample to be tested is any sub-image corresponding to when the image is divided into multiple sub-images, and the empty sample is a sample with the same size as the sample to be tested and does not include any image features; wherein the image features include but are not limited to: color features, shape features and texture features.
[0043] In a feasible implementation, the sample to be tested is any short sentence corresponding to when the sentence is divided into multiple sentences, and the empty sample is a sample that occupies the same space information as the sample to be tested and does not include any sentence features; wherein the sentence features include but are not limited to: text content features and text size features, etc.
[0044] Step 103: Based on the sample set, the empty sample and the model to be tested, determine the model target parameters that match the sample to be tested.
[0045] In an embodiment of the present application, the processing device may input each sample in the sample set into a model to be tested to obtain a corresponding output result, and then determine the model target parameters of the sample to be tested relative to the model to be tested based on the output result and the empty sample.
[0046] Among them, the model to be tested can be any model, such as: Convolutional Neural Networks (CNN), Support Vector Machine (SVM), Hopfield Network (HN) or Deep Convolutional Neural Networks (DCNN), etc.; accordingly, the model to be tested can be used for signal processing, image processing, category or probability recognition, etc.
[0047] In a feasible implementation method, the processing device inputs the sample set into the model to be tested to predict the results and obtain the prediction results, and then determines the loss corresponding to each sample based on the prediction results and the label corresponding to each sample in the sample set, and then determines the model target parameters based on the loss corresponding to each sample and the loss matching the empty sample.
[0048] It should be noted that the model target parameter can refer to the model parameter under which the loss corresponding to the sample set and the empty sample is minimized based on the model to be tested, that is, the optimal model parameter. At the same time, the model target parameter can represent any relevant parameters within the model. In a feasible implementation, when the model to be tested is CNN, the relevant parameters within the model include but are not limited to: the number of convolutional layers, the number of residual blocks, etc.
[0049] Step 104: Based on the model target parameters, determine the impact value of the sample to be tested on the model parameters of the model to be tested.
[0050] In an embodiment of the present application, the electronic device can input the model target parameters into a pre-set influence function to determine the influence value of the sample to be tested on the model parameters of the model to be tested; wherein the influence value represents the influence of the sample to be tested on the model parameters of the model to be tested.
[0051] The impact value may be expressed in numerical form, and may be a negative number or a positive number.
[0052] It should be noted that, in the embodiment of the present application, any sample to be tested in the sample set is first adjusted to an empty sample, and then the influence of any sample to be tested on the model parameters of the model to be tested is determined based on the corresponding output results of the sample set and the empty sample in the model to be tested. That is, in the embodiment of the present application, the sample to be tested is changed to an empty sample. Compared with deleting or repeatedly adding any sample to be tested to determine the influence of the sample to be tested on the model parameters of the model to be tested, its advantage is that the number of the sample set as a whole has not changed; in this way, more attention can be paid to the influence after the sample to be tested changes. In this way, the influence of the sample input to the model on the model parameters can be accurately determined, so that the model parameters of the model can be adjusted based on the influence and the related samples with larger disturbances to the model parameters can be identified, thereby improving the accuracy of the subsequent recognition results of the sample set based on the model to be tested.
[0053] The processing method provided in the embodiment of the present application first obtains a labeled sample set and selects a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set; secondly, determines an empty sample corresponding to the sample to be tested; wherein the empty sample represents a sample that does not carry feature information; then, based on the sample set, the empty sample and the model to be tested, determines the model target parameters that match the sample to be tested; finally, based on the model target parameters, determines the impact value of the sample to be tested on the model parameters of the model to be tested. In this way, the impact of the sample input to the model on the model parameters can be accurately identified, so that the model parameters can be adjusted based on the impact to improve the accuracy of the model output results.
[0054] Based on the above embodiments, the present application also provides a processing method, which is applied to a processing device, such as Figure 2 FIG. 1 is a flow chart of another processing method provided in an embodiment of the present application; Figure 1 and Figure 2 As shown, the method comprises the following steps:
[0055] Step 201: input the sample set into the model to be tested to obtain an output result.
[0056] In an embodiment of the present application, each sample in the sample set is input into the model to be tested in turn to obtain an output result corresponding to each sample; wherein the output result can be a probability value of each sample being of a related type, or a sequence recognition result of an object included in each sample, or a classification result of each sample.
[0057] Among them, the output result is the output result corresponding to each sample in the sample set, that is, the number of the output results is the same as the number of samples in the sample set; at the same time, the output result corresponding to each sample can be the same or different.
[0058] Step 202: Determine the loss corresponding to each sample in the sample set based on the output result and the label annotated with each sample in the sample set.
[0059] In the embodiment of the present application, the output result corresponding to each sample and the label annotated with each sample are used to determine the loss corresponding to each sample.
[0060] Among them, the loss corresponding to each sample is the deviation between the output result corresponding to each sample and the labeled label of each sample.
[0061] It should be noted that, in the embodiment of the present application, the loss corresponding to each sample is the loss determined based on the sample to be tested; the loss corresponding to each sample based on different models to be tested may be the same or different.
[0062] Step 203: Determine the model target parameters based on the loss corresponding to each sample in the sample set and the empty sample.
[0063] In an embodiment of the present application, the loss corresponding to each sample in the sample set and the loss corresponding to the empty sample can be fused, and the model target parameters can be determined based on the fused parameters.
[0064] It should be noted that in an embodiment of the present application, the optimal model parameters of the sample to be tested relative to the model to be tested are determined based on the loss corresponding to each sample in the sample set in the model to be tested and the empty sample corresponding to the sample to be tested; in this way, the model target parameters that match the sample to be tested in the model to be tested can be determined efficiently and accurately.
[0065] In a feasible implementation, the processing device determines the model target parameters based on the loss and empty samples corresponding to each sample in the sample set, that is, the processing device executes step 203, which can be implemented by the following steps 203a to 203c (not shown in the figure):
[0066] Step 203a: determine the loss of the sample to be tested as the basic loss of the empty sample.
[0067] In the embodiment of the present application, the processing device can directly determine the loss of the sample to be tested as the basic loss of the empty sample.
[0068] Step 203b: Obtain a loss increment parameter based on the loss variation coefficient corresponding to the empty sample and the basic loss.
[0069] In an embodiment of the present application, the processing device determines a loss increment parameter based on a pre-set loss variation coefficient corresponding to the empty sample and a basic loss for determining the empty sample; wherein the loss increment parameter represents the loss increment corresponding to the adjustment of the sample to be tested to the empty sample.
[0070] It should be noted that after adjusting the samples to be tested in the sample set to empty samples, the loss corresponding to the empty samples is the sum of the loss of the samples to be tested and the loss increment parameter.
[0071] The loss variation coefficient corresponding to the empty sample can be any value or a value related to the number of samples in the sample set.
[0072] In a feasible implementation, when the number of samples in the sample set is m, the loss variation coefficient can be
[0073] Step 203c: Determine the model target parameters based on the loss corresponding to each sample and the loss increment parameter.
[0074] In an embodiment of the present application, the processing device determines the model target parameters that match the sample to be tested in the model to be tested based on the loss and loss increment parameters corresponding to each sample, that is, the loss increment corresponding to the sample to be tested adjusted to the empty sample.
[0075] It should be noted that in the embodiment of the present application, the model target parameter is determined based on the loss corresponding to each sample in the sample set and the loss increment parameter, so as to improve the accuracy of the model target parameter corresponding to the sample to be tested in the model to be tested.
[0076] In a feasible implementation, the processing device determines the model target parameters based on the loss and loss increment parameters corresponding to each sample, that is, the processing device executes step 203c, which can be implemented by the following steps c1 to c3 (not shown in the figure):
[0077] Step c1: based on the number of samples in the sample set and the fusion loss, obtain the loss to be processed; wherein the fusion loss is obtained by fusing the losses corresponding to each sample.
[0078] In an embodiment of the present application, the processing device first fuses the loss corresponding to each sample in the sample set, that is, superimposes the loss corresponding to each sample in turn to obtain the fused loss; then obtains the loss to be processed based on the number of samples in the sample set and the fused loss.
[0079] In a feasible implementation, the processing device may multiply the fusion loss by the inverse of the number of samples to obtain the loss to be processed.
[0080] In another feasible implementation, the processing device may multiply the fusion loss by a coefficient associated with the inverse of the number of samples to obtain the loss to be processed.
[0081] Step c2: performing empirical risk minimization on the loss to be processed to obtain parameters to be adjusted.
[0082] In the embodiment of the present application, the processing device performs empirical risk minimization on the loss to be processed, that is, determines the minimum value corresponding to the loss to be processed, and then determines the minimum value corresponding to the loss to be processed as the parameter to be adjusted.
[0083] Step c3: Fusing the parameters to be adjusted and the loss increment parameters to obtain the model target parameters.
[0084] In the embodiment of the present application, the processing device fuses the parameter to be adjusted and the loss increment parameter to obtain the model target parameter; that is, when the loss to be processed corresponds to the minimum value, the loss to be processed and the loss increment parameter at the minimum value are fused to obtain the optimal model parameter.
[0085] In another feasible implementation, the parameter to be adjusted and the loss increment parameter may be added to obtain the model target parameter.
[0086] In a feasible implementation, the product of a preset coefficient and a parameter to be adjusted and the product of another preset coefficient and a loss increment parameter may be added to obtain the model target parameter.
[0087] It should be noted that when the determined loss reaches the minimum value, that is, when the loss converges, the corresponding model parameters at this time can be assumed to be the optimal model parameters.
[0088] The processing method provided in the embodiment of the present application first inputs each sample into the model to be tested to obtain the output result corresponding to each sample, and then determines the loss corresponding to each sample based on the output result corresponding to each sample and the label corresponding to each sample; then, based on the loss corresponding to each sample and the loss variation coefficient corresponding to the empty sample, obtains the minimum loss value and loss increment parameter corresponding to the sample set; finally, determines the model target parameter based on the minimum loss value and loss increment parameter corresponding to the sample set. In this way, the accuracy of determining the model target parameter can be higher, so that the accuracy of determining the corresponding influence value based on the model target parameter can be higher.
[0089] Based on the above embodiments, the present application also provides a processing method, which is applied to a processing device, such as Figure 3 As shown, it is a flow chart of another processing method provided in the embodiment of the present application; Figures 1 to 3 As shown, the method comprises the following steps:
[0090] Step 301: Determine the change amount of the model target parameter based on the loss change coefficient.
[0091] In an embodiment of the present application, the model target parameter may be differentially calculated based on the loss change coefficient, that is, the partial derivative of the model target parameter with respect to the loss transformation coefficient may be determined; and the partial derivative may be determined as the change amount of the model target parameter.
[0092] The change in the model target parameter may be an increase or a decrease relative to the original model parameter.
[0093] In a feasible implementation, the processing device determines the change amount of the model target parameter based on the loss change coefficient, that is, the processing device executes step 301, which can be implemented by the following steps 301a and 301b (not shown in the figure):
[0094] Step 301a: when the loss variation coefficient is zero, determine the variation of the model target parameter as an influencing parameter associated with the loss of the sample to be tested.
[0095] In the embodiment of the present application, the change amount of the model target parameter can be determined by setting the loss change coefficient to zero in advance; the change amount is an influencing parameter associated with the loss of the sample to be tested.
[0096] It should be noted that when the loss variation coefficient is zero, the representation change is infinitesimal, that is, the empty sample corresponding to the test sample has no additional impact on the model; therefore, the impact of the test sample on the model parameters is limited to its own impact, that is, the change in the model target parameters is the impact parameter associated with the loss corresponding to the test sample.
[0097] Step 301b: When the loss variation coefficient is a negative coefficient related to the number of samples in the sample set, determine the variation of the model target parameter as an influencing parameter associated with the number of samples.
[0098] In the embodiment of the present application, when the loss variation coefficient is a negative coefficient related to the number of samples in the sample set; in a feasible implementation, when the number of samples in the sample set is m, the loss variation coefficient can be
[0099] Among them, the loss variation coefficient is When , the change in the model target parameter is the influence parameter associated with the number of samples. That is, the influence of the corresponding model parameter after the sample to be tested is removed.
[0100] It should be noted that in the embodiment of the present application, the change amount of different model target parameters is determined based on different loss change coefficients; in this way, after the test sample is converted into a null sample, the influence value of the test sample on the model parameters can be determined, which can further improve the accuracy of determining the change amount of the model parameters matching the test sample.
[0101] Step 302: determine the variation as the influence value of the sample to be tested on the model parameters of the model to be tested.
[0102] In the embodiment of the present application, the processing device can directly determine the change amount as the influence value of the sample to be tested on the model parameters of the model to be tested.
[0103] The processing method provided in the embodiment of the present application derives the determined model target parameters based on the preset loss variation coefficient of the empty sample corresponding to the sample to be tested, so as to determine the influence value of the sample to be tested on the model parameters of the model to be tested. In this way, the accuracy of determining the influence value can be improved.
[0104] Based on this, the processing device provided in the embodiment of the present application can also perform the following steps A1 to A3:
[0105] Step A1: Arrange the influence value of each sample on the model parameters of the model to be tested to obtain an arrangement result.
[0106] In an embodiment of the present application, the processing device can determine the influence value of each sample in the sample set on the model parameters of the model to be tested, and then arrange the influence values of each sample on the model parameters of the model to be tested to obtain an arrangement result corresponding to each sample.
[0107] Among them, the corresponding arrangement result can be obtained by arranging from large to small based on the influence value, or the corresponding arrangement result can be obtained by arranging from small to large based on the influence value; in the following other embodiments of this application, the arrangement from large to small is taken as an example for explanation.
[0108] Step A2: in the arrangement results, determine the target samples whose influence values are greater than a preset threshold.
[0109] In an embodiment of the present application, in the arrangement results, target samples whose influence values are greater than a preset threshold are determined; wherein the preset threshold may be set in advance.
[0110] The number of target samples can be one or two.
[0111] Step A3: Adjust the labels of the target samples to the perturbation samples of the model to be tested to obtain an updated sample set.
[0112] In an embodiment of the present application, the processing device may adjust the label of the target sample to a perturbation sample of the model to be tested, that is, a sample that has a greater impact on the model parameters of the model to be tested, and then obtain an updated sample set based on the sample with the changed label.
[0113] It should be noted that in the embodiment of the present application, based on the influence value of each sample in the sample set on the model parameters of the model to be tested, the target sample whose influence value is greater than the preset threshold is determined; and then the perturbation sample of the model to be tested is determined in the sample set. In this way, the sample that affects the model parameters can be determined efficiently and conveniently, and then the accuracy of the model output result can be adjusted based on the perturbation sample.
[0114] Based on this, the processing method provided by the embodiment of the present application is applied. In practical applications, for any labeled sample set: P = (p1, p2, ..., p m ), and input it into a model to be tested to determine the value of each sample p in the sample set. i The influence of the model parameters of the model to be tested can be achieved by the following steps:
[0115] First, from the sample set P = (p1, p2, ..., p m ) randomly selects a sample p and uses a null sample z null Alternative.
[0116] Secondly, each sample p in the sample set i Input to the model to be tested and obtain the corresponding output result l(p i ); where each output result l(p i ) and the label corresponding to each sample, and obtain the loss L(p i ).
[0117] It should be noted that if the labeled sample set P is an image, it is divided into multiple sub-images, corresponding to multiple samples p i ; Then select a null sample z null Replace any sub-image p i Afterwards, the empty sample z will be carried null The image is input into the model to be tested, and multiple sub-images p in the image P are obtained. i The corresponding output result l(p i ), for example, it can be multiple sub-images p in image P i The corresponding probability information is shown in formula (1):
[0118] l(p i )=f(P)-f(p i +z null ) formula (1);
[0119] Among them, l(p i ) is each sample p i The corresponding probability information, f(P)-f(p i +z null ) represents the z that will carry the empty sample null The image is input into the model to be tested for result prediction.
[0120] Among them, use the empty sample z null When replacing sample p, an empty sample z can be given based on the loss corresponding to sample p null The corresponding loss; at the same time, p is converted to z by default null Input to the model to be tested, and the loss obtained is the empty sample z null The corresponding loss; that is, the sum of the loss of p input to the model and the loss increment, which has a corresponding relationship with the loss corresponding to p.
[0121] It should be noted that it is generally assumed that when the loss reaches the minimum during the model operation, that is, the loss converges, the corresponding model parameters are the optimal model parameters, as shown in formula (2):
[0122]
[0123] in, is any optimal parameter within the model, θ is any parameter within the model, and Θ represents all parameters of this model. At this time, use the empty sample z null When replacing sample p, the optimal model parameters can be obtained by referring to formula (2):
[0124]
[0125] Among them, ε is the same as the empty sample z null The corresponding loss variation coefficient, and then for sample p, its corresponding loss increment is εL'(p,θ'); θ' is the model parameter obtained by inputting the corresponding sample p into the model to be tested. That is, the sample p is changed to an empty sample z null The corresponding optimal model parameters.
[0126] Finally, to determine the change of the model parameters caused by sample p, we can use differentiation, that is, to find the change of sample p to the empty sample z null The corresponding partial derivative of the optimal model parameters with respect to ε, and then the influence of sample p on the model parameters of the model to be tested can be determined as
[0127] Among them, when finding the partial derivative with respect to ε, different values of ε can be taken; for example, when ε is 0, it can be assumed that the effect is infinitesimal at this time, that is, the corresponding change in model parameters I up,params (p) is infinitesimal; as shown in formulas (4) and (5); ε is a coefficient related to the number of samples in the sample set, for example: At this time, sample p can be removed by default. Correspondingly, the influence of sample p on the model parameters is
[0128]
[0129]
[0130] Among them, formula (5) can represent the i The Hessian Matrix is derived from the loss of ; it is a square matrix composed of the second-order partial derivatives of a multivariate function, which is used to describe the local curvature of the function.
[0131] Based on the above, the processing method provided in the embodiment of the present application can accurately identify the impact of samples input to the model on the model parameters, so as to subsequently adjust the model parameters based on the impact to improve the accuracy of the model output results.
[0132] Based on the above embodiments, the present application also provides a processing device 400, which can be applied to Figures 1 to 3 In a processing method provided in a corresponding embodiment, referring to Figure 4 As shown, the processing device 400 includes:
[0133] The acquisition module 401 is used to acquire a labeled sample set and select a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set;
[0134] A first determination module 402 is used to determine a blank sample corresponding to the sample to be tested; wherein the blank sample represents a sample that does not carry feature information;
[0135] A second determination module 403 is used to determine the model target parameters matching the sample to be tested based on the sample set, the empty sample and the model to be tested;
[0136] The third determination module 404 is used to determine the influence value of the sample to be tested on the model parameters of the model to be tested based on the model target parameters.
[0137] In other embodiments of the present application, the second determination module 403 also includes: an input submodule, used to input the sample set into the model to be tested to obtain an output result; a first determination submodule, used to determine the loss corresponding to each sample in the sample set based on the output result and the label annotated with each sample in the sample set; and a second determination submodule, used to determine the model target parameters based on the loss corresponding to each sample in the sample set and the empty sample.
[0138] In other embodiments of the present application, the second determination submodule is also used to determine the loss of the sample to be tested as the basic loss of the empty sample; obtain the loss increment parameter based on the loss variation coefficient corresponding to the empty sample and the basic loss; and determine the model target parameter based on the loss corresponding to each sample and the loss increment parameter.
[0139] In other embodiments of the present application, the second determination submodule is also used to obtain a loss to be processed based on the number of samples in the sample set and the fusion loss; wherein the fusion loss is obtained by fusing the losses corresponding to each sample; the loss to be processed is empirically minimized to obtain a parameter to be adjusted; the parameter to be adjusted and the loss increment parameter are fused to obtain the model target parameter.
[0140] In other embodiments of the present application, the third determination module 404 is further used to determine the change amount of the model target parameter based on the loss change coefficient; and determine the change amount as the influence value of the sample to be tested on the model parameter of the model to be tested.
[0141] In other embodiments of the present application, the third determination module 404 is also used to determine, when the loss variation coefficient is zero, the change in the model target parameter as an influencing parameter associated with the loss of the sample to be tested; and when the loss variation coefficient is a negative coefficient related to the number of samples in the sample set, determine the change in the model target parameter as an influencing parameter associated with the number of samples.
[0142] In other embodiments of the present application, the processing device 400 further includes: an arrangement module, used to arrange the influence value of each sample on the model parameters of the model to be tested to obtain an arrangement result; a fourth determination module, used to determine the target sample whose influence value is greater than a preset threshold in the arrangement result; and an adjustment module, used to adjust the label of the target sample to a perturbation sample of the model to be tested to obtain an updated sample set.
[0143] It should be noted that the specific implementation process of the steps executed by each module in this embodiment can be referred to Figures 1 to 3 The implementation process of the processing method provided in the corresponding embodiment will not be repeated here.
[0144] The processing device provided in the embodiment of the present application first obtains a labeled sample set and selects a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set; secondly, determines an empty sample corresponding to the sample to be tested; wherein the empty sample represents a sample that does not carry feature information; then, based on the sample set, the empty sample and the model to be tested, determines the model target parameters that match the sample to be tested; finally, based on the model target parameters, determines the impact value of the sample to be tested on the model parameters of the model to be tested. In this way, the impact of the sample input to the model on the model parameters can be accurately identified, so that the model parameters can be adjusted based on the impact to improve the accuracy of the model output results.
[0145] Based on the above embodiments, the embodiments of the present application further provide an electronic device 5, which can be applied to Figures 1 to 3 In a processing method provided in a corresponding embodiment, referring to Figure 5 As shown, the electronic device 5 may include: a processor 51, a memory 52 and a communication bus 53, wherein:
[0146] The communication bus 53 is used to implement the communication connection between the processor 51 and the memory 52 .
[0147] The processor 51 is used to execute the program of the processing method stored in the memory 52 to achieve the reference Figures 1 to 3 The corresponding embodiment provides a processing method.
[0148] The electronic device provided in the embodiment of the present application first obtains a labeled sample set and selects a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set; secondly, determines an empty sample corresponding to the sample to be tested; wherein the empty sample represents a sample that does not carry feature information; then, based on the sample set, the empty sample and the model to be tested, determines the model target parameters that match the sample to be tested; finally, based on the model target parameters, determines the impact value of the sample to be tested on the model parameters of the model to be tested. In this way, the impact of the sample input to the model on the model parameters can be accurately identified, so that the model parameters can be adjusted based on the impact to improve the accuracy of the model output results.
[0149] Based on the foregoing embodiments, the embodiments of the present application provide a computer-readable storage medium, which stores one or more programs, and the one or more programs can be executed by one or more processors to implement the following. Figures 1 to 3 The corresponding embodiment provides a processing method.
[0150] It should be noted that the above-mentioned computer-readable storage medium can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc (CD-ROM) and other memories; it can also be various electronic devices including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0151] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0152] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
[0153] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0154] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0155] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0156] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0157] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A processing method, the method comprising: Obtain a labeled sample set, and select a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set; Determine a blank sample corresponding to the sample to be tested; wherein the blank sample represents a sample that does not carry feature information; Inputting the sample set into the model to be tested to obtain an output result; Determine the loss corresponding to each sample in the sample set based on the output result and the label annotated by each sample in the sample set; Determine a model target parameter that matches the sample to be tested based on the loss corresponding to each sample in the sample set and the empty sample; Based on the model target parameters, an influence value of the sample to be tested on the model parameters of the model to be tested is determined.
2. The method according to claim 1, wherein determining the model target parameter based on the loss corresponding to each sample in the sample set and the empty sample comprises: Determine the loss of the sample to be tested as the basic loss of the empty sample; Obtaining a loss increment parameter based on the loss variation coefficient corresponding to the empty sample and the basic loss; The model target parameter is determined based on the loss corresponding to each sample and the loss increment parameter.
3. The method according to claim 2, wherein determining the model target parameter based on the loss corresponding to each sample and the loss increment parameter comprises: Based on the number of samples in the sample set and the fusion loss, a loss to be processed is obtained; wherein the fusion loss is obtained by fusing the losses corresponding to each sample; Performing empirical risk minimization on the loss to be processed to obtain parameters to be adjusted; The parameters to be adjusted and the loss increment parameters are merged to obtain the model target parameters.
4. The method according to claim 2, wherein determining the influence value of the sample to be tested on the model parameters of the model to be tested based on the model target parameters comprises: Determining a change in the model target parameter based on the loss change coefficient; The change amount is determined as the influence value of the sample to be tested on the model parameters of the model to be tested.
5. The method according to claim 4, wherein determining the change amount of the model target parameter based on the loss change coefficient comprises: When the loss variation coefficient is zero, determining the variation of the model target parameter as an influencing parameter associated with the loss of the sample to be tested; In the case where the loss variation coefficient is a negative coefficient related to the number of samples in the sample set, the variation of the model target parameter is determined as an influencing parameter associated with the number of samples.
6. The method according to any one of claims 1 to 5, further comprising: Arrange the influence value of each sample on the model parameters of the model to be tested to obtain an arrangement result; In the arrangement results, determining target samples whose influence values are greater than a preset threshold; The labels of the target samples are adjusted to the perturbation samples of the model to be tested to obtain an updated sample set.
7. A processing device comprising: An acquisition module, used to acquire a labeled sample set and select a sample to be tested from the sample set; wherein the sample to be tested is any sample in the sample set; A first determination module is used to determine a blank sample corresponding to the sample to be tested; wherein the blank sample represents a sample that does not carry feature information; An input submodule, used to input the sample set into the model to be tested to obtain an output result; A first determination submodule, configured to determine a loss corresponding to each sample in the sample set based on the output result and a label annotated with each sample in the sample set; A second determination submodule, configured to determine a model target parameter matching the sample to be tested based on the loss corresponding to each sample in the sample set and the empty sample; The third determination module is used to determine the influence value of the sample to be tested on the model parameters of the model to be tested based on the model target parameters.
8. An electronic device, comprising: processor, memory, and communications bus; The communication bus is used to realize the communication connection between the processor and the memory; The processor is used to execute the program in the memory to implement the processing method according to any one of claims 1 to 6.
9. A computer-readable storage medium storing one or more programs, wherein the one or more programs can be executed by one or more processors to implement the processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
State space-based multi-featured device state evaluation method and application
CN102136038A
Target detection model training method, device and equipment, and readable storage medium
CN112232426A