A data forgetting method, device, equipment and storage medium for a model
By using multi-convolution network channels and model pruning technology in machine learning models, the mask results and channel parameters of data to be forgotten are solved, and the problem of data recovery risk after user data is deleted is realized. Effective forgetting and privacy protection.
Patent Information
- Application Number
- CN202210463318.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-28
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2042-04-28
AI Technical Summary
After the user data is deleted, existing machine learning models may still recover training data through attack methods, resulting in user privacy leakage and making it difficult to effectively forget the training data.
The pre-trained image recognition model is used to determine the mask result of the data to be forgotten through at least two convolutional network channels, and the channel parameters are adjusted in combination with the model pruning parameters to achieve complete forgetting of some training data.
While maintaining the accuracy of model recognition, it realizes complete forgetting of some training data, protects user privacy, and prevents data recovery.
Smart Images

Figure CN114863243B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine learning technology, and in particular to a data forgetting method, device, equipment and storage medium for a model. Background Art
[0002] With the continuous development of machine learning technology, most companies are building more machine learning models. In practical applications, in order to obtain a sufficiently accurate model, a large amount of actual data is required to train the corresponding neural network, and public data sets are often difficult to meet this requirement. Therefore, companies usually collect the required user data and build corresponding user data sets so that the trained model can have higher performance. However, for users, after uploading their own data, even if they later request the company to delete the data, the company will often only delete the user's original data, but will not adjust the model trained with the user data.
[0003] Some studies in recent years have shown that if a user's data has been used to train a neural network model, it is possible to obtain the original data used for training through some attack methods. For example, a membership inference attack can restore certain images in the training set by attacking the output of the model. The existence of these attack methods means that even if users have asked the company to delete their data, third parties may still be able to obtain their private data through model attacks. Therefore, how to effectively forget certain training data in a trained model is crucial to satisfying the user's right to be forgotten. Summary of the invention
[0004] The present invention provides a data forgetting method, device, equipment and storage medium for a model, which can achieve complete forgetting of part of the training data while maintaining the recognition accuracy of the model, thereby protecting user privacy.
[0005] According to one aspect of the present invention, a data forgetting method for a model is provided, the method comprising:
[0006] Using a pre-trained image recognition model, image recognition is performed on the acquired image data to be forgotten, and a mask result of the image data to be forgotten is determined, wherein the image recognition model includes at least two convolutional network channels, the convolutional network channels are used to determine the mask information of the channel input data and the output feature map, and the mask result includes the mask information output by each of the convolutional network channels for the image data to be forgotten;
[0007] The preset model pruning parameters are obtained, and in combination with the mask result, the channels to be pruned are determined from each of the convolutional network channels, and the parameters of the channels to be pruned are adjusted to obtain an image recognition model with updated parameters.
[0008] According to another aspect of the present invention, a data forgetting device for a model is provided, the device comprising:
[0009] A mask result determination module, used to use a pre-trained image recognition model to perform image recognition on the acquired to-be-forgotten image data, and determine the mask result of the to-be-forgotten image data, wherein the image recognition model includes at least two convolutional network channels, the convolutional network channels are used to determine the mask information and output feature map of the channel input data, and the mask result includes the mask information output by each of the convolutional network channels for the to-be-forgotten image data;
[0010] The model channel pruning module is used to obtain preset model pruning parameters, determine the channels to be pruned from each of the convolutional network channels in combination with the mask result, and adjust the parameters of the channels to be pruned to obtain an image recognition model with updated parameters.
[0011] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the data forgetting method of the model described in any embodiment of the present invention.
[0015] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the data forgetting method of the model described in any embodiment of the present invention when executed by a processor.
[0016] The technical solution of the embodiment of the present invention adopts a pre-trained image recognition model to perform image recognition on the acquired image data to be forgotten, and determine the mask result of the image data to be forgotten, wherein the image recognition model includes at least two convolutional network channels, and the convolutional network channel is used to determine the mask information and output feature map of the channel input data, and the mask result includes the mask information output by each convolutional network channel for the image data to be forgotten; obtain preset model pruning parameters, combine the mask result, determine the channel to be pruned from each convolutional network channel, and adjust the parameters of the channel to be pruned to obtain the image recognition model with updated parameters. While maintaining the model recognition accuracy, the present invention realizes complete forgetting of part of the training data, makes the deleted training data irrecoverable, and protects user privacy.
[0017] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0019] Figure 1a is a flow chart of a data forgetting method of a model provided according to the first embodiment of the present invention;
[0020] Figure 1b It is a schematic diagram of the principle of a convolutional network channel in a data forgetting method of a model provided in Embodiment 1 of the present invention;
[0021] Figure 1c It is a schematic diagram of the principle of an image recognition model in a data forgetting method of a model provided in Embodiment 1 of the present invention;
[0022] Figure 2 is a schematic diagram of the structure of a data forgetting device of a model provided according to the second embodiment of the present invention;
[0023] Figure 3 It is a schematic diagram of the structure of an electronic device for implementing the data forgetting method of the model of an embodiment of the present invention. DETAILED DESCRIPTION
[0024] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0025] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0026] Embodiment 1
[0027] Figure 1a A flowchart of a data forgetting method for a model is provided for the first embodiment of the present invention. This embodiment is applicable to the case where the model parameters are adjusted after deleting part of the training data. The method can be executed by a data forgetting device for the model. The data forgetting device for the model can be implemented in the form of hardware and / or software. The data forgetting device for the model can be configured in a computer. Figure 1a As shown, the method includes:
[0028] S110. Use a pre-trained image recognition model to perform image recognition on the acquired image data to be forgotten, and determine the mask result of the image data to be forgotten, wherein the image recognition model includes at least two convolutional network channels, and the convolutional network channel is used to determine the mask information and output feature map of the channel input data, and the mask result includes the mask information output by each convolutional network channel for the image data to be forgotten.
[0029] In this embodiment, the image recognition model is trained by the training image data, and the image data to be forgotten is part of the training image data. The image data to be forgotten can be a piece of data in the model training data, or a data set consisting of multiple pieces of data. The image data to be forgotten can be represented by D_forget.
[0030] Specifically, the acquired image data to be forgotten can be used as input data of the image recognition model to obtain the corresponding output, including the recognition result and mask result of the model. When using the image recognition model to recognize images, the recognition result output by the model is mainly concerned, and when the model is adjusted to forget part of the training data, the mask result output by the model is mainly concerned. The image recognition model in this embodiment includes at least two convolutional network channels, each of which outputs corresponding mask information, and all mask information constitutes the mask result. The mask result may include the correlation between each convolutional network channel and the image data to be forgotten.
[0031] In order to achieve complete forgetting of part of the training data while maintaining the recognition accuracy of the image recognition model in this embodiment, to meet this requirement, it is first necessary to adjust the structure of the image recognition model, design a network model that is conducive to data forgetting, and maintain a relatively high accuracy after forgetting the user data. Using this network structure, a specific optimization goal is designed during training so that the calculation paths that different data need to pass through become sparse, thereby reducing the correlation between each other. When forgetting data, first count the calculation paths that the data that needs to be forgotten passes through, and then perform customized pruning operations on these paths, delete the model parameters related to these data, and achieve forgetting of part of the data, so that attackers can no longer recover the deleted data. In this way, enterprises can achieve complete data forgetting after receiving a user's data deletion request, thereby protecting user privacy.
[0032] Optionally, the training process of the image recognition model used in this embodiment may include the following steps:
[0033] A1. Perform image recognition and annotation on the training image data to obtain standard recognition results.
[0034] Specifically, the training image data may be manually annotated to obtain a standard recognition result.
[0035] A2. Input the training image data into the image recognition model to be trained to obtain the output training recognition results and training mask results, wherein the image recognition model to be trained includes at least two convolutional network channels to be trained and a fully connected network layer to be trained.
[0036] In this embodiment, the image recognition model to be trained adds a mask generation function based on a multi-channel convolutional neural network, thereby controlling the calculation path of the input data. First, a basic convolution module can be constructed, and each convolution module can be composed of three parts, namely a convolution calculation unit (Conv), a normalization unit (BN) and an activation function unit (Ac). For each convolution module, the input feature map (x) is calculated to obtain an output feature map of y = Ac (BN (Conv (x))). By connecting these convolution modules, a basic convolutional neural network can be implemented. Secondly, for each convolution module, a mask module is added thereto. The mask module first uses an average pooling unit (AvgPool) to compress the input data by channel to obtain a set of channel saliency values, and then uses a fully connected unit (FC) to calculate a set of masks. The length of the mask is the same as the number of output channels of the convolution layer, that is, m = FC (AvgPool (x)). Finally, the mask is multiplied by the output of the convolution layer and then input into the normalization layer and the activation layer to form a convolutional network channel to be trained. The output feature map of the convolutional network channel to be trained is y = Ac(BN(Conv(x)·m)). At the same time, the calculation result m of each mask module is output as mask information.
[0037] In the convolutional network channel to be trained, the convolution calculation unit performs convolution calculation on the input feature map through the convolution kernel parameters and transforms the number of input channels to the number of output channels. The normalization unit normalizes the result of the convolution calculation, and then performs nonlinear processing on the features through the activation unit. The other part is the mask module, which mainly includes the average pooling unit and the fully connected unit, which calculates the saliency value of the output channel for the input feature map. Taking the input feature map as the original image as an example, the size of the input feature map is 3*32*32, the convolution calculation unit uses a 3*3 convolution kernel, the input channel is 3, and the output channel is 64, then the parameter size of the convolution calculation unit is 64*3*3*3, and after passing through the convolution calculation unit, the size of the feature map is 64*32*32; on the other hand, the mask module calculates the saliency value of the output channel through the pooling unit and the fully connected unit, with a size of 64*1, where each data is normalized to [0,1] to indicate the importance of the output channel, and then multiplies the feature map with the channel saliency value to obtain a feature map with a mask added, and the size is still 64*32*32; finally, the final output feature map is obtained through normalization and activation units, with a size of 64*32*32. At the same time, the output of the mask module is also added to the result, which is reserved for the subsequent calculation of the regularization loss.
[0038] In addition, before using the image recognition model to be trained, the model can be initialized. The initialization method used in the present invention can be Gaussian initialization, that is, each parameter in the model is randomly sampled from a Gaussian distribution and used as an initial value.
[0039] Furthermore, the specific implementation steps of A2 may be:
[0040] A21. Input the training image data into the first convolutional network channel to be trained, and output the corresponding training mask information and training output feature map.
[0041] A22. Use the training output feature map output by the first convolutional network channel to be trained as input data, input the second convolutional network channel to be trained, output the corresponding training mask information and training output feature map, and so on, until the last convolutional network channel to be trained outputs the corresponding training mask information and training output feature map.
[0042] A23. Input the training output feature map output by the last convolutional network channel to be trained into the fully connected network layer to be trained to obtain the training recognition result.
[0043] A24. Fuse the training mask information output by each convolutional network channel to be trained to obtain a training mask result.
[0044] For example, Figure 1b Schematic diagram of the principle of a convolutional network channel in a data forgetting method of a model provided in Embodiment 1 of the present invention. Figure 1b As shown in the figure, the input feature map is input into the convolutional network channel to be trained, and the mask information and output feature map can be output after calculation.
[0045] This embodiment uses a convolution module with a mask module added to build a complete neural network, cascading multiple convolution modules and mask modules, where each convolution module corresponds to a mask module to form a convolution network channel. The input of the first convolution network channel is the original image data, and the input of each convolution network channel thereafter is the output feature map of the previous convolution network channel. A fully connected unit is added after the last convolution network channel to output the final recognition result. At the same time, during the training process, the mask information of each convolution network channel is also output as an auxiliary result.
[0046] For example, Figure 1c FIG. 1 is a schematic diagram showing the principle of an image recognition model in a data forgetting method of a model provided in Embodiment 1 of the present invention. Figure 1c As shown, the training image data is input as the input image into the established neural network model, and the output recognition result and mask result are the training recognition result and training mask result corresponding to the training image data.
[0047] A3. Obtain a fitting loss function according to the standard recognition result, the training recognition result and the training mask result.
[0048] Specifically, since the standard recognition results are the real recognition results marked by humans, and the training recognition results are calculated by the model during the training process, there will inevitably be certain errors between the standard recognition results and the training recognition results. The fitting loss function can be calculated based on the standard recognition results, the training recognition results, and the training mask results generated with the assistance of the model.
[0049] Furthermore, the specific implementation steps of A3 may be:
[0050] A31. Determine the classification loss function based on the standard recognition result and the training recognition result in combination with the preset cross entropy function expression.
[0051] A32. Determine the regularization loss function based on the training mask result and the preset L1 regularization function expression.
[0052] A33. Perform weighted fusion on the classification loss function and the regularization loss function to obtain the fitting loss function.
[0053] In this embodiment, the training loss function of the model can be pre-designed. The training loss of the model can mainly include two parts. One is the classification error loss function, which is mainly calculated using the cross entropy function so that the prediction result of the model fits the actual training data as much as possible. The specific form can be Among them, N can represent the number of samples, M can represent the number of categories, and y ic It can indicate whether the true category of the sample is c, p ic It can represent the probability that the predicted sample belongs to category c. The other is the loss function of the mask result, which can be calculated using the L1 regularization function to make the mask output as sparse as possible, that is, to activate fewer convolution calculation channels, so that each sample can complete the calculation using only fewer channels, thereby reducing the number of the same channels passed by different samples, that is, reducing the coupling between different samples, so that the model can reduce the impact on the accuracy of other data when forgetting some data. The specific form can be L2=||w||1=∑ i |w i |, where w can represent the output results of each mask module, that is, the training mask information output by each convolutional network channel to be trained. After obtaining the classification loss function and the regularization loss function, the two can be added together to obtain the total training loss of the model, that is, the fitting loss function L = L1 + L2. When calculating the fitting loss function, the weights of the classification loss function and the regularization loss function can also be adjusted according to actual needs.
[0054] A4. Back-propagate the image recognition model to be trained by fitting the loss function to obtain the image recognition model.
[0055] Furthermore, the specific implementation steps of A4 may be: deriving the fitting loss function, determining the parameter gradient of each convolutional network channel to be trained, and using the gradient update method to update the parameters of each convolutional network channel to be trained to obtain an image recognition model.
[0056] Specifically, after obtaining the fitting loss function, the fitting loss function can be differentiated to obtain the gradients of the parameters of each channel, and the gradient update algorithm can be used to update the parameters of the model to complete a set of training processes until all data sets are trained or the model test accuracy of the model is greater than the preset model test threshold. The model training is completed, the model parameters are saved, and the model can then be deployed to actual applications.
[0057] S120, obtaining preset model pruning parameters, combining the mask result, determining the channels to be pruned from each convolutional network channel, and adjusting the parameters of the channels to be pruned to obtain an image recognition model with updated parameters.
[0058] In this embodiment, for a trained model, if a part of the data in the training set needs to be forgotten, the model needs to be forgotten. The forgetting of the model mainly depends on the mask module. By calculating the mask result of the image data to be forgotten, the convolution channel activated when identifying the image data to be forgotten can be obtained. After that, the data of these channels can be removed by pruning, thereby completing the forgetting of the data.
[0059] Optionally, S120 may be implemented by the following steps:
[0060] S1201. Sort the forgotten data relevance of each convolutional network channel according to the mask information corresponding to each convolutional network channel.
[0061] S1202. Obtain a preset model pruning ratio and a model pruning weight, determine the number of channels to be pruned according to the model pruning ratio, and determine the number of channels to be pruned convolutional network channels with the highest ranking of forgotten data relevance as the channels to be pruned.
[0062] S1203: Adjust the model parameters in the pruned channel according to the model pruning weights to obtain an image recognition model with updated parameters.
[0063] In practical applications, when the image data to be forgotten contains multiple image data, the mask results corresponding to each image data can be accumulated according to the position, and finally the mask cumulative value calculated in the convolution module of the model for the entire forgotten data set is obtained. This data can reflect the correlation between the model parameters and the image data to be forgotten. The larger the cumulative value, the stronger the correlation between the corresponding convolution network channel parameters and the input data. Therefore, it is necessary to give priority to the channel parameters with greater correlation to achieve the purpose of data forgetting. The mask cumulative values can be sorted according to size, and the masks with higher correlation are determined according to the pre-set model pruning ratio P, and the output channel relationship between the mask module and the convolution module is corresponded to the relevant convolution network channels, and these convolution network channels are marked as channels to be pruned. According to the pre-set model pruning weight W, the model parameters of the pruned channel are modified. In this embodiment, each model parameter in the pruned channel can be multiplied by (1-W). The larger the model pruning ratio W, the greater the change in the model parameters after pruning, and the less residual information in the model, thereby achieving the purpose of data forgetting.
[0064] The technical solution of the embodiment of the present invention uses a pre-trained image recognition model to perform image recognition on the acquired image data to be forgotten, and determine the mask result of the image data to be forgotten, wherein the image recognition model includes at least two convolutional network channels, and the convolutional network channel is used to determine the mask information and output feature map of the channel input data, and the mask result includes the mask information output by each convolutional network channel for the image data to be forgotten; obtain preset model pruning parameters, combine the mask result, determine the channel to be pruned from each convolutional network channel, and adjust the parameters of the channel to be pruned to obtain the image recognition model with updated parameters. The embodiment of the present invention achieves complete forgetting of part of the training data while maintaining the model recognition accuracy, so that the deleted training data cannot be restored, thereby protecting user privacy.
[0065] Based on the above solution, the data forgetting method of the model provided in this embodiment may further include the following steps:
[0066] S130. Perform a model accuracy test on the image recognition model after parameter update according to the to-be-forgotten image data to obtain a first model test accuracy.
[0067] Specifically, after the model is pruned, the accuracy of the model can be tested using the image data to be forgotten to obtain a first model test accuracy. If the first model test accuracy is greater than a preset model forgetting threshold, S140 can be performed; otherwise, S150 can be performed.
[0068] S140: When the test accuracy of the first model is greater than a preset model forgetting threshold, the image recognition model is pruned again according to the image data to be forgotten, and the model parameters are continued to be updated.
[0069] Specifically, when the first model test accuracy is greater than a preset model forgetting threshold, it can be considered that the pruning effect does not meet the data forgetting standard, and the process can return to S120 to continue to repeat pruning.
[0070] S150. When the first model test accuracy is less than or equal to the model forgetting threshold, obtain the remaining image data; and perform model accuracy compensation on the image recognition model based on the remaining image data, so that the second model test accuracy of the image recognition model is greater than the preset model test threshold.
[0071] Specifically, when the test accuracy of the first model is less than or equal to the model forgetting threshold, it can be considered that the pruning effect meets the data forgetting standard, then the pruning operation is stopped, and the remaining image data is used to perform compensatory training on the accuracy of the model to compensate for the decrease in accuracy caused by pruning.
[0072] In this embodiment, the remaining image data can be understood as other data in the model training data except the image data to be forgotten, which can be expressed as D_retain. The remaining image data can be used to repeat steps A1 to A4 to fine-tune the model parameters on the remaining image data, so that the test accuracy of the model is restored to the state before the data is forgotten, and the data forgetting and accuracy compensation are completed. The parameters of the model are saved, and then the model can be redeployed to the actual application.
[0073] The data forgetting method of the model provided by the embodiment of the present invention can implement a forgetting algorithm for a part of the training data without affecting the performance of the deep learning model, while maintaining the prediction accuracy of the remaining image data. The embodiment of the present invention reduces the overlapping parts of the calculation units of different types of data by controlling the calculation path of the input data, so that when data forgetting is performed, the calculation units of the forgotten data are removed through pruning operations, and the impact on the remaining data sets is reduced, and the accuracy loss caused by pruning is compensated through the accuracy compensation process, so that the model maintains high availability.
[0074] Embodiment 2
[0075] Figure 2 This is a schematic diagram of the structure of a data forgetting device of a model provided in the second embodiment of the present invention. Figure 2 As shown, the device comprises:
[0076] The mask result determination module 210 is used to use a pre-trained image recognition model to perform image recognition on the acquired image data to be forgotten, and determine the mask result of the image data to be forgotten, wherein the image recognition model includes at least two convolutional network channels, and the convolutional network channels are used to determine the mask information and output feature map of the channel input data, and the mask result includes the mask information output by each of the convolutional network channels for the image data to be forgotten.
[0077] The model channel pruning module 220 is used to obtain preset model pruning parameters, determine the channels to be pruned from each of the convolutional network channels in combination with the mask result, and adjust the parameters of the channels to be pruned to obtain an image recognition model with updated parameters.
[0078] Optionally, the model channel pruning module 220 includes:
[0079] A data relevance sorting unit, used to sort the forgetting data relevance of each of the convolutional network channels according to the mask information corresponding to each of the convolutional network channels;
[0080] A channel determination unit to be pruned is used to obtain a preset model pruning ratio and a model pruning weight, determine the number of channels to be pruned according to the model pruning ratio, and determine the number of channels to be pruned convolutional network channels with the highest ranking of forgotten data relevance as the channels to be pruned;
[0081] A channel parameter pruning unit is used to adjust the model parameters in the to-be-pruned channel according to the model pruning weights to obtain an image recognition model with updated parameters.
[0082] Optionally, the device further includes a first model accuracy testing module, which is used to:
[0083] After determining a channel to be pruned from each of the convolutional network channels and adjusting parameters of the channel to be pruned to obtain an image recognition model with updated parameters, a model accuracy test is performed on the image recognition model with updated parameters according to the image data to be forgotten to obtain a first model test accuracy;
[0084] When the test accuracy of the first model is greater than a preset model forgetting threshold, the image recognition model is pruned again according to the to-be-forgotten image data, and the model parameters are continuously updated.
[0085] Optionally, the device further includes a second model accuracy testing module, which is used to:
[0086] After obtaining the first model test accuracy, when the first model test accuracy is less than or equal to the model forgetting threshold, obtaining the remaining image data;
[0087] According to the remaining image data, model accuracy compensation is performed on the image recognition model so that the second model test accuracy of the image recognition model is greater than a preset model test threshold.
[0088] Optionally, the training process of the image recognition model includes:
[0089] Perform image recognition and annotation on the training image data to obtain standard recognition results;
[0090] Inputting the training image data into an image recognition model to be trained to obtain output training recognition results and training mask results, wherein the image recognition model to be trained includes at least two convolutional network channels to be trained and a fully connected network layer to be trained;
[0091] Obtaining a fitting loss function according to the standard recognition result, the training recognition result and the training mask result;
[0092] The image recognition model to be trained is back-propagated through the fitting loss function to obtain the image recognition model.
[0093] Optionally, inputting the training image data into the image recognition model to be trained to obtain output training recognition results and training mask results includes:
[0094] Input the training image data into the first convolutional network channel to be trained, and output corresponding training mask information and training output feature map;
[0095] The training output feature map output by the first convolutional network channel to be trained is used as input data, and input into the second convolutional network channel to be trained, and the corresponding training mask information and training output feature map are output, and so on, until the last convolutional network channel to be trained outputs the corresponding training mask information and training output feature map;
[0096] Inputting the training output feature map output by the last convolutional network channel to be trained into the fully connected network layer to be trained to obtain a training recognition result;
[0097] The training mask information output by each of the convolutional network channels to be trained is fused to obtain a training mask result.
[0098] Optionally, obtaining a fitting loss function according to the standard recognition result, the training recognition result and the training mask result includes:
[0099] Determine a classification loss function according to the standard recognition result and the training recognition result in combination with a preset cross entropy function expression;
[0100] According to the training mask result, combined with a preset L1 regularization function expression, a regularization loss function is determined;
[0101] The classification loss function and the regularization loss function are weightedly fused to obtain a fitting loss function.
[0102] The data forgetting device of the model provided in the embodiment of the present invention can execute the data forgetting method of the model provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0103] Embodiment 3
[0104] Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0105] like Figure 3 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0106] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0107] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 performs the various methods and processes described above, such as the data forgetting method of the model.
[0108] In some embodiments, the data forgetting method of the model may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the data forgetting method of the model described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the data forgetting method of the model in any other appropriate manner (e.g., by means of firmware).
[0109] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0110] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0111] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0112] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0113] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0114] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0115] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0116] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A data forgetting method for a model, It is characterized in that include: Using a pre-trained image recognition model, image recognition is performed on the acquired image data to be forgotten, and a mask result of the image data to be forgotten is determined, wherein the image recognition model includes at least two convolutional network channels, the convolutional network channels are used to determine the mask information of the channel input data and the output feature map, and the mask result includes the mask information output by each of the convolutional network channels for the image data to be forgotten; The preset model pruning parameters are obtained, and in combination with the mask result, the channels to be pruned are determined from each of the convolutional network channels, and the parameters of the channels to be pruned are adjusted to obtain an image recognition model with updated parameters.
2. The method according to claim 1, It is characterized in that The step of obtaining preset model pruning parameters, combining the mask result, determining a channel to be pruned from each of the convolutional network channels, and adjusting parameters of the channel to be pruned to obtain an image recognition model after parameter update includes: According to the mask information corresponding to each of the convolutional network channels, sorting the relevance of forgotten data for each of the convolutional network channels; Obtain a preset model pruning ratio and a model pruning weight, determine the number of channels to be pruned according to the model pruning ratio, and determine the number of channels to be pruned convolutional network channels with the highest ranking of forgotten data relevance as the channels to be pruned; According to the model pruning weights, the model parameters in the to-be-pruned channel are adjusted to obtain an image recognition model with updated parameters.
3. The method according to claim 1, It is characterized in that After determining the to-be-pruned channel from each of the convolutional network channels and adjusting the parameters of the to-be-pruned channel to obtain the image recognition model with updated parameters, the method further includes: According to the to-be-forgotten image data, a model accuracy test is performed on the image recognition model after parameter update to obtain a first model test accuracy; When the test accuracy of the first model is greater than a preset model forgetting threshold, the image recognition model is pruned again according to the to-be-forgotten image data, and the model parameters are continuously updated.
4. The method according to claim 3, It is characterized in that After obtaining the first model test accuracy, it also includes: When the test accuracy of the first model is less than or equal to the model forgetting threshold, obtaining the remaining image data; According to the remaining image data, model accuracy compensation is performed on the image recognition model so that the second model test accuracy of the image recognition model is greater than a preset model test threshold.
5. The method according to any one of claims 1 to 4, It is characterized in that The training process of the image recognition model includes: Perform image recognition and annotation on the training image data to obtain standard recognition results; Inputting the training image data into an image recognition model to be trained to obtain output training recognition results and training mask results, wherein the image recognition model to be trained includes at least two convolutional network channels to be trained and a fully connected network layer to be trained; Obtaining a fitting loss function according to the standard recognition result, the training recognition result and the training mask result; The image recognition model to be trained is back-propagated through the fitting loss function to obtain the image recognition model.
6. The method according to claim 5, It is characterized in that The step of inputting the training image data into the image recognition model to be trained to obtain the output training recognition result and training mask result includes: Input the training image data into the first convolutional network channel to be trained, and output corresponding training mask information and training output feature map; The training output feature map output by the first convolutional network channel to be trained is used as input data, and input into the second convolutional network channel to be trained, and the corresponding training mask information and training output feature map are output, and so on, until the last convolutional network channel to be trained outputs the corresponding training mask information and training output feature map; Inputting the training output feature map output by the last convolutional network channel to be trained into the fully connected network layer to be trained to obtain a training recognition result; The training mask information output by each of the convolutional network channels to be trained is fused to obtain a training mask result.
7. The method according to claim 5, It is characterized in that The step of obtaining a fitting loss function according to the standard recognition result, the training recognition result and the training mask result includes: Determine a classification loss function according to the standard recognition result and the training recognition result in combination with a preset cross entropy function expression; According to the training mask result, combined with a preset L1 regularization function expression, a regularization loss function is determined; The classification loss function and the regularization loss function are weightedly fused to obtain a fitting loss function.
8. A data forgetting device for a model, It is characterized in that include: A mask result determination module, used to use a pre-trained image recognition model to perform image recognition on the acquired to-be-forgotten image data, and determine the mask result of the to-be-forgotten image data, wherein the image recognition model includes at least two convolutional network channels, the convolutional network channels are used to determine the mask information and output feature map of the channel input data, and the mask result includes the mask information output by each of the convolutional network channels for the to-be-forgotten image data; The model channel pruning module is used to obtain preset model pruning parameters, determine the channels to be pruned from each of the convolutional network channels in combination with the mask result, and adjust the parameters of the channels to be pruned to obtain an image recognition model with updated parameters.
9. An electronic device, It is characterized in that The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the data forgetting method of the model described in any one of claims 1 to 7.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to implement the data forgetting method of the model described in any one of claims 1 to 7 when executed by a processor.
