Sample purification method and device based on diffusion model
By using the sample purification method of Transformer network structure in the diffusion model, the problem of the difficulty of preventing unknown adversarial attacks in the existing technology is solved, and efficient sample purification is achieved, key features of the sample are retained and resolution loss is reduced.
Patent Information
- Application Number
- CN202411671809.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-04-04
AI Technical Summary
The existing adversarial training methods are difficult to effectively defend against unknown adversarial attacks, and the calculation complexity is high, so they cannot effectively remove unknown perturbation information and retain key features of the samples.
Using a sample purification method based on the diffusion model, the purified sample is obtained by inputting the sample to be purified into the pre-trained diffusion model, adding noise using the forward diffusion module and denoising it through the reverse generation module. This diffusion model replaces the U-Net network structure with the Transformer network structure before training.
Effective purification of unknown adversarial attacks is achieved, the attack characteristics are removed and the critical information of the sample is retained, the resolution loss caused by purification is reduced, and the purification sample is provided with high availability.
Smart Images

Figure CN119760422A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a sample purification method and device based on a diffusion model. Background Art
[0002] Adversarial sample attacks add imperceptible disturbances to the input, causing the computer vision deep neural network (DNN) to make incorrect predictions with high confidence. After the gradual evolution from machine learning to generative adversarial networks (GANs) and then to diffusion models to generate adversarial samples, adversarial samples have become highly concealed and misleading, posing a major challenge to the reliability and security of vision-driven artificial intelligence (AI) systems.
[0003] There have been many works on protecting neural networks from such adversarial attacks. Among them, adversarial training, i.e. training neural networks on adversarial samples, has become a standard form of defense due to its effectiveness. However, most adversarial training methods can only defend against the specific attacks they are trained on. For unknown attacks, their performance drops significantly. In addition, the computational complexity of adversarial training is usually higher than that of standard training. In order to deal with unknown attacks, it is necessary to propose a new adversarial purification method to remove the unknown perturbation information and retain the key latent features of the sample for recognition. Summary of the invention
[0004] In order to overcome the above defects, the present invention proposes a sample purification method and device based on a diffusion model.
[0005] In a first aspect, a sample purification method based on a diffusion model is provided, and the sample purification method based on a diffusion model comprises:
[0006] Obtaining samples to be purified;
[0007] Using the sample to be purified as the input of the pre-trained diffusion model to obtain the purified sample output by the pre-trained diffusion model;
[0008] Wherein, before training, the diffusion model replaces the U-Net network structure in the diffusion model with the Transformer network structure.
[0009] Preferably, the training process of the pre-trained diffusion model includes:
[0010] Obtaining adversarial samples, and constructing training data using the adversarial samples;
[0011] The diffusion model is trained based on the training data to obtain the pre-trained diffusion model.
[0012] Furthermore, the process of training the diffusion model based on the training data adopts a denoising score matching algorithm.
[0013] Preferably, the diffusion model includes: a forward diffusion module and a reverse generation module;
[0014] The forward diffusion module is used to add noise to the adversarial sample or the sample to be purified to obtain a noisy sample;
[0015] The reverse generation module is used to reduce the noise of the noisy sample to obtain a purified sample.
[0016] Furthermore, the noise-added sample is as follows:
[0017]
[0018] In the above formula, x(t * ) is the noise sample, α(t * ) is the noise ratio, x a is the adversarial sample or the sample to be purified, ∈ is random noise, t * is the diffusion time step.
[0019] Furthermore, the noise ratio is as follows:
[0020]
[0021] In the above formula, e is a natural constant, β is the distribution function of the fitted linear noise, s is the score function value, The expected value is 0 and the variance is I d The normal distribution of I d is the identity matrix.
[0022] Further, the purified sample is as follows:
[0023]
[0024] In the above formula, To purify the sample, sdeint is the numerical integration function, x(t * ) is the noise sample, f rev is the reverse drift coefficient, g rev is the reverse diffusion coefficient, is random noise.
[0025] Furthermore, the reverse drift coefficient is as follows:
[0026]
[0027] The reverse diffusion coefficient is as follows:
[0028]
[0029] In the above formula, β is the distribution function of the fitted linear noise, s is the score function value, is the value vector sampled in the function expression corresponding to the cleaned sample.
[0030] Furthermore, the score function value is as follows:
[0031]
[0032] In the above formula, represents the gradient, and pt is the probability density function of the fitted linear noise.
[0033] In a second aspect, a sample purification device based on a diffusion model is provided, and the sample purification device based on a diffusion model comprises:
[0034] An acquisition module, used to acquire samples to be purified;
[0035] An analysis module, used for taking the sample to be purified as the input of the pre-trained diffusion model to obtain the purified sample output by the pre-trained diffusion model;
[0036] Wherein, before training, the diffusion model replaces the U-Net network structure in the diffusion model with the Transformer network structure.
[0037] Preferably, the training process of the pre-trained diffusion model includes:
[0038] Obtaining adversarial samples and constructing training data using the adversarial samples;
[0039] The diffusion model is trained based on the training data to obtain the pre-trained diffusion model.
[0040] Furthermore, the process of training the diffusion model based on the training data adopts a denoising score matching algorithm.
[0041] Preferably, the diffusion model includes: a forward diffusion module and a reverse generation module;
[0042] The forward diffusion module is used to add noise to the adversarial sample or the sample to be purified to obtain a noisy sample;
[0043] The reverse generation module is used to reduce the noise of the noisy sample to obtain a purified sample.
[0044] Furthermore, the noise-added sample is as follows:
[0045]
[0046] In the above formula, x(t * ) is the noise sample, α(t * ) is the noise ratio, x a is the adversarial sample or the sample to be purified, ∈ is random noise, t * is the diffusion time step.
[0047] Furthermore, the noise ratio is as follows:
[0048]
[0049] In the above formula, e is a natural constant, β is the distribution function of the fitted linear noise, s is the score function value, The expected value is 0 and the variance is I d The normal distribution of I d is the identity matrix.
[0050] Further, the purified sample is as follows:
[0051]
[0052] In the above formula, To purify the sample, sdeint is the numerical integration function, x(t * ) is the noise sample, f rev is the reverse drift coefficient, g rev is the reverse diffusion coefficient, is random noise.
[0053] Furthermore, the reverse drift coefficient is as follows:
[0054]
[0055] The reverse diffusion coefficient is as follows:
[0056]
[0057] In the above formula, β is the distribution function of the fitted linear noise, s is the score function value, is the value vector sampled in the function expression corresponding to the cleaned sample.
[0058] Furthermore, the score function value is as follows:
[0059]
[0060] In the above formula, represents the gradient, and pt is the probability density function of the fitted linear noise.
[0061] In a third aspect, a computer device is provided, comprising: one or more processors;
[0062] The processor is used to store one or more programs;
[0063] When the one or more programs are executed by the one or more processors, the diffusion model-based sample purification method is implemented.
[0064] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed, the sample purification method based on the diffusion model is implemented.
[0065] The above one or more technical solutions of the present invention have at least one or more of the following beneficial effects:
[0066] The present invention provides a sample purification method and device based on a diffusion model, comprising: obtaining a sample to be purified; using the sample to be purified as an input of a pre-trained diffusion model to obtain a purified sample output by the pre-trained diffusion model; wherein the diffusion model replaces the U-Net network structure in the diffusion model with a Transformer network structure before training. The technical solution provided by the present invention makes full use of the characteristics of the diffusion model to provide users with highly usable purified samples. At the same time, by using a pre-trained Transformer backbone to strengthen the design of visual background information, the resolution loss caused by purification is further reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a schematic flow chart of the main steps of the sample purification method based on the diffusion model according to an embodiment of the present invention;
[0068] Figure 2 1 is a schematic flow chart of the forward diffusion process and the reverse generation process of an embodiment of the present invention;
[0069] Figure 3 is a sample diagram of a noise-added sample and a cleaned sample according to an embodiment of the present invention;
[0070] Figure 4 It is a graph showing the experimental results of various adversarial samples according to an embodiment of the present invention. DETAILED DESCRIPTION
[0071] The specific implementation modes of the present invention will be further described in detail below in conjunction with the accompanying drawings.
[0072] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0073] As disclosed in the background art,
[0074] In order to improve the above problems, the present invention provides a sample purification method and device based on a diffusion model, including: obtaining a sample to be purified; using the sample to be purified as the input of a pre-trained diffusion model to obtain a purified sample output by the pre-trained diffusion model; wherein the diffusion model replaces the U-Net network structure in the diffusion model with a Transformer network structure before training. The technical solution provided by the present invention makes full use of the characteristics of the diffusion model to provide users with highly usable purified samples. At the same time, by using a pre-trained Transformer backbone to strengthen the design of visual background information, the resolution loss caused by purification is further reduced.
[0075] The above scheme is described in detail below.
[0076] Example 1
[0077] See attached Figure 1 , Figure 1 FIG. 1 is a flow chart of the main steps of a sample purification method based on a diffusion model according to an embodiment of the present invention. Figure 1 As shown, the sample purification method based on the diffusion model in the embodiment of the present invention mainly includes the following steps:
[0078] Step S101: obtaining a sample to be purified;
[0079] Step S102: using the sample to be purified as the input of the pre-trained diffusion model to obtain the purified sample output by the pre-trained diffusion model;
[0080] In order to take advantage of the favorable properties of the diffusion model and the pre-trained visual Transformer backbone, our work uses forward and backward processes to purify adversarial images, and uses the Transformer structure to replace U-Net as the visual feature encoder. The Transformer structure is known for its self-attention mechanism, which can capture long-distance dependencies and global patterns in the input data, which is particularly important for visual tasks such as images. In contrast, although U-Net can effectively capture local features, it may not be as effective as Transformer in processing global information. Therefore, using the Transformer structure instead of U-Net can lead to a smaller resolution loss in the generated purified images.
[0081] In this embodiment, the training process of the pre-trained diffusion model includes:
[0082] Obtaining adversarial samples and constructing training data using the adversarial samples;
[0083] The diffusion model is trained based on the training data to obtain the pre-trained diffusion model.
[0084] In one embodiment, the process of training the diffusion model based on the training data uses a denoising score matching algorithm to minimize the difference between the score function estimated by the model and the true score function by calculating the weighted square error of the difference over multiple time steps. By minimizing this loss function, the diffusion model can learn how to generate high-quality data samples and recover clean data from noise.
[0085] In this embodiment, the diffusion model includes: a forward diffusion module and a reverse generation module;
[0086] The forward diffusion module is used to add noise to the adversarial sample or the sample to be purified to obtain a noisy sample;
[0087] The reverse generation module is used to reduce the noise of the noisy sample to obtain a purified sample.
[0088] Specifically, the forward diffusion process and the reverse generation process are as follows: Figure 2 As shown in the figure, the forward diffusion process (Forward Diffusion Process): Starting from the adversarial image, this process transforms the data into a noise distribution by gradually adding noise. This process can be described by a forward stochastic differential equation (Forward SDE), which defines the process in which data points are gradually covered by noise as time increases.
[0089] Reverse Generative Process: After the forward diffusion process, a diffused image is obtained. Then, the purified image is recovered from the noise through the reverse SDE. This process is equivalent to the reverse operation of the forward diffusion process, and the original data is restored by gradually removing noise.
[0090] In one embodiment, the noise-added sample is as follows:
[0091]
[0092] In the above formula, x(t * ) is the noise sample, α(t * ) is the noise ratio, x a is the adversarial sample or the sample to be purified, ∈ is random noise, t * is the diffusion time step.
[0093] In one embodiment, the noise ratio is as follows:
[0094]
[0095] In the above formula, e is a natural constant, β is the distribution function of the fitted linear noise, s is the score function value, The expected value is 0 and the variance is I d The normal distribution of I d is the identity matrix.
[0096] In one embodiment, the sample is purified as follows:
[0097]
[0098] In the above formula, To purify the sample, sdeint is the numerical integration function, x(t * ) is the noise sample, f rev is the reverse drift coefficient, g rev is the reverse diffusion coefficient, is random noise.
[0099] In one embodiment, the reverse drift coefficient is as follows:
[0100]
[0101] The reverse diffusion coefficient is as follows:
[0102]
[0103] In the above formula, β is the distribution function of the fitted linear noise, s is the score function value, is the value vector sampled in the function expression corresponding to the cleaned sample.
[0104] In one embodiment, the score function value is as follows:
[0105]
[0106] In the above formula, represents the gradient, p t is the probability density function of the fitted linear noise.
[0107] Through these two processes, we can see that the forward SDE process gradually eliminates the local structure of the data by adding noise, while the reverse SDE process gradually recovers clear data from the noise. This method based on the diffusion model can effectively purify adversarial samples, remove the attack features in them, and retain the key information of the image. The noise-added sample and the purified sample are as follows: Figure 3 shown.
[0108] Adversarial attacks can be divided into black-box, gray-box, and white-box attacks. Black-box attacks assume that the attacker knows nothing about the internal structure of the classifier and the defender. White-box attacks assume that the attacker can obtain any information about the defender and the target classifier, including the architecture and parameter weights. Gray-box attacks are between white-box and black-box attacks, where the attacker has partial knowledge of the target model. In this work, we only focus on the purification performance in white-box attacks, because white-box attacks are the most difficult to defend from the defender's perspective.
[0109] In this example, four mainstream high-intensity white-box adversarial attack methods are selected, namely, projected gradient descent attack (PGD), anti-adversarial training attack in AutoAttack, adversarial sample using spatial transformation (StAdv), and adaptive steganographic feature attack based on diffusion model (Diffusion); then an adversarial sample image is generated to test the DBAP method, and the original image, adversarial sample image, noisy adversarial sample image and purified sample image are shown in Figure 2. Figure 4As shown in the figure, it can be clearly seen that as noise is gradually added in the forward process, the quality of the adversarial sample deteriorates, which corresponds to the serious interference of the attack hidden features. Subsequently, the reverse purification process is performed to finally generate high-quality purified samples. The adversarial samples that were originally difficult to distinguish from the original samples by the naked eye have basically unchanged image quality after purification, but have lost their aggressiveness. Then we corresponded the adversarial samples and purified samples one by one, and input them into four different open source image classifiers (MobileNet, Inception, VIT, DEIT-B). The results are shown in Table 1. The adversarial samples successfully attacked all four open source models, verifying the effectiveness of the attack, and the purified samples were all correctly identified, verifying the effectiveness of DBAP in dealing with multiple adversarial sample attacks.
[0110] Table 1
[0111] Open Source Classifiers Original image recognition results Adversarial sample recognition results Clean sample identification results MobileNet Truck Big Box Truck Inception Truck Billboard Truck VIT Truck Billboard Truck DEIT-B Truck Tank Truck
[0112] Example 2
[0113] Based on the same inventive concept, the present invention also provides a sample purification device based on a diffusion model, and the sample purification device based on a diffusion model includes:
[0114] An acquisition module, used for acquiring samples to be purified;
[0115] An analysis module, used for taking the sample to be purified as the input of the pre-trained diffusion model to obtain the purified sample output by the pre-trained diffusion model;
[0116] Wherein, before training, the diffusion model replaces the U-Net network structure in the diffusion model with the Transformer network structure.
[0117] Preferably, the training process of the pre-trained diffusion model includes:
[0118] Obtaining adversarial samples, and constructing training data using the adversarial samples;
[0119] The diffusion model is trained based on the training data to obtain the pre-trained diffusion model.
[0120] Furthermore, the process of training the diffusion model based on the training data adopts a denoising score matching algorithm.
[0121] Preferably, the diffusion model includes: a forward diffusion module and a reverse generation module;
[0122] The forward diffusion module is used to add noise to the adversarial sample or the sample to be purified to obtain a noisy sample;
[0123] The reverse generation module is used to reduce the noise of the noisy sample to obtain a purified sample.
[0124] Furthermore, the noise-added sample is as follows:
[0125]
[0126] In the above formula, x(t * ) is the noise sample, α(t * ) is the noise ratio, x a is the adversarial sample or the sample to be purified, ∈ is random noise, t * is the diffusion time step.
[0127] Furthermore, the noise ratio is as follows:
[0128]
[0129] In the above formula, e is a natural constant, β is the distribution function of the fitted linear noise, s is the score function value, The expected value is 0 and the variance is I d The normal distribution of I d is the identity matrix.
[0130] Further, the purified sample is as follows:
[0131]
[0132] In the above formula, To purify the sample, sdeint is the numerical integration function, x(t * ) is the noise sample, f rev is the reverse drift coefficient, g rev is the reverse diffusion coefficient, is random noise.
[0133] Furthermore, the reverse drift coefficient is as follows:
[0134]
[0135] The reverse diffusion coefficient is as follows:
[0136]
[0137] In the above formula, β is the distribution function of the fitted linear noise, s is the score function value, is the value vector sampled in the function expression corresponding to the cleaned sample.
[0138] Furthermore, the score function value is as follows:
[0139]
[0140] In the above formula, represents the gradient, p t is the probability density function of the fitted linear noise.
[0141] Example 3
[0142] Based on the same inventive concept, the present invention also provides a computer device, which includes a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. It is the computing core and control core of the terminal, which is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in a computer storage medium to implement a corresponding method flow or a corresponding function, so as to implement the steps of a sample purification method based on a diffusion model in the above embodiment.
[0143] Example 4
[0144] Based on the same inventive concept, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space that stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the steps of a sample purification method based on a diffusion model in the above embodiment.
[0145] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0146] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0147] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0148] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0149] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A sample purification method based on a diffusion model, characterized in that: The method comprises: Obtaining samples to be purified; Using the sample to be purified as the input of the pre-trained diffusion model to obtain the purified sample output by the pre-trained diffusion model; Wherein, before training, the diffusion model replaces the U-Net network structure in the diffusion model with the Transformer network structure.
2. The method according to claim 1, characterized in that The training process of the pre-trained diffusion model includes: Obtaining adversarial samples and constructing training data using the adversarial samples; The diffusion model is trained based on the training data to obtain the pre-trained diffusion model.
3. The method according to claim 2, characterized in that The process of training the diffusion model based on the training data adopts a denoising score matching algorithm.
4. The method according to claim 1, characterized in that The diffusion model includes: a forward diffusion module and a reverse generation module; The forward diffusion module is used to add noise to the adversarial sample or the sample to be purified to obtain a noisy sample; The reverse generation module is used to reduce the noise of the noisy sample to obtain a purified sample.
5. The method according to claim 4, characterized in that The noise-added samples are as follows: In the above formula, x(t * ) is the noise sample, α(t * ) is the noise ratio, x a is the adversarial sample or the sample to be purified, ∈ is random noise, t * is the diffusion time step.
6. The method according to claim 5, characterized in that The noise ratio is as follows: In the above formula, e is a natural constant, β is the distribution function of the fitted linear noise, s is the score function value, The expected value is 0 and the variance is I d The normal distribution of I d is the identity matrix.
7. The method according to claim 5, characterized in that The purified samples are as follows: In the above formula, To purify the sample, sdeint is the numerical integration function, x(t * ) is the noise sample, f rev is the reverse drift coefficient, g rev is the reverse diffusion coefficient, is random noise.
8. The method according to claim 7, characterized in that The reverse drift coefficient is as follows: The reverse diffusion coefficient is as follows: In the above formula, β is the distribution function of the fitted linear noise, s is the score function value, is the value vector sampled in the function expression corresponding to the cleaned sample.
9. The method according to claim 6 or 8, characterized in that The score function value is as follows: In the above formula, represents the gradient, p t is the probability density function of the fitted linear noise.
10. A sample purification device based on a diffusion model, characterized in that: The device comprises: An acquisition module, used for acquiring samples to be purified; An analysis module, used for taking the sample to be purified as the input of the pre-trained diffusion model to obtain the purified sample output by the pre-trained diffusion model; Wherein, before training, the diffusion model replaces the U-Net network structure in the diffusion model with the Transformer network structure.
11. The device according to claim 10, characterized in that The training process of the pre-trained diffusion model includes: Obtaining adversarial samples and constructing training data using the adversarial samples; The diffusion model is trained based on the training data to obtain the pre-trained diffusion model.
12. The device according to claim 11, characterized in that The process of training the diffusion model based on the training data adopts a denoising score matching algorithm.
13. The device according to claim 10, characterized in that The diffusion model includes: a forward diffusion module and a reverse generation module; The forward diffusion module is used to add noise to the adversarial sample or the sample to be purified to obtain a noisy sample; The reverse generation module is used to reduce the noise of the noisy sample to obtain a purified sample.
14. The device according to claim 13, characterized in that The noise-added samples are as follows: In the above formula, x(t * ) is the noise sample, α(t * ) is the noise ratio, x a is the adversarial sample or the sample to be purified, ∈ is random noise, t * is the diffusion time step.
15. The device according to claim 14, characterized in that The noise ratio is as follows: In the above formula, e is a natural constant, β is the distribution function of the fitted linear noise, s is the score function value, The expected value is 0 and the variance is I d The normal distribution of I d is the identity matrix.
16. The device according to claim 14, characterized in that The purified samples are as follows: In the above formula, To purify the sample, sdeint is the numerical integration function, x(t * ) is the noise sample, f rev is the reverse drift coefficient, g rev is the reverse diffusion coefficient, is random noise.
17. The device according to claim 16, characterized in that The reverse drift coefficient is as follows: The reverse diffusion coefficient is as follows: In the above formula, β is the distribution function of the fitted linear noise, s is the score function value, is the value vector sampled in the function expression corresponding to the cleaned sample.
18. The device according to claim 15 or 17, characterized in that The score function value is as follows: In the above formula, represents the gradient, p t is the probability density function of the fitted linear noise.
19. A computer device, characterized in that: include: one or more processors; The processor is configured to execute one or more programs; When the one or more programs are executed by the one or more processors, the sample purification method based on the diffusion model as claimed in any one of claims 1 to 9 is implemented.
20. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed, the sample purification method based on the diffusion model as claimed in any one of claims 1 to 9 is implemented.