Model selective forgetting method based on neuron activation features

By generating dynamic baseline images to screen and process key neurons, this method addresses the shortcomings in efficiency, accuracy, and performance retention of existing model forgetting methods. It achieves efficient, accurate, and low-damage selective forgetting, suitable for tasks such as image classification and face recognition.

CN122242638APending Publication Date: 2026-06-19CHINA UNIV OF GEOSCIENCES (WUHAN)

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA UNIV OF GEOSCIENCES (WUHAN)
Filing Date
2026-03-04
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

Existing model forgetting methods are inadequate in terms of forgetting efficiency, accuracy, and retention of model performance after forgetting, making it difficult to achieve precise, efficient, and low-damage selective forgetting.

Method used

By generating dynamic baseline images, key neurons are selected based on differences in neuronal activation features, and these neurons are processed using corresponding pre-defined forgetting measures, including parameter zeroing or freezing, to construct an interpretable forgetting process.

Benefits of technology

It achieves high accuracy, high efficiency and high performance in model forgetting, ensuring that the model's ability to recognize other categories is preserved to the greatest extent, and provides an interpretable forgetting process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122242638A_ABST
    Figure CN122242638A_ABST
Patent Text Reader

Abstract

This invention provides a model-selective forgetting method based on neuronal activation features, comprising: generating a dynamic baseline image of the target forgetting category based on a unified baseline method, wherein the dynamic baseline image represents an image whose features are similar to those of the original image of the target forgetting category but which causes the original model to predict an image that deviates from the target category; identifying several key neurons sensitive to the features of the target forgetting category based on the differences in neuronal activation features of the fully connected layers of the original model during the inference process between the original image of the target forgetting category and the dynamic baseline image; and applying corresponding preset forgetting measures to process the key neurons based on the forgetting target, thereby obtaining the processed original model as the forgetting model for achieving the forgetting target. This invention achieves model forgetting by fusing a unified baseline algorithm to generate dynamic baseline images, locating key neurons of the target forgetting category, and performing model forgetting, resulting in a highly accurate, efficient, high-performance retention, and highly interpretable model forgetting method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of machine learning technology, and in particular to a model-selective forgetting method based on neuronal activation features. Background Technology

[0002] With the rapid development of deep learning technology, neural network models, thanks to their powerful feature learning and data fitting capabilities, have been widely applied in many fields such as image recognition, natural language processing, and intelligent recommendation. However, the model training process involves storing a large amount of feature information related to the training data, which makes data privacy protection a growing concern.

[0003] In practical applications, due to various reasons such as data compliance requirements, user privacy protection demands, and business direction adjustments, it is often necessary to make the trained model "forget" the memory of specific categories of data, while retaining the model's normal recognition ability for other categories of data as much as possible. This requirement is particularly urgent in multiple task scenarios such as image classification and face recognition.

[0004] Although existing methods for model forgetting exist, they still have shortcomings in terms of forgetting efficiency, accuracy, and retention of model performance after forgetting. Therefore, there is still a need for a precise, efficient, and low-damage model selective forgetting method. Summary of the Invention

[0005] This invention provides a model-selective forgetting method based on neuronal activation features, which addresses the shortcomings of existing model forgetting methods in terms of forgetting efficiency, accuracy, and retention of model performance after forgetting. It achieves a precise, efficient, low-damage, and interpretable model-selective forgetting method.

[0006] This invention provides a model-based selective forgetting method based on neuronal activation features, comprising: A dynamic baseline image for the target forgotten category is generated based on a unified baseline method. This dynamic baseline image represents an image whose features are similar to the original image of the target forgotten category, but allows the original model to predict images that deviate from the target category. The original model is an image classification model containing fully connected layers. Based on the differences in neuronal activation features of the fully connected layers of the original model during the inference process between the original image and the dynamic baseline image of the target forgetting category, several key neurons sensitive to the features of the target forgetting category are identified. Based on the forgetting objective, the corresponding preset forgetting measures are invoked to process the key neurons, and the processed original model is used as the forgetting model to achieve the forgetting objective. The forgetting objective includes forgetting-like and random forgetting.

[0007] According to the selective forgetting method based on neuronal activation features provided by the present invention, the step of generating a dynamic baseline image of the target forgetting category based on a unified baseline method specifically includes: The original model is trained using gradient ascent with the goal of weakening the original model's memory of the target forgetting category, resulting in a preliminary forgetting model; Initialize a perturbation tensor of the same dimension as the original image of the target forgetting category. With the optimization objective of minimizing the predicted distribution of the baseline image by the original model and the predicted distribution of the original image by the preliminary forgetting model, the perturbation tensor is iteratively updated by the gradient descent algorithm. The baseline image is obtained by superimposing the perturbation tensor on the original image. When the optimization objective meets the convergence condition, the original image is superimposed with the updated perturbation tensor to obtain the dynamic baseline image.

