Medical sample data machine forgetting method and related device
By constructing frozen teacher and student models, and combining loss calculation and gradient coordination of forgotten and retained sample data, the problem of difficult removal of target patient traces in medical audio models is solved, and effective maintenance of patient-level machine forgetting and recognition performance is achieved.
Patent Information
- Application Number
- CN202611283392.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-24
- Publication Date
- 2026-11-03
AI Technical Summary
In existing technologies, medical audio models have difficulty completely removing traces of the target patient after a user data deletion request, and the approximate forgetting method is prone to disrupting the discrimination boundary of non-target patients, resulting in a loss of privacy sensitivity and recognition performance.
By constructing a frozen teacher model and a student model to be updated, the first branch loss is calculated using forgotten sample data. The second branch loss is constructed by combining the retained sample data with knowledge distillation. The gradient is then corrected using a gradient coordination algorithm to update the model parameters, thereby achieving the forgetting of target medical samples while maintaining the recognition performance of non-target samples.
It effectively weakens the relevant memory of the target medical samples, maintains the recognition performance of non-target medical samples, achieves patient-level machine forgetting, and avoids the overall decline in model performance.
Smart Images

Figure CN123030906A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning technology, and in particular to a machine forgetting method and related equipment for medical sample data. Background Technology
[0002] With the widespread application of deep learning technology in audio perception tasks, audio models have been gradually used in practical scenarios such as medical and health monitoring, voice interaction, emotion recognition, and environmental perception. Compared with image or structured data, audio signals usually contain richer individual-related information, such as speaking style, breathing rhythm, snoring characteristics, differences in acquisition devices, environmental background, and long-term physiological state. In medical and health scenarios, audio data may also be associated with disease screening, sleep status assessment, and individual health risk analysis, thus having high privacy sensitivity. When a user or patient requests data deletion, simply deleting the original audio samples from the database does not guarantee that the trained model will no longer retain its influence; discriminative features related to the target individual may still remain in the model parameters. Accordingly, machine forgetting can weaken or remove the influence of specific training data on the model without complete retraining. However, in related technologies, the target patient usually contains multiple historical audio segments; weakening the influence of only a single sample on the model is insufficient to fully remove the overall trace of the target patient in the model. Meanwhile, many approximate forgetting methods, while computationally efficient, tend to push the target sample away from the reasonable data manifold and may disrupt the discrimination boundary for preserving patients.
[0003] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0004] The main objective of this application is to propose a machine forgetting method and related equipment for medical sample data, which can effectively weaken the memory related to the target medical sample while effectively maintaining the recognition performance of non-target medical samples.
[0005] To achieve the above objectives, one aspect of this application proposes a method for machine forgetting of medical sample data, the method comprising: Based on the original medical sample identification model, a frozen teacher model and a student model to be updated were constructed respectively. Forgotten sample data is obtained by sampling from the medical sample forgetting dataset and input into the student model to be updated for prediction. Then, the first branch loss data is calculated based on the prediction results of the student model. Reserved sample data is obtained by sampling from the medical sample reserved dataset, and then input into the frozen teacher model and the student model to be updated respectively for knowledge distillation processing, thereby constructing the second branch loss data; Construct target loss data based on the first branch loss data and the second branch loss data; Gradient calculation is performed based on the target loss data, and gradient correction is performed using a preset gradient coordination algorithm to obtain the desired gradient data. The model parameters of the student model to be updated are updated based on the expected gradient data to obtain the target medical sample recognition model.
[0006] In some embodiments, the step of sampling forgotten sample data from a medical sample forgotten dataset and inputting it into the student model to be updated for prediction, and then calculating the first branch loss data based on the obtained student model prediction results, includes: The forgotten sample data is obtained by acquiring the forgotten medical sample dataset, and then the forgotten sample data is damaged to obtain perturbed sample data. The perturbation sample data is input into the student model to be updated for prediction, and the prediction result of the student model is obtained. The first branch loss data is calculated based on the student model prediction results combined with the uniform KL divergence loss constraint.
[0007] In some embodiments, the sampling of retained sample data from the medical sample retention dataset and the input of this data into the frozen teacher model and the student model to be updated, respectively, for knowledge distillation processing, thereby constructing the second branch loss data, includes: The retained sample data is obtained through the medical sample retention dataset; The retained sample data is input into the student model to be updated for prediction, and the first retained prediction result is obtained. The cross-entropy loss value is calculated based on the first retained prediction result and the cross-entropy loss. The retained sample data is input into the frozen teacher model for prediction to obtain the second retained prediction result; The first and second retention prediction results are subjected to temperature-based processing, and then the corresponding knowledge distillation loss values are calculated. The second branch loss data is constructed based on the cross-entropy loss value and the knowledge distillation loss value.
[0008] In some embodiments, constructing target loss data based on the first branch loss data and the second branch loss data includes: Construct parameter anchoring terms based on Fisher anchor constraints; The target loss data is constructed based on the first branch loss data, the second branch loss data, and the parameter anchoring term.
[0009] In some embodiments, the step of calculating gradients based on the target loss data and correcting gradients using a preset gradient reconciliation algorithm to obtain the desired gradient data includes: The gradient of the first branch is calculated based on the loss data of the first branch. The gradient of the second branch is calculated based on the loss data of the second branch. Based on the gradients of the first branch and the second branch, a projection conflict gradient coordination algorithm is used to perform projection correction to obtain corrected gradient data. The gradient of the parameter anchoring term is calculated, and then the desired gradient data is determined based on the obtained parameter anchoring gradient and the corrected gradient data.
[0010] In some embodiments, updating the model parameters of the student model to be updated based on the expected gradient data to obtain the target medical sample recognition model includes: The LoRA parameters of the student model to be updated are updated based on the expected gradient data to obtain an optimized model. Once it is determined that the optimization model satisfies the Retain-Floor constraint, the optimization model is stored in a preset model library to construct a candidate model library; The target medical sample identification model is selected from the candidate model library based on preset evaluation parameter values.
[0011] To achieve the above objectives, another aspect of this application provides a medical sample data machine forgetting device, the device comprising: The first module is used to construct a frozen teacher model and a student model to be updated based on the original medical sample identification model. The second module is used to sample forgotten sample data from the medical sample forgotten dataset and input it into the student model to be updated for prediction, and then calculate the first branch loss data based on the predicted results of the student model. The third module is used to sample retained sample data from the medical sample retained dataset and input it into the frozen teacher model and the student model to be updated respectively for knowledge distillation processing, thereby constructing the second branch loss data; The fourth module is used to construct target loss data based on the first branch loss data and the second branch loss data; The fifth module is used to perform gradient calculation based on the target loss data and perform gradient correction through a preset gradient coordination algorithm to obtain the desired gradient data. The sixth module is used to update the model parameters of the student model to be updated based on the expected gradient data, so as to obtain the target medical sample recognition model.
[0012] To achieve the above objectives, another aspect of this application provides an electronic device, the electronic device comprising: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor performs the method described above.
[0013] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0014] To achieve the above objectives, another aspect of the embodiments of this application provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method; The embodiments of this application include at least the following beneficial effects: This application provides a method, apparatus, electronic device, storage medium, and program product for machine forgetting of medical sample data. The scheme first constructs a frozen teacher model and a student model to be updated using the original medical sample recognition model. Then, the embodiments of this invention sample forgotten sample data from the medical sample forgotten dataset and inputs it into the student model to be updated for prediction, calculating the first branch loss data based on the predicted results of the student model. Next, the embodiments of this invention sample retained sample data from the medical sample retained dataset and inputs it into the frozen teacher model and the student model to be updated for knowledge distillation processing, thereby constructing the second branch loss data. Then, the embodiments of this invention construct target loss data based on the first branch loss data and the second branch loss data, perform gradient calculation based on the target loss data, and perform gradient correction processing through a preset gradient coordination algorithm, thereby updating the model parameters of the student model to be updated based on the obtained expected gradient data, obtaining the target medical sample recognition model, and realizing patient-level machine forgetting of medical sample data. It is easy to understand that, based on the original medical sample recognition model, the embodiments of the present invention construct a frozen teacher model and a student model to be updated respectively, and construct the first branch loss data through forgotten sample data to weaken the model's relevant memory of the target medical sample data, that is, to forget the target medical sample data. At the same time, through knowledge distillation, the recognition performance of non-target medical samples is maintained, and gradient correction is performed through a preset gradient coordination algorithm to alleviate the gradient conflict problem between the forgotten target and the repair target. Thus, while reducing the separability of the target medical sample data, the model's ability on non-target medical sample data is maintained. That is, it can weaken the relevant memory of the target medical sample and maintain the recognition performance of non-target medical samples. Attached Figure Description
[0015] Figure 1 This is a flowchart of the machine forgetting method for medical sample data provided in an embodiment of the present invention; Figure 2 This is a schematic diagram of the overall framework for machine forgetting of medical sample data provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the operation process for machine forgetting medical sample data provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the structure of the medical sample data machine forgetting device provided in an embodiment of the present invention; Figure 5 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0016] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of apparatuses and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0017] It is understood that the terms “first,” “second,” etc., used in this application may be used herein to describe various concepts, but unless otherwise stated, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another. For example, without departing from the scope of the embodiments of this application, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the words “if” or “when” as used herein may be interpreted as “when…” or “in response to determination.”
[0018] As used in this application, the terms "at least one", "multiple", "each", "any", etc., "at least one" includes one, two or more, "multiple" includes two or more, "each" refers to each of the corresponding multiples, and "any" refers to any one of the multiples.
[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0020] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0021] Machine forgetting refers to the process of selectively removing specific training data from a trained machine learning model. Its core objective is to protect data privacy while avoiding the need to retrain the model to handle each deletion request.
[0022] With the widespread application of deep learning technology in audio perception tasks, audio models have been gradually used in practical scenarios such as medical and health monitoring, voice interaction, emotion recognition, and environmental perception. Compared with image or structured data, audio signals usually contain richer individual-related information, such as speaking style, breathing rhythm, snoring characteristics, differences in acquisition devices, environmental background, and long-term physiological state. In medical and health scenarios, audio data may also be associated with disease screening, sleep status assessment, and individual health risk analysis, thus having high privacy sensitivity. When a user or patient requests data deletion, simply deleting the original audio samples from the database does not guarantee that the trained model will no longer retain its influence; discriminative features related to the target individual may still remain in the model parameters. Accordingly, machine forgetting can weaken or remove the influence of specific training data on the model without complete retraining. However, in related technologies, the target patient usually contains multiple historical audio segments; weakening the influence of only a single sample on the model is insufficient to fully remove the overall trace of the target patient in the model. Meanwhile, many approximate forgetting methods, while computationally efficient, tend to push the target sample away from the reasonable data manifold and may disrupt the discrimination boundary for preserving patients.
[0023] In view of this, this application provides a method, apparatus, electronic device, storage medium, and program product for machine forgetting of medical sample data. The solution first constructs a frozen teacher model and a student model to be updated using the original medical sample recognition model. Then, the embodiment samples forgotten sample data from the medical sample forgotten dataset and inputs it into the student model to be updated for prediction, calculating the first branch loss data based on the predicted results. Next, the embodiment samples retained sample data from the medical sample retained dataset and inputs it into both the frozen teacher model and the student model to be updated for knowledge distillation, thereby constructing the second branch loss data. Then, the embodiment constructs target loss data based on the first and second branch loss data, performs gradient calculation based on the target loss data, and performs gradient correction processing using a preset gradient coordination algorithm. Based on the obtained expected gradient data, the model parameters of the student model to be updated are updated to obtain the target medical sample recognition model. This achieves patient-level machine forgetting of medical sample data, effectively weakening the memory related to target medical samples while effectively maintaining the recognition performance of non-target medical samples.
[0024] The machine forgetting method for medical sample data provided in this application relates to the field of deep learning technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the machine forgetting method for medical sample data, but is not limited to the above forms.
[0025] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0026] It should be noted that in all specific embodiments of this application, when processing data related to user identity or characteristics, such as user information, user behavior data, user historical data, and user location information, user permission or consent is obtained first. Furthermore, the collection, use, and processing of this data comply with relevant laws, regulations, and standards. In addition, when embodiments of this application require access to sensitive personal information of users, separate permission or consent from the user is obtained through pop-ups or redirection to confirmation pages. Only after obtaining the user's separate permission or consent is the necessary user-related data required for the proper functioning of these embodiments acquired.
[0027] Figure 1 This is an optional flowchart of the machine forgetting method for medical sample data provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S110 to S160.
[0028] Step S110: Construct a frozen teacher model and a student model to be updated based on the original medical sample identification model.
[0029] Step S120: Sample forgotten sample data from the medical sample forgotten dataset and input it into the student model to be updated for prediction. Then, calculate the first branch loss data based on the predicted results of the student model.
[0030] Step S130: Sample retained sample data from the medical sample retained dataset and input them into the frozen teacher model and the student model to be updated respectively for knowledge distillation processing, thereby constructing the second branch loss data.
[0031] Step S140: Construct target loss data based on the first branch loss data and the second branch loss data.
[0032] Step S150: Calculate the gradient based on the target loss data, and correct the gradient using a preset gradient coordination algorithm to obtain the desired gradient data.
[0033] Step S160: Update the model parameters of the student model to be updated based on the expected gradient data to obtain the target medical sample recognition model.
[0034] In this specific embodiment, the present invention first constructs a frozen teacher model and a student model to be updated based on the original medical sample identification model. Specifically, in this embodiment, the original medical sample identification model refers to the original model before forgetting. For example, a medical sample data recognition model before forgetting. Accordingly, this embodiment of the invention addresses the problem of machine forgetting of patient-level medical samples by constructing a frozen teacher model based on the original medical sample recognition model before forgetting. and student models to be updated As shown in the following formula: ; Where, in the formula This represents a model for identifying original medical samples before they were forgotten. This indicates that the teacher model parameters are frozen. Represents the original model parameters. This indicates that the teacher model inherits the original model parameters before forgetting and remains frozen during the forgetting phase. Additionally, in this embodiment of the invention, the student model parameters to be updated... This is used to update parameters based on the target loss during the forgetting phase. Accordingly, in this embodiment of the invention, the teacher model is frozen during the forgetting phase, serving as the teacher model during knowledge distillation to provide a behavioral reference for the model before forgetting. Simultaneously, the student model to be updated serves as the update object, used to perform target patient forgetting, such as forgetting the medical sample data corresponding to the target patient.
[0035] Next, in this embodiment of the invention, forgotten sample data is sampled from the medical sample dataset and input into the student model to be updated for prediction. Then, the first branch loss data is calculated based on the predicted results of the student model. Specifically, in this embodiment of the invention, the medical sample forgotten dataset refers to the forgotten sample set determined from all historical medical sample training datasets according to corresponding medical sample deletion requests, such as patient-level deletion requests. The remaining medical sample data in the historical medical sample training dataset constitutes the medical sample retention dataset. For example, unlike sample-level forgetting, the deletion object of patient-level forgetting is not a single audio sample, but all historical samples corresponding to a target patient in the training set. The original training dataset is... , Indicates the first Each audio sample, such as a PSG-Audio audio sample, Indicates its task tag, This indicates the patient's identity to which the sample belongs. For the number of categories, correspondingly, for a single patient-level deletion request, given the identity of the patient to be forgotten... All of its training samples constitute the medical sample forgetting dataset: ; The remaining training patient samples constitute the medical sample retention dataset: ; In addition, in this embodiment of the invention, the independent patient test set that did not appear during the training phase is denoted as This will be used to subsequently evaluate the generalization ability of the forgetting model on unseen patients.
[0036] Accordingly, this embodiment of the invention obtains forgotten sample data from a constructed medical sample forgotten dataset and inputs it into the student model to be updated for prediction. Based on the prediction results of this student model, the first branch loss data is determined, thereby weakening the model's deterministic prediction of the target patient sample without disrupting the overall model structure. Simultaneously, this embodiment of the invention samples retained sample data from a medical sample retained dataset and inputs it into both the frozen teacher model and the student model to be updated for knowledge distillation, thereby constructing the second branch loss data. Specifically, this embodiment of the invention inputs the retained sample data into the model to be updated to obtain the corresponding prediction distribution. Simultaneously, by introducing the frozen teacher model for knowledge distillation, the classification ability of the student model to be updated on the retained samples is maintained, thus constructing the second branch loss data. Further, this embodiment of the invention constructs target loss data based on the first branch loss data and the second branch loss data, performs gradient calculation based on the target loss data, and then performs gradient correction through a preset gradient coordination algorithm to obtain the desired gradient data. Specifically, in this embodiment of the invention, a target loss function, i.e., target loss data, is constructed by combining the forgetting side branch (first branch loss data) and the retaining side branch (second branch loss data). This allows the target loss function to incorporate conflicting adjustment objectives: reducing the predictive certainty of the target patient samples and maintaining the classification ability of the retained patient samples. Therefore, this embodiment of the invention uses a preset gradient coordination algorithm for gradient correction to coordinate the gradient directions of the forgetting side branch and the retaining side branch, effectively reducing the mutual interference between the damage reduction objective and the repair objective during the model update phase. The preset gradient coordination algorithm in this embodiment refers to a coordination algorithm used to alleviate gradient conflict problems, such as the PCGrad algorithm, CAGrad algorithm, and GCcond algorithm. Finally, this embodiment of the invention updates the model parameters of the student model to be updated based on the expected gradient data to obtain the target medical sample recognition model. Specifically, the expected gradient data in this embodiment refers to the gradient data after gradient correction. Correspondingly, this embodiment of the invention updates the parameters of the student model to be updated using the corrected gradient data, thereby realizing the forgetting process of the medical sample data that needs to be forgotten, and obtaining the target medical sample recognition model, i.e., the forgotten medical sample recognition model.
[0037] In some embodiments of the present invention, forgotten sample data is sampled from a medical sample forgotten dataset and input into the student model to be updated for prediction. Then, the first branch loss data is calculated based on the obtained student model prediction results, including but not limited to the following steps: Forgotten sample data is obtained by acquiring forgotten medical sample datasets, and then damage operations are performed on the forgotten sample data to obtain perturbed sample data.
[0038] The perturbation sample data is input into the student model to be updated for prediction, and the prediction result of the student model is obtained.
[0039] The first branch loss data is calculated based on the student model prediction results combined with the uniform KL divergence loss constraint.
[0040] In this specific embodiment, the present invention first obtains forgotten sample data from a medical sample forgotten dataset, and then performs a damage operation on the forgotten sample data to obtain perturbed sample data. Specifically, the present invention obtains forgotten sample data by sampling from a medical sample forgotten dataset. And by performing a natural input damage operation, we obtain perturbed forgotten sample data, i.e., perturbed sample data. As shown in the following formula: ; Where, in the formula This represents SpecAugment-type input perturbations such as temporal occlusion and frequency occlusion. It's easy to understand that, unlike mislabeling or strong backward gradients, this impairment operation does not forcibly construct incorrect supervision, but rather weakens stable individual cues of the target patient while maintaining the basic structure of audio features. This embodiment of the invention enhances the robustness of the model by performing impairment operations on forgotten sample data. Next, this embodiment of the invention inputs the perturbed sample data into the learning model to be updated for prediction, obtaining the student model's prediction results. Then, based on the student model's prediction results combined with uniform KL divergence loss constraints, the first branch loss data is calculated. Specifically, this embodiment of the invention uses the perturbed sample data, i.e., the impaired target patient samples... Input the student model to be updated and obtain the predicted distribution, as shown in the following formula: ; Accordingly, to reduce the model's output confidence for the target patient sample, this embodiment of the invention sets the target distribution to a uniform distribution of class C, as shown in the following formula: ; Next, based on the prediction results of the student model, this embodiment of the invention uses the Uniform-KL divergence loss constraint to ensure that the output distribution of the student model to be updated is close to a uniform distribution, thus constructing the first branch loss data, as shown in the following formula: ; This loss flattens the predicted distribution of the target patient samples, thereby reducing their separability. It's important to note that this impair branch does not aim to force the target patient samples into the wrong category, but rather achieves a milder weakening of patient memory by reducing predictive certainty.
[0041] In some embodiments of the present invention, retained sample data is sampled from a medical sample retention dataset and input into a frozen teacher model and a student model to be updated, respectively, for knowledge distillation processing, thereby constructing second branch loss data, including but not limited to the following steps: Retained sample data is obtained through a medical sample retention dataset.
[0042] The retained sample data is input into the student model to be updated for prediction, and the first retained prediction result is obtained.
[0043] The cross-entropy loss value is calculated based on the first retained prediction result combined with the cross-entropy loss.
[0044] The retained sample data is input into the frozen teacher model for prediction, resulting in the second retained prediction result.
[0045] The first and second retention prediction results are subjected to temperature processing to calculate the corresponding knowledge distillation loss value.
[0046] The second branch loss data is constructed based on the cross-entropy loss value and the knowledge distillation loss value.
[0047] In this specific embodiment, the present invention first obtains retained sample data through a medical sample retained dataset, then inputs the retained sample data into the student model to be updated for prediction, obtaining a first retained prediction result, and then calculates the cross-entropy loss value by combining the first retained prediction result with the cross-entropy loss. Specifically, in this embodiment, the repair branch is oriented towards the medical sample retained dataset. Its goal is to suppress the impairment of non-target patient classification ability caused by Impair branch updates. Specifically, in this embodiment of the invention, retained sample data is first obtained by sampling from a retained medical sample dataset. The predicted distribution of the student model to be updated on this retained sample, i.e., the first retained prediction result, is shown in the following formula: ; Accordingly, in this embodiment of the invention, the classification ability of the student model to be updated on patient samples is maintained by using cross-entropy loss, and the cross-entropy loss value is calculated as follows: ; Where, in the formula Indicates the retention of samples Real category labels equal to the There are several categories. Accordingly, Indicates the retention of samples The corresponding real category label; This indicates the indicator function, which preserves the true class of the sample. equals category The value is 1 if the condition is met, and 0 otherwise. This indicates that the student model to be updated will retain samples. Predicted as category The probability of.
[0048] Furthermore, in this embodiment of the invention, the retained sample data is input into the frozen teacher model for prediction to obtain a second retention prediction result. The first and second retention prediction results are then subjected to temperature-based processing to calculate the corresponding knowledge distillation loss value. Specifically, to maintain the soft output behavior of the model on retained patient samples before forgetting, this embodiment of the invention introduces a frozen teacher model for knowledge distillation. Wherein, when the temperature coefficient is... The temperature outputs for students and teachers are shown in the following formulas: ; ; Accordingly, the knowledge distillation loss value obtained by constructing the embodiment of the present invention is shown in the following formula:
[0049] Furthermore, in this embodiment of the invention, the second branch loss data is constructed based on the cross-entropy loss value and the knowledge distillation loss value. Specifically, in this embodiment of the invention, the overall loss of the repair branch, i.e., the second branch loss data, is composed of the cross-entropy loss value and the knowledge distillation loss value, as shown in the following formula: ; Where, in the formula and The weights of supervised preservation (cross-entropy loss) and knowledge distillation loss are controlled separately. This embodiment of the invention uses this branch to enable the model to maintain effective identification of non-target patients while performing forgetting of the target patient.
[0050] In some embodiments of the present invention, target loss data is constructed based on first branch loss data and second branch loss data, including but not limited to the following steps: Construct parameter anchoring terms based on Fisher anchor constraints.
[0051] The target loss data is constructed based on the first branch loss data, the second branch loss data, and the parameter anchoring terms.
[0052] In this specific embodiment, the present invention first constructs parameter anchoring terms based on Fisher anchor constraints, and then constructs target loss data by combining the first branch loss data and the second branch loss data. Specifically, in this embodiment, the Impair branch tends to reduce the predictive certainty of the target patient samples, while the Repair branch requires maintaining the classification ability on the patient samples. These two branches may conflict in sharing trainable parameters. Therefore, to limit excessive drift of important parameters, this embodiment introduces Fisher anchor constraints, as shown in the following formula: ; Where, in the formula Represents the set of trainable parameters. Indicates the current parameter. Indicates the parameters before forgetting. Indicates the first The importance of each parameter is estimated. This term imposes stronger constraints on the shifts of important parameters, thereby reducing the impairment of the patient discrimination ability by forgetting updates. Accordingly, in this embodiment of the invention, the target loss data is constructed by integrating the first branch loss data of the Impair branch, the second branch loss data of the Repair branch, and the parameter anchoring term, as shown in the following formula: ; Where, in the formula , , and The weights of target patient injury, retain set cross-entropy, knowledge distillation, and parameter anchoring terms are controlled separately.
[0053] In some embodiments of the present invention, gradient calculation is performed based on the target loss data, and gradient correction is performed using a preset gradient coordination algorithm to obtain the desired gradient data, including but not limited to the following steps: The gradient of the first branch is calculated based on the loss data of the first branch. The gradient of the second branch is calculated based on the loss data of the second branch. Based on the gradients of the first branch and the second branch, projection correction is performed using the projection conflict gradient coordination algorithm to obtain the corrected gradient data. The gradient of the parameter anchoring term is calculated, and then the desired gradient data is determined based on the obtained parameter anchoring gradient and the corrected gradient data.
[0054] In this specific embodiment, the present invention first calculates the first branch gradient based on the first branch loss data, and then calculates the second branch gradient based on the second branch loss data. Subsequently, a projection conflict gradient coordination algorithm is used for projection correction to obtain corrected gradient data. Specifically, the projection conflict gradient coordination (PCGrad) algorithm in this embodiment refers to an algorithm that eliminates gradient direction conflicts by projecting conflicting task gradients onto each other's normal planes. Accordingly, the present invention first calculates the corresponding branch gradient, i.e., the first branch gradient, based on the first branch loss data of the Impair branch and the second branch loss data of the Repair branch. Second branch gradient Next, this embodiment of the invention employs the PCGrad algorithm to coordinate the gradient directions of the Impair and Repair branches. For example, when their inner product is less than zero, it indicates a conflict between the two objectives. In this case, the gradient is projected and corrected, as shown in the following equation: ; In addition, when If the original gradient remains unchanged, then the original gradient is preserved. It is easy to understand that this embodiment of the invention uses this projection correction method to enable the model to reduce the mutual interference between the damaged target and the repair target during the update phase. Finally, this embodiment of the invention calculates the gradient of the parameter anchoring term and combines the parameter anchoring gradient with the corrected gradient data to determine the desired gradient data. Specifically, this embodiment of the invention calculates the gradient of the parameter anchoring term in the target loss data to obtain the corresponding parameter anchoring gradient. Next, if... If the parameter is anchored to the gradient and then combined with the corrected gradient data, the desired gradient data is constructed. Conversely, if... Then, the anchor gradient of this parameter is combined with the original gradients of the Impair and Repair branches to determine the desired gradient data.
[0055] In some embodiments of the present invention, the model parameters of the student model to be updated are updated based on the expected gradient data to obtain the target medical sample recognition model, including but not limited to the following steps: Based on the expected gradient data, the LoRA parameters of the student model to be updated are updated to obtain the optimized model.
[0056] Once it is determined that the optimized model satisfies the Retain-Floor constraint, the optimized model is stored in the preset model library to construct the candidate model library.
[0057] The target medical sample identification model is selected from the candidate model library based on the preset evaluation parameter values.
[0058] In this specific embodiment, the present invention first performs LoRA parameter updates on the student model to be updated based on the expected gradient data to obtain an optimized model. Specifically, in the patient-level machine forgetting process, directly updating the complete model parameters, while providing a larger adjustment space, can easily disrupt the general representations already learned by the pre-trained acoustic model and significantly increase training costs. Therefore, the present invention employs a LoRA strategy for efficient parameter updates, introducing low-rank trainable parameters only in some high-level attention modules and freezing the original backbone weights. For a certain linear mapping in the backbone network, its original weights are set as follows: The LoRA strategy expresses the updated weights as follows: ; Where, in the formula and For trainable low-rank matrices, Denotes the rank of LoRA. This represents the scaling factor. Because... By keeping the model frozen during the forgetting phase, model updates are restricted to the LoRA parameter subspace, thereby reducing the number of parameters and computational overhead in the forgetting process.
[0059] Further, this embodiment of the invention determines whether the optimized model satisfies the Retain-Floor constraint. Specifically, this embodiment stores optimized models that satisfy the Retain-Floor constraint in a preset model library, thereby constructing a candidate model library. The candidate model library contains several optimized models. Then, this embodiment selects and determines the target medical sample recognition model from the candidate model library based on preset evaluation parameter values. Specifically, the preset evaluation parameter values in this embodiment refer to parameters used to evaluate the degree of privacy retention of the target patient sample in the model, such as the AUC value of member-driven attacks. For example, during training, the model only updates the LoRA parameter, and selects the model with the MIA-AUC closest to 0.5 from the candidate checkpoints that satisfy the Retain-Floor constraint as the final forgotten model, i.e., the target medical sample recognition model. Since patient-level forgetting is not equivalent to simply reducing the classification accuracy of the target patient sample, if the model reduces the prediction accuracy of the target patient through overall performance collapse, this result can only be called pseudo-forgetting, not effective privacy deletion. Therefore, this embodiment measures the degree of privacy retention of the target patient sample through the AUC value of member-driven inference attacks. Ideally, an attacker should be unable to distinguish whether a target patient sample participated in the original training; in this case, the MIA-AUC should be close to the random guess level of 0.5. Therefore, the member separability gap in this embodiment of the invention is as follows: ; in, The smaller the value, the more difficult it is to distinguish between target patient samples and non-member samples in the model after forgetting; that is, the more difficult it is to distinguish between target medical samples and non-target medical samples, and the weaker the memory residue related to target medical samples. Furthermore, this embodiment of the invention requires that the model still meets basic performance constraints on the retained set after forgetting in terms of model usability. Here, the accuracy of the retained set is denoted as... The performance retention threshold is An effective forgetting model must satisfy the following equation:
[0060] In this embodiment of the invention, the constraint avoids the model from achieving a superficial forgetting effect by sacrificing the performance of non-target patients. Simultaneously, this embodiment of the invention also utilizes an independent test set... The ACC and Macro-F1 scores are reported to evaluate the model's generalization ability to unseen patients after forgetting. It is readily understood that, in the model selection phase, this embodiment of the invention employs Retain-Floor constraints and MIA-AUC parameters to establish dual constraints on availability and privacy, ensuring consistency in the patient-level forgetting process from training objectives to checkpoint selection.
[0061] The following section provides a detailed introduction and explanation of the solutions in this embodiment of the invention, using a specific scenario of machine forgetting medical sample data as an example: For example, refer to Figure 2 , Figure 2 This is a schematic diagram of the overall framework for machine forgetting of medical sample data provided in an embodiment of the present invention. Specifically, for the problem of machine forgetting of patient-level audio data, this embodiment of the present invention proposes the NIR-LoRA framework. This framework uses a pre-forgetting model... Based on this, a frozen teacher model is constructed. and student models to be updated Meanwhile, during training, the model is trained from the forgotten dataset. and preserve dataset Sampling to obtain forgotten sample data and retain sample data As shown in the following formula: ; Among them, the forgotten sample data in the embodiments of the present invention Enter the Impair branch to weaken the predictive certainty of the target patient sample; preserve sample data. The process then proceeds to the Repair branch, which maintains classification capabilities for non-target patients. The optimization objectives generated by both branches are further stabilized through gradient coordination and parameter constraints, ultimately yielding the post-forgetting model. Therefore, the overall idea of the NIR-LoRA architecture constructed in this embodiment of the invention is to simultaneously achieve the goal of reducing the target patient's memory and preserving the patient's abilities within a lightweight parameter update space.
[0062] Reference Figure 3 In patient-level forgetting, simply weakening the target patient samples does not guarantee effective forgetting. If the model reduces the prediction confidence of the target patient by decreasing the overall discriminative ability, although it may exhibit lower forget accuracy or a MIA-AUC close to 0.5, the retain / test performance will also collapse simultaneously. This type of result is essentially pseudo-forgetting, rather than effective privacy deletion on the usable model. To avoid this problem, this embodiment of the invention designs patient-level forgetting as a two-branch mechanism with Impair and Repair working together. The Impair branch is responsible for reducing the prediction certainty of the target patient samples, thus reducing their separability; the Repair branch is responsible for constraining the model's classification behavior in retaining patient samples, preventing forgetting updates from disrupting the discriminative boundaries of non-target patients. These two correspond to the two mutually constraining objectives of "weakening the memory of the target patient" and "preserving the ability of non-target patients," respectively. Since Impair and Repair share the same set of trainable LoRA parameters, gradient conflicts may occur between the two objectives during training. If the Impair objective is too strong, the model is prone to performance collapse; if the Repair objective is too strong, target patient information may be over-retained. Therefore, the key to NIR is not simply to add up the loss, but to construct a privacy-utility balance through a bi-branch objective and to achieve stable updates by combining gradient coordination and parameter constraints in the subsequent optimization stage.
[0063] Accordingly, in this embodiment of the invention, the Impair branch is oriented towards the forgotten dataset. The goal is to reduce the model's deterministic prediction of the target patient samples without compromising the overall model structure. This invention first uses a forgotten dataset... Mid-sampling yields forgotten sample data The natural input impairment operation is applied, and the perturbed sample data is then input into the student model to be updated. Furthermore, the Uniform-KL loss constraint ensures the student model's output distribution is close to a uniform distribution, thus constructing the loss data for the Impair branch. In addition, in this embodiment, the Repair branch is oriented towards the retained dataset. The goal is to suppress the impairment of Impair updates on the classification ability of non-target patients. Accordingly, embodiments of the invention first start from the retained dataset Mid-sampling yields retained sample data To obtain the predicted distribution of the student model to be updated on the retained samples, cross-entropy loss is used to maintain the classification ability of the student model to be updated on the retained patient samples, thus constructing cross-entropy loss data. Simultaneously, this embodiment introduces freezing the teacher model for knowledge distillation, thereby preserving the soft output behavior of the model before forgetting on the retained patient samples, thus constructing knowledge distillation loss data. In this embodiment, the overall loss of the Repair branch consists of cross-entropy loss data and knowledge distillation loss data. Furthermore, to limit excessive drift of important parameters, this embodiment also introduces Fisher-Anchor constraints to construct parameter anchoring terms. These anchoring terms, the loss data of the Impair branch, and the overall loss of the Repair branch are then combined to construct the final optimization objective. Finally, during training, this embodiment only updates the LoRA parameters of the model and selects the model with the MIA-AUC closest to 0.5 from the candidate detection points that satisfy the Retain-Floor constraint as the final forgetting model.
[0064] It is easy to understand that the embodiments of the present invention first limit parameter drift through Anchor regularization, and at the same time alleviate gradient conflicts between forgetting targets and repair targets through PCGrad. Then, in the model selection stage, Retain-Floor and MIA-AUC form dual constraints on usability and privacy, so that the patient-level forgetting process remains consistent from the training target to the selection of checkpoints.
[0065] Furthermore, this embodiment of the invention validates the proposed machine forgetting method for medical sample data on the PSG-Audio sleep audio dataset. This dataset originates from synchronous audio recordings in polysomnography scenarios, and the samples contain acoustic information related to sleep breathing events, such as breathing sounds, snoring, and ambient sleep sounds. Unlike ordinary audio classification tasks, medical audio samples not only contain task-related disease discrimination clues but may also implicitly contain private information such as individual patient acoustic characteristics, differences in the collection environment, and long-term physiological states. Therefore, this embodiment of the invention uses patient identity as the forgetting granularity to investigate whether the model can weaken the influence of a patient's historical samples on the model after receiving a deletion request from a particular patient. Accordingly, to avoid leakage of patient information, a strict patient-level partitioning strategy is adopted in the experiment. Patient identities do not overlap between the training set, validation set, and test set, and samples of the same patient will not appear in different data partitions simultaneously. This setting can prevent the model from encountering other samples of training patients during the testing phase, thereby more realistically evaluating the model's generalization ability on patients not seen after forgetting. This embodiment of the invention uses patient samples not seen during the training phase as an independent test set to measure whether the model still possesses cross-patient classification ability after forgetting.
[0066] In each patient-level forgetting experiment, a target patient is selected from the training patients as the patient to be forgotten. All samples corresponding to this patient in the training set constitute the forgetting dataset. The remaining training patient samples constitute the reserved dataset. The test set consists of independent test patient samples. In other words, the deletion request in this embodiment of the invention does not remove a single audio sample, but rather removes all historical training samples of the target patient. This setting is closer to the actual privacy deletion needs in medical audio systems and is more challenging than ordinary sample-level forgetting.
[0067] Furthermore, to evaluate the stability of the method on different target patients, this embodiment of the invention selects multiple training patients to construct forgetting requests and reports the mean results and standard deviations on different patients. Both the main experiment and the ablation experiment are conducted under the same patient-level partitioning, and all comparison methods share consistent forgetting, retain, and test set settings to ensure fair comparison between different forgetting strategies. Simultaneously, to comprehensively evaluate the patient-level machine forgetting effect, this embodiment of the invention sets evaluation indicators from four aspects: model usability, target patient forgetting degree, privacy risk, and forgetting efficiency. Since the goal of patient-level forgetting is not simply to reduce the classification accuracy of target patient samples, but to maintain the model's capability on non-target patients while reducing the separability of target patient members, a single indicator is insufficient to fully reflect the forgetting effect. Accordingly, this embodiment of the invention splits the main experiment results into two parts: classification performance and privacy efficiency. Classification performance mainly reflects whether the model still possesses usability, as shown in Table 1 below: Table 1
[0068] In addition, privacy efficiency results are used to determine whether the risk to target patient members and training costs have been effectively controlled, as shown in Table 2 below: Table 2
[0069] In the table, MIA-AUC represents the area under the curve for member inference attacks, used to measure the attacker's ability to distinguish whether the target patient sample has participated in the original model training. The closer the MIA-AUC is to 0.5, the closer the attack result is to random guessing, the more difficult it is to distinguish the target patient sample from the non-member sample, and the weaker the target patient-related memory residue in the model. Correspondingly, in terms of classification performance, FineTune-LoRA maintains good retain / test performance, but its MIA-AUC is 0.8392 ± 0.0611, indicating that ordinary fine-tuning cannot effectively reduce the risk of target patient members. Although NegGrad-LoRA and KL-LoRA have shorter training times, their retain ACC is only 0.7123 ± 0.0150 and 0.7130 ± 0.0147, respectively, and their test ACC also drops to about 0.47, indicating that they mainly obtain superficial forgetting by destroying the overall model's ability and cannot be used as a usable patient-level forgetting method. Retrain-Full achieved the highest retain performance, but its training time reached 4373.09 ± 676.91 seconds, and it required updating 100% of the parameters, resulting in significantly higher computational costs. In contrast, Ours-Full achieved scores of 0.7693 ± 0.0042 and 0.7663 ± 0.0051 on Test ACC and Test Macro-F1, respectively, close to Original; its MIA-AUC was 0.5273 ± 0.0273, closest to the random guess level of 0.5, indicating that the separability of the target patient sample was significantly weakened. Furthermore, Ours-Full had a mean forgetting time of 572.21 ± 292.45 seconds and a trainable parameter ratio of only 0.7819%, achieving a more balanced trade-off between privacy risks, model usability, and update efficiency.
[0070] Furthermore, to analyze the impact of each module on the final performance, an ablation experiment was conducted in this embodiment of the invention. The performance comparison results of the ablation experiments are shown in Table 3 below: Table 3
[0071] Meanwhile, the comparison of privacy risks and efficiency in the ablation experiments of this invention is shown in Table 4 below: Table 4
[0072] The ablation results showed that the Repair branch is a key module to prevent the overall model failure. Removing the Repair branch reduced Retain ACC to 0.7157 ± 0.0155 and Test Macro-F1 to only 0.3340 ± 0.0031, with collapse occurring in 3 / 3 of the experiments, indicating that relying solely on target patient lesions significantly impairs discrimination ability on non-target patients. Removing KD also significantly reduced Retain ACC and Test Macro-F1, with collapse occurring in 2 / 3 of the experiments, demonstrating the important role of knowledge distillation in maintaining training stability on difficult patients. In contrast, removing PCGrad or Fisher-Anchor allowed the model to still function overall, but slightly increased privacy risks and volatility. The MIA-AUC of w / o PCGrad is 0.5320±0.0401, and that of w / o Fisher-Anchor is 0.5396±0.0524, both slightly worse than Ours-Full's 0.5273±0.0273. This indicates that PCGrad and Fisher-Anchor are not modules that solely determine whether the model collapses, but rather are mainly used to mitigate dual-branch objective conflicts and parameter drift, thereby improving the stability of the training process.
[0073] In summary, this invention addresses the challenge of balancing target patient privacy deletion, performance preservation, and cost control in patient-level machine forgetting within the PSG-Audio medical audio scenario. It proposes a machine forgetting method for medical sample data and constructs a corresponding NIR-LoRA framework. This method weakens the predictive determinism of target patient samples through the Impair branch, maintains classification ability on non-target patients through the Repair branch, and achieves stable and parameter-efficient forgetting updates by combining PCGrad, Fisher-Anchor, and LoRA. Notably, the NIR-LoRA architecture constructed in this invention maintains good retain / test performance while reducing the separability of target patient members, indicating that it does not achieve a superficial forgetting effect by destroying the overall model. Furthermore, ablation experiments further verify the importance of the Repair branch and knowledge distillation in preventing model collapse, demonstrating that gradient coordination and parameter constraints contribute to improving the stability of the forgetting process.
[0074] Please see Figure 4 This application also provides a medical sample data machine forgetting device, which can implement the above-described method. The device includes: The first module 210 is used to construct a frozen teacher model and a student model to be updated based on the original medical sample identification model.
[0075] The second module 220 is used to sample forgotten sample data from the medical sample forgotten dataset and input it into the student model to be updated for prediction, and then calculate the first branch loss data based on the predicted results of the student model.
[0076] The third module 230 is used to sample retained sample data from the medical sample retained dataset and input it into the frozen teacher model and the student model to be updated respectively for knowledge distillation processing, thereby constructing the second branch loss data.
[0077] The fourth module 240 is used to construct target loss data based on the first branch loss data and the second branch loss data.
[0078] The fifth module 250 is used to calculate gradients based on the target loss data and correct the gradients using a preset gradient coordination algorithm to obtain the desired gradient data.
[0079] Module 6, 260, is used to update the model parameters of the student model to be updated based on the expected gradient data, so as to obtain the target medical sample recognition model.
[0080] It is understood that the content of the above method embodiments is applicable to the present device embodiments. The specific functions implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0081] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.
[0082] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0083] Please see Figure 5 , Figure 5 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 310 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 320 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 320 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 320 and is called and executed by the processor 310 using the methods described in the embodiments of this application. Input / output interface 330 is used to realize information input and output; The communication interface 340 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 350 transmits information between various components of the device (e.g., processor 310, memory 320, input / output interface 330, and communication interface 340); The processor 310, memory 320, input / output interface 330 and communication interface 340 are connected to each other within the device via bus 350.
[0084] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0085] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0086] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0087] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0088] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0089] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0090] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0091] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; 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.
[0092] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0093] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0094] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0095] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of the units described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.
[0096] The units described above 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 units can be selected to achieve the purpose of this embodiment according to actual needs.
[0097] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0098] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or 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 multiple 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 of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0099] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A method for machine forgetting of medical sample data, characterized in that, The method includes the following steps: Based on the original medical sample identification model, a frozen teacher model and a student model to be updated were constructed respectively. Forgotten sample data is obtained by sampling from the medical sample forgetting dataset and input into the student model to be updated for prediction. Then, the first branch loss data is calculated based on the prediction results of the student model. Reserved sample data is obtained by sampling from the medical sample reserved dataset, and then input into the frozen teacher model and the student model to be updated respectively for knowledge distillation processing, thereby constructing the second branch loss data; Construct target loss data based on the first branch loss data and the second branch loss data; Gradient calculation is performed based on the target loss data, and gradient correction is performed using a preset gradient coordination algorithm to obtain the desired gradient data. The model parameters of the student model to be updated are updated based on the expected gradient data to obtain the target medical sample recognition model.
2. The method according to claim 1, characterized in that, The process involves sampling forgotten sample data from a medical sample forgotten dataset and inputting it into the student model to be updated for prediction. Then, based on the predicted results from the student model, the first branch loss data is calculated, including: The forgotten sample data is obtained by acquiring the forgotten medical sample dataset, and then the forgotten sample data is damaged to obtain perturbed sample data. The perturbation sample data is input into the student model to be updated for prediction, and the prediction result of the student model is obtained. The first branch loss data is calculated based on the student model prediction results combined with the uniform KL divergence loss constraint.
3. The method according to claim 1, characterized in that, The process involves sampling retained sample data from the medical sample retained dataset and inputting it into the frozen teacher model and the student model to be updated, respectively, for knowledge distillation to construct the second branch loss data, including: The retained sample data is obtained through the medical sample retention dataset; The retained sample data is input into the student model to be updated for prediction, and the first retained prediction result is obtained. The cross-entropy loss value is calculated based on the first retained prediction result and the cross-entropy loss. The retained sample data is input into the frozen teacher model for prediction to obtain the second retained prediction result; The first and second retention prediction results are subjected to temperature-based processing, and then the corresponding knowledge distillation loss values are calculated. The second branch loss data is constructed based on the cross-entropy loss value and the knowledge distillation loss value.
4. The method according to claim 1, characterized in that, The step of constructing target loss data based on the first branch loss data and the second branch loss data includes: Construct parameter anchoring terms based on Fisher anchor constraints; The target loss data is constructed based on the first branch loss data, the second branch loss data, and the parameter anchoring term.
5. The method according to claim 4, characterized in that, The step of calculating gradients based on the target loss data and correcting gradients using a preset gradient coordination algorithm to obtain the desired gradient data includes: The gradient of the first branch is calculated based on the loss data of the first branch. The gradient of the second branch is calculated based on the loss data of the second branch. Based on the gradients of the first branch and the second branch, a projection conflict gradient coordination algorithm is used to perform projection correction to obtain corrected gradient data. The gradient of the parameter anchoring term is calculated, and then the desired gradient data is determined based on the obtained parameter anchoring gradient and the corrected gradient data.
6. The method according to claim 1, characterized in that, The step of updating the model parameters of the student model to be updated based on the expected gradient data to obtain the target medical sample recognition model includes: The LoRA parameters of the student model to be updated are updated based on the expected gradient data to obtain an optimized model. Once it is determined that the optimization model satisfies the Retain-Floor constraint, the optimization model is stored in a preset model library to construct a candidate model library; The target medical sample identification model is selected from the candidate model library based on preset evaluation parameter values.
7. A medical sample data machine forgetting device, characterized in that, The device includes: The first module is used to construct a frozen teacher model and a student model to be updated based on the original medical sample identification model. The second module is used to sample forgotten sample data from the medical sample forgotten dataset and input it into the student model to be updated for prediction, and then calculate the first branch loss data based on the predicted results of the student model. The third module is used to sample retained sample data from the medical sample retained dataset and input it into the frozen teacher model and the student model to be updated respectively for knowledge distillation processing, thereby constructing the second branch loss data; The fourth module is used to construct target loss data based on the first branch loss data and the second branch loss data; The fifth module is used to perform gradient calculation based on the target loss data and perform gradient correction through a preset gradient coordination algorithm to obtain the desired gradient data. The sixth module is used to update the model parameters of the student model to be updated based on the expected gradient data, so as to obtain the target medical sample recognition model.
8. An electronic device, characterized in that, include: At least one processor; At least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of 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 a processor, it implements the method of any one of claims 1 to 6.