[0008] According to the present invention, a model-selective forgetting method based on neuron activation features, the step of optimizing the distribution of the original model's prediction of the baseline image to be close to the distribution of the initial forgetting model's prediction of the original image specifically includes: The original image of the target forgetting category is input into the preliminary forgetting model to obtain the first predicted probability distribution of the original image by the preliminary forgetting model; The baseline image is input into the original model to obtain the second predicted probability distribution of the baseline image by the original model. The optimizer minimizes the KL divergence loss of the first and second prediction probabilities while constraining the L2 norm of the perturbation tensor to be less than a preset threshold.

[0009] According to the present invention, a model-selective forgetting method based on neuronal activation features is provided. When the forgetting target is a type of forgetting, all original images of the target forgetting category and dynamic baseline images are used as inputs to the original model to filter and obtain the key neurons. The preset forgetting measures include: clearing the weight parameters and bias parameters of the key neurons to zero, and then fine-tuning and updating other parameters of the model.

[0010] According to the present invention, a model-selective forgetting method based on neuronal activation features is provided. When the forgetting target is random forgetting, the key neurons are obtained by filtering all images to be forgotten and dynamic baseline images as inputs to the original model. The preset forgetting measures include: freezing the parameters of the key neurons and then fine-tuning and updating other parameters of the model.

[0011] According to the present invention, a model-selective forgetting method based on neuronal activation features, after the step of invoking a corresponding preset forgetting measure to process the key neuron based on the forgetting target, further includes: The original model after processing key neurons using a preset forgetting measure was fine-tuned using the retained dataset, and the fine-tuned model was used as the forgetting model. The retained dataset is a sample dataset that needs to maintain recognition performance.

[0012] This invention also provides a model-selective forgetting system based on neuronal activation features, comprising: The generation module is used to generate dynamic baseline images for the target forgotten category based on a unified baseline method. These dynamic baseline images represent images whose features are similar to the original images of the target forgotten category but allow the original model to predict images that deviate from the target category. The original model is an image classification model containing fully connected layers. The identification module is used to identify several key neurons that are sensitive to the characteristics of the target forgetting category based on the differences in neuronal activation features of the fully connected layer of the original model during the reasoning process between the original image of the target forgetting category and the dynamic baseline image. The forgetting module is used to call the corresponding preset forgetting measures to process the key neurons based on the forgetting target, and obtain the processed original model as the forgetting model to achieve the forgetting target. The forgetting target includes forgetting-like and random forgetting.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the model-selective forgetting method based on neuronal activation features as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the model-selective forgetting method based on neuronal activation features as described above.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the model-selective forgetting method based on neuronal activation features as described above.

[0016] The model selective forgetting method based on neuronal activation features provided by this invention generates dynamic baseline images by fusing a unified baseline algorithm, constructs a comparison system of activation differences between the original image and the dynamic baseline image, and screens out key neurons, effectively avoiding the random errors caused by a single image. Furthermore, the baseline perturbation amplifies the activation features of neurons associated with the target forgetting category, greatly improving the accuracy of key neuron localization. Ultimately, this achieves a model forgetting method with high accuracy, high efficiency, high performance retention, and high interpretability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is one of the flowcharts illustrating the selective forgetting method based on neuronal activation features provided by this invention; Figure 2 This is a schematic diagram of the structure of the model-based selective forgetting system based on neuronal activation features provided by the present invention; Figure 3 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0020] The following is combined Figure 1 This invention introduces a model-based selective forgetting method based on neuronal activation features, such as... Figure 1 As shown, it includes: Step 101: Generate a dynamic baseline image for the target forgotten category based on the unified baseline method. The dynamic baseline image represents an image whose features are similar to those of the original image for the target forgotten category, but which enables the original model to predict images that deviate from the target category. The original model is an image classification model containing fully connected layers. This invention is applied to the field of model forgetting in image classification models, and is used to achieve class forgetting of images of a specified category or random forgetting of several specific images in a specified category.

[0021] Understandably, the target forgotten image is determined based on the forgetting target. For example, if it is necessary to achieve the model forgetting of a specific category by the original model, all or a preset proportion of images of this category in the original training set can be determined as the original images of the target forgotten category, and the corresponding dynamic baseline image can be generated by the unified baseline method in order to characterize the common features of this type of image.

[0022] If it is necessary to achieve the model forgetting of multiple random images in a certain category by the original model, that is, the original model needs to retain the recognition performance of other images in this category after forgetting the target forgotten image, then the multiple images to be forgotten can be determined as the original images of the target forgotten category, and multiple dynamic baseline images corresponding to them can be generated one by one.

[0023] Among them, the dynamic baseline image represents an image that is inferior in feature representation to the original image of the target forgotten category, but can cause the original model to predict a deviation from the category of "goldfish". In layman's terms, if the model is to forget its ability to recognize the category of "goldfish", then a pseudo goldfish image that looks similar to a goldfish but will not be recognized as a "goldfish" by the original model is generated based on the goldfish image.

[0024] Step 102: Based on the differences in neuronal activation features of the fully connected layer of the original model during the inference process between the original image of the target forgetting category and the dynamic baseline image, determine several key neurons that are sensitive to the features of the target forgetting category. After obtaining the dynamic baseline image, the key neurons sensitive to the target forgetting category can be accurately located by using the differences in neuronal activation features between the original image and the dynamic baseline image during the process of identifying the target forgetting category by the original model.

[0025] Optionally, neuron activation features can be neuron activation values, or neuron activation values ​​and activation counts.

[0026] In one feasible implementation, a neuron activation value monitoring mechanism is set up in the fully connected layer of the original model to record the activation value of each neuron in that layer in real time during the model inference process. Then, the original image of the target forgotten category and the corresponding generated dynamic baseline image are input into the original model, and the neuron activation values ​​corresponding to the two sets of images are collected through the set monitoring mechanism.

[0027] Optionally, a feature capture function can be written as a neuron activation value monitoring mechanism.

[0028] Optionally, the activation threshold is an empirical value, which is set to 0.5 in this embodiment.

[0029] Based on this, the absolute value of the difference in activation values ​​between the original image and the corresponding baseline image on the same neuron is calculated and defined as the activation difference. At the same time, the number of times each neuron is activated in all groups of samples is counted, that is, how many groups of samples each neuron is in an activated state during the inference process.

[0030] Finally, key neurons were selected based on activation differences and / or activation counts.

[0031] For example, the top-K neurons with the greatest activation differences are identified as key neurons.

[0032] For example, calculate the linearly weighted total score of activation difference and activation count for each neuron, and select the top-K neurons with the highest total scores as key neurons.

[0033] For example, K neurons with large activation differences and K neurons with high activation counts can be selected by sorting activation differences from largest to smallest and activation counts from highest to lowest, and then the intersection of these two neurons can be taken as the key neurons.

[0034] In this embodiment, the top-K neurons with the most activations and the greatest activation differences are selected as key neurons. The key neurons selected in the above manner are also the core carriers for the model to identify the target forgetting category. That is, the activation state of the key neurons is highly sensitive to the target forgetting category characteristics.

[0035] By using the above method, key neurons that are highly sensitive to the target forgotten category features are obtained by screening the differences in neuron activation features between the dynamic baseline map and the original image based on the original model. On the one hand, model forgetting can be achieved by processing only key neurons, thereby maximizing the retention of the model's ability to recognize other categories and improving the model's retention performance. On the other hand, the method of locating key neurons through the dynamic baseline map effectively improves the efficiency and accuracy of key neuron localization compared to the existing method of evaluating the importance of each neuron to the forgotten sample by masking neurons one by one. It is particularly suitable for original models with a large number of parameters.

[0036] Furthermore, this invention generates a dynamic baseline map to screen key neurons, and then processes these key neurons to achieve model forgetting. Compared with existing result-oriented model forgetting methods, this invention constructs an interpretable and verifiable forgetting process, improving the credibility and controllability of the forgetting task.

[0037] Step 103: Based on the forgetting target, call the corresponding preset forgetting measures to process the key neurons, and obtain the processed original model as the forgetting model to achieve the forgetting target, wherein the forgetting target includes forgetting-like and random forgetting.

[0038] After locating the key neurons, different preset forgetting measures can be taken to achieve model forgetting depending on the forgetting target.

[0039] For example, when performing forgetting, the parameters of key neurons can be adjusted directly, thereby cutting off the model's recognition path for the target forgotten category features. As another example, when performing random forgetting, some key neurons can be frozen and other neurons adjusted, so that the model can forget the memory related to random samples without affecting its recognition performance for other categories of data.

[0040] Pre-defined forgetting measures can be based on the forgetting target.

[0041] This invention generates dynamic baseline images by fusing a unified baseline algorithm, constructs an activation difference comparison system between the original image and the dynamic baseline image, and selects key neurons. This effectively avoids the random errors caused by a single image. Furthermore, by perturbating the baseline, it amplifies the activation features of neurons associated with the target forgetting category, significantly improving the accuracy of key neuron localization. Ultimately, this invention achieves a model forgetting method with high accuracy, high efficiency, high performance retention, and high interpretability.

[0042] In the model-selective forgetting method based on neuronal activation features of this invention, the step of generating a dynamic baseline image of the target forgetting category based on a unified baseline method specifically includes: The original model is trained using gradient ascent with the goal of weakening the original model's memory of the target forgetting category, resulting in a preliminary forgetting model; Specifically, the parameters of the convolutional layers of the original model are frozen, and only the fully connected layers of the original model are trained. Gradient ascent training is performed using the inverse gradient signal of the target forgotten category samples to obtain a preliminary forgotten model. This preliminary model weakens the targeted recognition of the target forgotten category, but retains the original recognition ability in other categories, and is used as the target reference for unified baseline optimization.

[0043] Among them, the target forgetting category sample can be any image belonging to the target forgetting category.

[0044] Initialize a perturbation tensor of the same dimension as the original image of the target forgetting category. With the optimization objective of minimizing the predicted distribution of the baseline image by the original model and the predicted distribution of the original image by the preliminary forgetting model, the perturbation tensor is iteratively updated by the gradient descent algorithm. The baseline image is obtained by superimposing the perturbation tensor on the original image. When the optimization objective meets the convergence condition, the original image is superimposed with the updated perturbation tensor to obtain the dynamic baseline image.

[0045] Initialize a perturbation tensor of the same dimension as the original image, where the initial values ​​follow a normal distribution N(0,0.01).

[0046] Then, the original image is input into the preliminary forgetting model to obtain the predicted distribution of the original image by the preliminary forgetting model; the original image and the baseline image superimposed with the perturbation tensor are input into the original model to obtain the predicted distribution of the baseline image by the original model; gradient descent training is performed with the optimization objective of minimizing the difference between the above two distributions, that is, to make the prediction result of the original model on the baseline image as close as possible to the prediction result of the preliminary forgetting model on the original image.

[0047] Alternatively, the difference between two predicted distributions can be defined using cross-entropy loss, with minimizing the cross-entropy loss as the optimization objective; alternatively, the difference between two predicted distributions can be defined using JS divergence or other metrics that can quantify the direct difference between probability distributions. The choice of specific metrics can be made by weighing the computational efficiency and convergence characteristics of the actual task.

[0048] The perturbation tensor is updated by training with gradient descent. When the optimization objective meets the convergence condition, that is, when the baseline image generated by superimposing the perturbation tensor of the current round on the original image has image features similar to the original sample, it can also make the original model's prediction result deviate from the target category.

[0049] By using the above method, the dynamic baseline image corresponding to the original image of the target forgotten category can be obtained.

[0050] In the model-selective forgetting method based on neuronal activation features of this invention, the step of optimizing the distribution of the original model's prediction of the baseline image to be close to the distribution of the preliminary forgetting model's prediction of the original image specifically includes: The original image of the target forgetting category is input into the preliminary forgetting model to obtain the first predicted probability distribution of the original image by the preliminary forgetting model; The baseline image is input into the original model to obtain the second predicted probability distribution of the baseline image by the original model. The optimizer minimizes the KL divergence loss of the first and second prediction probabilities while constraining the L2 norm of the perturbation tensor to be less than a preset threshold.

[0051] In this implementation, the optimization objective is set as minimizing the KL loss function: ; In the formula, This represents the first predicted probability distribution. This represents the second predicted probability distribution.

[0052] Specifically, the Adam optimizer is used for optimization, while the L2 norm of the perturbation tensor is constrained to be less than a preset threshold. In this embodiment, the preset threshold is 0.25, and finally the dynamic baseline map of each original image is obtained.

[0053] This implementation constrains the magnitude of the perturbation tensor by using the L2 norm. While ensuring that the generated dynamic baseline image is highly similar to the original image in visual semantics, it guides the behavior of the original model to shift toward the target forgetting state, thereby obtaining a dynamic baseline image that can effectively induce behavioral deviation in the original model and has high visual fidelity.

[0054] In the model-selective forgetting method based on neuronal activation features of the present invention, when the forgetting target is a type of forgetting, all original images of the target forgetting category and dynamic baseline images are used as inputs to the original model to filter and obtain the key neurons; The preset forgetting measures include: clearing the weight parameters and bias parameters of the key neurons to zero, and then fine-tuning and updating other parameters of the model.

[0055] This embodiment proposes a preset forgetting mechanism to achieve forgetting-like behavior.

[0056] When implementing class forgetting, a dynamic baseline image of all original images of the target forgetting category is generated, and all original images and their corresponding dynamic baseline images are used as inputs when selecting key neurons, so that the selected key neurons can represent the core carriers of the model to identify this target forgetting category.

[0057] Building upon this, in model evaluation mode, gradient calculation is masked using the `torch.no_grad()` function to avoid unnecessary gradient updates during parameter tuning. Then, the weights and biases of the selected key neurons are all reset to zero, thus cutting off the model's path to target category features. After zeroing the parameters, stochastic gradient descent is used to update other relevant model parameters, further enhancing the forgetting effect, in conjunction with the labeled key neurons.

[0058] The update process does not use data containing images of the target forgotten category.

[0059] This invention employs a minimalist suppression method that resets key neuron parameters to zero, modifying parameters only for key neurons in dynamic baseline map-assisted localization. This eliminates the need to retrain the entire model or fine-tune all layer parameters. While ensuring thorough forgetting of the target class, it minimizes the impact on the performance of the retained class recognition, overcoming the core defects of "incomplete forgetting" and "large loss of retained classes" in existing technologies. At the same time, it retains the flexible forgetting mode for fine-tuning other parameters.

[0060] In the model-selective forgetting method based on neuronal activation features of the present invention, when the forgetting target is random forgetting, all images to be forgotten and dynamic baseline images are used as inputs to the original model to filter and obtain the key neurons; The preset forgetting measures include: freezing the parameters of the key neurons and then fine-tuning and updating other parameters of the model.

[0061] This embodiment proposes a preset forgetting method to achieve random forgetting.

[0062] When implementing random forgetting, only the dynamic baseline map of the image to be forgotten is generated, and all the images to be forgotten and their dynamic baseline maps are used as inputs to select key neurons, so that the selected key neurons can represent the core of the original model to which the randomly forgotten image belongs to the target forgetting category.

[0063] Optionally, during random forgetting, the number of key neurons selected is less than the number selected during implementation-class forgetting.

[0064] When implementing random forgetting, the parameters of the key neurons selected through screening are frozen, and perturbation is performed only on other parameters related to all images to be forgotten. Simultaneously, key parameters such as perturbation amplitude and perturbation ratio are set through parameterized configuration to achieve controllability of random forgetting, ensuring that the model's recognition performance for other categories of data is not affected while forgetting memories related to random samples.

[0065] This invention limits the parameter perturbation of random forgetting to the range of non-target neurons by excluding the directional perturbation range of key neurons selected based on dynamic baseline maps. At the same time, through the configurable design of parameters such as perturbation amplitude and perturbation ratio, the random forgetting process is precisely controllable, further expanding the applicable scenarios of the method.

[0066] In the model-selective forgetting method based on neuronal activation features of the present invention, after the step of invoking a corresponding preset forgetting measure to process the key neuron based on the forgetting target, it further includes: The original model after processing key neurons using a preset forgetting measure was fine-tuned using the retained dataset, and the fine-tuned model was used as the forgetting model. The retained dataset is a sample dataset that needs to maintain recognition performance.

[0067] After adjusting the parameters of the key neurons selected using a preset forgetting mechanism, the model is further fine-tuned using the retained dataset to optimize the model parameters, compensate for the minor performance fluctuations that may occur during the parameter adjustment process, and obtain the final forgetting model.

[0068] To verify the effectiveness of the above-mentioned model forgetting method, this invention uses the ResNet50 convolutional neural network model as the original model, adopts the ImageNet-Mini dataset, and sets up a training environment. The dataset is divided into a target forgetting dataset, a retention dataset, and a test dataset. The target forgetting dataset contains sample data of the category to be forgotten, the retention dataset contains sample data of other categories that need to maintain recognition performance, and the test dataset is used to evaluate the overall performance of the model after forgetting.

[0069] The dataset contains 1000 categories, with 500 training images and 100 validation images for each category. During the validation process, 50 images of the goldfish category are selected as the original images for the target forgotten category, 50 images of each of the other 100 categories are randomly selected as the retained dataset, and the remaining images are used as the test dataset.

[0070] Preprocess all images: resize the images to 224×224, normalize the pixel values ​​(mean [0.485, 456, 0.406], standard deviation [0.229, 0.224, 0.225]), and convert them to PyTorch tensor format.

[0071] The ResNet50 convolutional neural network model includes structures such as convolutional layers, pooling layers, and fully connected layers. The fully connected layers contain 1,000 neurons, corresponding to the 1,000 categories in the ImageNet dataset.

[0072] After implementing class forgetting using the above method, the performance of the final forgetting model was tested on the forgotten dataset, the retained dataset, and the test dataset. The evaluation metrics included forgotten class accuracy (At), retained class accuracy (Ag), and forgetting completeness (Fr), etc., to comprehensively verify the forgetting effect of the model and the impact of forgetting on the performance of retained class recognition. The model was also compared with existing mainstream methods. The experimental results are shown in Table 1 below: Table 1

[0073] The Uni neuron perturbation is the model forgetting method of this invention. It can be seen that, in terms of the above three indicators, the selective forgetting model based on neuron activation characteristics provided by this invention has the best or better performance.

[0074] This invention generates dynamic baseline images using the UNI algorithm, accurately locating key neurons by combining activation value differences and activation counts as dual indicators. Then, it simplifies the process by zeroing out parameters, cutting off the model's recognition path for target category features. This eliminates the need for full retraining, significantly improving forgetting efficiency while ensuring thorough forgetting. Experimental data shows that in forgetting tests on the ImageNet-Mini dataset, this invention achieves a forgetting accuracy (At) of 0.00 and a forgetting completeness (Fr) of 1.00, comparable to existing excellent methods such as retraining and boundary expansion, and with significantly higher implementation efficiency than retraining methods.

[0075] Meanwhile, this invention modifies parameters only for key neurons, avoiding large-scale adjustments to other parts of the model and preserving the model's ability to recognize non-target categories to the greatest extent. Furthermore, through activation feature acquisition and analysis, it clearly identifies the neuron groups that play the greatest role in classifying each category, revealing the core mechanism of the model's target category recognition and the logic of parameter changes within the model during the forgetting process. This provides a new perspective on the model's working principle and offers solid theoretical and practical support for the subsequent optimization and improvement of model forgetting techniques. It possesses high interpretability and is particularly suitable for the field of model forgetting.

[0076] Furthermore, this invention supports both specified category forgetting and random sample forgetting modes. Random forgetting is controllable through the setting of directional perturbation range and parameterized configuration, which can meet different forgetting needs in various scenarios such as data compliance, privacy protection, and business adjustment. Its applicable scope covers multiple deep learning task fields such as image classification and face recognition.

[0077] The selective forgetting system based on neuronal activation features provided by this invention will be described below. The selective forgetting system based on neuronal activation features described below can be referred to in correspondence with the selective forgetting method based on neuronal activation features described above.

[0078] like Figure 2 As shown, the model-selective forgetting system based on neuronal activation features of the present invention includes a generation module 201, a recognition module 202, and a forgetting module 203; Generation module 201 is used to generate a dynamic baseline image of the target forgotten category based on a unified baseline method. The dynamic baseline image represents an image whose features are similar to those of the original image of the target forgotten category, but which enables the original model to predict an image that deviates from the target category. The original model is an image classification model containing fully connected layers. This invention is applied to the field of model forgetting in image classification models, and is used to achieve class forgetting of images of a specified category or random forgetting of several specific images in a specified category.

[0079] Understandably, the target forgotten image is determined based on the forgetting target. For example, if it is necessary to achieve the model forgetting of a specific category by the original model, all or a preset proportion of images of this category in the original training set can be determined as the original images of the target forgotten category, and the corresponding dynamic baseline image can be generated by the unified baseline method in order to characterize the common features of this type of image.

[0080] If it is necessary to achieve the model forgetting of multiple random images in a certain category by the original model, that is, the original model needs to retain the recognition performance of other images in this category after forgetting the target forgotten image, then the multiple images to be forgotten can be determined as the original images of the target forgotten category, and multiple dynamic baseline images corresponding to them can be generated one by one.

[0081] Among them, the dynamic baseline image represents an image that is inferior in feature representation to the original image of the target forgotten category, but can cause the original model to predict a deviation from the category of "goldfish". In layman's terms, if the model is to forget its ability to recognize the category of "goldfish", then a pseudo goldfish image that looks similar to a goldfish but will not be recognized as a "goldfish" by the original model is generated based on the goldfish image.

[0082] The identification module 202 is used to identify several key neurons that are sensitive to the characteristics of the target forgetting category based on the differences in neuronal activation features of the fully connected layer of the original model during the reasoning process between the original image of the target forgetting category and the dynamic baseline image. After obtaining the dynamic baseline image, the key neurons sensitive to the target forgetting category can be accurately located by using the differences in neuronal activation features between the original image and the dynamic baseline image during the process of identifying the target forgetting category by the original model.

[0083] Optionally, neuron activation features can be neuron activation values, or neuron activation values ​​and activation counts.

[0084] In one feasible implementation, a neuron activation value monitoring mechanism is set up in the fully connected layer of the original model to record the activation value of each neuron in that layer in real time during the model inference process. Then, the original image of the target forgotten category and the corresponding generated dynamic baseline image are input into the original model, and the neuron activation values ​​corresponding to the two sets of images are collected through the set monitoring mechanism.

[0085] Optionally, a feature capture function can be written as a neuron activation value monitoring mechanism.

[0086] Optionally, the activation threshold is an empirical value, which is set to 0.5 in this embodiment.

[0087] Based on this, the absolute value of the difference in activation values ​​between the original image and the corresponding baseline image on the same neuron is calculated and defined as the activation difference. At the same time, the number of times each neuron is activated in all groups of samples is counted, that is, how many groups of samples each neuron is in an activated state during the inference process.

[0088] Finally, key neurons were selected based on activation differences and / or activation counts.

[0089] For example, the top-K neurons with the greatest activation differences are identified as key neurons.

[0090] For example, calculate the linearly weighted total score of activation difference and activation count for each neuron, and select the top-K neurons with the highest total scores as key neurons.

[0091] For example, K neurons with large activation differences and K neurons with high activation counts can be selected by sorting activation differences from largest to smallest and activation counts from highest to lowest, and then the intersection of these two neurons can be taken as the key neurons.

[0092] In this embodiment, the top-K neurons with the most activations and the greatest activation differences are selected as key neurons. The key neurons selected in the above manner are also the core carriers for the model to identify the target forgetting category. That is, the activation state of the key neurons is highly sensitive to the target forgetting category characteristics.

[0093] By using the above method, key neurons that are highly sensitive to the target forgotten category features are obtained by screening the differences in neuron activation features between the dynamic baseline map and the original image based on the original model. On the one hand, model forgetting can be achieved by processing only key neurons, thereby maximizing the retention of the model's ability to recognize other categories and improving the model's retention performance. On the other hand, the method of locating key neurons through the dynamic baseline map effectively improves the efficiency and accuracy of key neuron localization compared to the existing method of evaluating the importance of each neuron to the forgotten sample by masking neurons one by one. It is particularly suitable for original models with a large number of parameters.

[0094] Furthermore, this invention generates a dynamic baseline map to screen key neurons, and then processes these key neurons to achieve model forgetting. Compared with existing result-oriented model forgetting methods, this invention constructs an interpretable and verifiable forgetting process, improving the credibility and controllability of the forgetting task.

[0095] The forgetting module 203 is used to call the corresponding preset forgetting measures to process the key neurons based on the forgetting target, and obtain the processed original model as the forgetting model to achieve the forgetting target. The forgetting target includes forgetting-like and random forgetting.

[0096] After locating the key neurons, different preset forgetting measures can be taken to achieve model forgetting depending on the forgetting target.

[0097] For example, when performing forgetting by category, the parameters of key neurons can be directly adjusted to cut off the model's recognition path for the target forgotten category features; or, when performing random forgetting, some key neurons can be frozen and other neurons adjusted so that the model can forget the memory related to random samples without affecting its recognition performance for other categories of data.

[0098] Pre-defined forgetting measures can be based on the forgetting target.

[0099] This invention generates dynamic baseline images by fusing a unified baseline algorithm, constructs an activation difference comparison system between the original image and the dynamic baseline image, and selects key neurons. This effectively avoids the random errors caused by a single image. Furthermore, by perturbating the baseline, it amplifies the activation features of neurons associated with the target forgetting category, significantly improving the accuracy of key neuron localization. Ultimately, this invention achieves a model forgetting method with high accuracy, high efficiency, high performance retention, and high interpretability.

[0100] Figure 3 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 3 As shown, the electronic device may include a processor 310, a communication interface 320, a memory 330, and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340. The processor 310 can call logical instructions in the memory 330 to execute a model-selective forgetting method based on neuron activation features. This method includes: generating a dynamic baseline image of the target forgetting category based on a unified baseline method, wherein the dynamic baseline image represents an image whose features are similar to the original image of the target forgetting category but which causes the original model to predict an image that deviates from the target category, wherein the original model is an image classification model containing fully connected layers; determining several key neurons sensitive to the features of the target forgetting category based on the differences in neuron activation features of the fully connected layers of the original model during inference between the original image of the target forgetting category and the dynamic baseline image; and processing the key neurons by calling corresponding preset forgetting measures based on the forgetting target to obtain a processed original model as a forgetting model for achieving the forgetting target, wherein the forgetting target includes class forgetting and random forgetting.

[0101] Furthermore, the logical instructions in the aforementioned memory 330 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, essentially, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0102] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the model-selective forgetting method based on neuron activation features provided by the above methods. The method includes: generating a dynamic baseline image of the target forgetting category based on a unified baseline method, wherein the dynamic baseline image represents an image that is similar to the original image features of the target forgetting category but can cause the original model to predict an image that deviates from the target category, wherein the original model is an image classification model containing fully connected layers; determining a number of key neurons sensitive to the features of the target forgetting category based on the differences in neuron activation features of the fully connected layers of the original model during the inference process between the original image of the target forgetting category and the dynamic baseline image; and calling corresponding preset forgetting measures to process the key neurons based on the forgetting target to obtain the processed original model as a forgetting model for achieving the forgetting target, wherein the forgetting target includes class forgetting and random forgetting.

[0103] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements a model-selective forgetting method based on neuron activation features provided by the above methods. This method includes: generating a dynamic baseline image of a target forgetting category based on a unified baseline method, wherein the dynamic baseline image represents an image whose features are similar to those of the original image of the target forgetting category but which causes the original model to predict an image deviating from the target category, wherein the original model is an image classification model containing fully connected layers; determining several key neurons sensitive to the features of the target forgetting category based on the differences in neuron activation features of the fully connected layers of the original model during inference between the original image of the target forgetting category and the dynamic baseline image; and processing the key neurons by invoking corresponding preset forgetting measures based on the forgetting target to obtain a processed original model as a forgetting model for achieving the forgetting target, wherein the forgetting target includes class forgetting and random forgetting.

[0104] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0106] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A model selective forgetting method based on neuron activation features, characterized in that, include: A dynamic baseline image for the target forgotten category is generated based on a unified baseline method. This dynamic baseline image represents an image whose features are similar to the original image of the target forgotten category, but allows the original model to predict images that deviate from the target category. The original model is an image classification model containing fully connected layers. Based on the differences in neuronal activation features of the fully connected layers of the original model during the inference process between the original image and the dynamic baseline image of the target forgetting category, several key neurons sensitive to the features of the target forgetting category are identified. Based on the forgetting objective, the corresponding preset forgetting measures are invoked to process the key neurons, and the processed original model is used as the forgetting model to achieve the forgetting objective. The forgetting objective includes forgetting-like and random forgetting. 2.The model selective forgetting method based on neuron activation features according to claim 1, characterized in that, The step of generating a dynamic baseline image of the target forgotten category based on the unified baseline method specifically includes: The original model is trained using gradient ascent with the goal of weakening the original model's memory of the target forgetting category, resulting in a preliminary forgetting model; Initialize a perturbation tensor of the same dimension as the original image of the target forgetting category. With the optimization objective of minimizing the predicted distribution of the baseline image by the original model and the predicted distribution of the original image by the preliminary forgetting model, the perturbation tensor is iteratively updated by the gradient descent algorithm. The baseline image is obtained by superimposing the perturbation tensor on the original image. When the optimization objective meets the convergence condition, the original image is superimposed with the updated perturbation tensor to obtain the dynamic baseline image. 3.The model selective forgetting method based on neuron activation features according to claim 2, characterized in that, The step of optimizing the distribution of the baseline image predicted by the original model to be close to the distribution of the original image predicted by the preliminary forgetting model specifically includes: The original image of the target forgetting category is input into the preliminary forgetting model to obtain the first predicted probability distribution of the original image by the preliminary forgetting model; The baseline image is input into the original model to obtain the second predicted probability distribution of the baseline image by the original model. The optimizer minimizes the KL divergence loss of the first and second prediction probabilities while constraining the L2 norm of the perturbation tensor to be less than a preset threshold. 4.The model selective forgetting method based on neuron activation features according to claim 1, characterized in that, When the forgetting target is forgetting-like, the key neurons are obtained by filtering all the original images of the target forgetting category and the dynamic baseline images as input to the original model. The preset forgetting measures include: clearing the weight parameters and bias parameters of the key neurons to zero, and then fine-tuning and updating other parameters of the model. 5.The model selective forgetting method based on neuron activation features according to claim 1, characterized in that, When the forgetting target is random forgetting, the key neurons are obtained by filtering all images to be forgotten and dynamic baseline images as inputs to the original model. The preset forgetting measures include: freezing the parameters of the key neurons and then fine-tuning and updating other parameters of the model. 6.The model selective forgetting method based on neuron activation features according to claim 1, characterized in that, After the step of invoking the corresponding preset forgetting measures to process the key neuron based on the forgetting target, the method further includes: The original model after processing key neurons using a preset forgetting measure was fine-tuned using the retained dataset, and the fine-tuned model was used as the forgetting model. The retained dataset is a sample dataset that needs to maintain recognition performance.

7. A model selective forgetting system based on neuron activation features, characterized in that, include: The generation module is used to generate dynamic baseline images for the target forgotten category based on a unified baseline method. These dynamic baseline images represent images whose features are similar to the original images of the target forgotten category but allow the original model to predict images that deviate from the target category. The original model is an image classification model containing fully connected layers. The identification module is used to identify several key neurons that are sensitive to the characteristics of the target forgetting category based on the differences in neuronal activation features of the fully connected layer of the original model during the reasoning process between the original image of the target forgetting category and the dynamic baseline image. The forgetting module is used to call the corresponding preset forgetting measures to process the key neurons based on the forgetting target, and obtain the processed original model as the forgetting model to achieve the forgetting target. The forgetting target includes forgetting-like and random forgetting.

8. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the model-selective forgetting method based on neuronal activation features as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the model-selective forgetting method based on neuronal activation features as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the model-selective forgetting method based on neuronal activation features as described in any one of claims 1 to 6.