Data processing method and device

By processing the output of the student model and the noisy output using the teacher model, and constructing a loss function to update the student model, the problems of high latency and computational cost of the diffusion model are solved, and the sampling efficiency and output quality of the student model are improved.

CN121503540APending Publication Date: 2026-02-10HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411096304.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-09
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

Diffusion models require dozens or even hundreds of iterations of sampling during inference, resulting in high latency and computational costs. Furthermore, existing knowledge distillation techniques struggle to effectively transfer prior knowledge from the teacher model to the student model, leading to lower output quality from the distilled student model.

Method used

The teacher model processes the output of the student model and the noisy output, constructs a loss function and updates the student model, and uses the teacher model to process the original image, avoiding the introduction of meaningless gradient directions and improving the quality of the distilled student model.

Benefits of technology

Without introducing a new model, the training process was simplified, and the sampling efficiency and output quality of the student model were improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121503540A_ABST
    Figure CN121503540A_ABST
Patent Text Reader

Abstract

The data processing method is applied to the field of artificial intelligence and comprises the steps of obtaining first data; according to the first data, a first processing result and a second processing result are obtained through a first model and a second model respectively, the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model; performing noise addition on the first processing result and the second processing result to obtain a first noise addition result and a second noise addition result; denoising the first noise adding result through the first model to obtain a first denoising result; denoising the second noise adding result through the first model to obtain a second denoising result; and obtaining a first loss according to the first denoising result and the second denoising result, and updating the second model according to the first loss. The quality of the student model after distillation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of artificial intelligence, and more particularly to a data processing method and apparatus thereof. Background Technology

[0002] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.

[0003] Diffusion models, as a novel generative model, have attracted increasing attention due to their ability to model complex data distributions and are gradually replacing generative adversarial models in various downstream tasks. However, diffusion models require tens or even hundreds of iterative samplings during inference to refine the model's output, resulting in high latency and computational costs, posing a significant challenge to the model's deployment and application. To address this issue, existing methods compress the sampling path of diffusion models by redesigning the diffusion process, using high-order numerical solvers, and employing knowledge distillation techniques.

[0004] Among these methods, knowledge distillation is currently the mainstream approach to accelerate diffusion model sampling because it has the potential to accelerate sampling efficiency while maintaining model performance. Furthermore, this technique can be generalized to different diffusion models, exhibiting strong generalization ability. However, existing knowledge distillation techniques for diffusion models require the teacher model to process the noisy output of the student model to obtain the teacher model's output, and then align the teacher and student model outputs. However, the teacher model's output is highly similar to real high-resolution images, and existing methods introduce meaningless gradient directions into the student model, making it difficult to effectively transfer the teacher model's prior knowledge to the student model. This results in low-quality output data from the distilled student model. Summary of the Invention

[0005] In a first aspect, this application provides a data processing method, the method comprising: acquiring first data; obtaining a first processing result and a second processing result based on the first data using a first model and a second model respectively, wherein the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model; adding noise to the first processing result and the second processing result respectively to obtain a first denoised result and a second denoised result; denoising the first denoised result using the first model to obtain a first denoised result; denoising the second denoised result using the first model to obtain a second denoised result; obtaining a first loss based on the first denoised result and the second denoised result, and updating the second model based on the first loss.

[0006] Existing score distillation sampling methods inherently introduce meaningless gradient directions into the student model (since the teacher model processes the noisy output of the student model, which struggles to accurately predict the noise added to the student model's output), leading to problems such as blurred output and oversaturation. Existing distribution matching distillation methods require training a new diffusion model to learn the score function of samples generated by the student model and updating the generator based on the difference between the score function predicted by the new model and the score function predicted by the teacher model. However, this approach involves a complex training process, requiring alternating training between the student model and the new diffusion model.

[0007] In this embodiment, in order to simply and effectively eliminate the bias (existing in score distillation sampling) and provide a clear gradient direction for the optimization of the student model, the diffusion model, acting as the teacher, processes the noisy output of the student model while simultaneously processing the original image (consistent with the student model). Then, the teacher model is used to process the noisy output of the teacher model, and the two results obtained from the teacher model are used to construct the loss and update the student model. Thus, without introducing a new model, no meaningless gradient direction is introduced into the student model, thereby improving the quality of the distilled student model.

[0008] In one possible implementation, the first processing result and the second processing result are at least one of the following: denoised score, data enhanced from the first data, or predicted noise.

[0009] In one possible implementation, the step of adding noise to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result includes: adding noise to the first processing result and the second processing result respectively for a target step size to obtain a first noise-added result and a second noise-added result; the step of denoising the first noise-added result using the first model to obtain a first denoised result, and denoising the second noise-added result using the first model to obtain a second denoised result includes: denoising the first noise-added result using the first model for the target step size to obtain a first denoised result, and denoising the second noise-added result using the first model for the target step size to obtain a second denoised result.

[0010] In one possible implementation, the target step size is obtained by sampling within a preset step size range, wherein all step sizes within the preset step size range are less than one-quarter of the total denoising step size.

[0011] By sampling noise at small time steps, the ability of student models to generate high-frequency details in images can be enhanced.

[0012] In one possible implementation, the method further includes:

[0013] Obtain the second data, which is the truth value data corresponding to the first data;

[0014] The second data is then subjected to noise to obtain the third noise-added result;

[0015] Based on the third noise-adding result and the second noise-adding result, the first feature and the second feature are obtained respectively through the encoding network in the first model;

[0016] Based on the first feature and the second feature, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0017] Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model is updated based on the second loss.

[0018] In one possible implementation, obtaining a first discrimination result and a second discrimination result respectively through a discriminator based on the first feature and the second feature includes:

[0019] The target step size is mapped using a mapping network to obtain the first parameter;

[0020] The first parameter is fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result;

[0021] Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0022] In one possible implementation, the first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature.

[0023] The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different;

[0024] The step of fusing the first parameter with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result includes:

[0025] The first sub-parameter and the first sub-feature are fused together, and the second sub-parameter and the second sub-feature are fused together to obtain a first fusion result.

[0026] In one possible implementation, the second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature.

[0027] The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different;

[0028] The step of fusing the first parameter with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result includes:

[0029] The first sub-parameter and the third sub-feature are fused together, and the second sub-parameter and the fourth sub-feature are fused together to obtain a second fusion result.

[0030] Unlike methods that directly use features extracted by a diffusion model to discriminate data, this approach considers the strong correlation between the features (or output) extracted by the diffusion model and the time step. A time modulation module is designed to map time information into embeddings and modulate the corresponding multi-scale features, adaptively adjusting the information intensity derived from the features. Finally, synthetic data is distinguished from real data based on the modulated features, thereby improving the data processing accuracy of the trained student model.

[0031] In one possible implementation, obtaining the second loss based on the first discrimination result and the second discrimination result, and updating the second model based on the second loss, includes:

[0032] Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model, the mapping network, and the discriminator are updated based on the second loss.

[0033] In one possible implementation, the first data is an image, and the first processing result and the second processing result are enhanced images.

[0034] Secondly, this application provides a data processing apparatus, the apparatus comprising:

[0035] The acquisition module is used to acquire the first data;

[0036] The processing module is used to obtain a first processing result and a second processing result based on the first data through a first model and a second model, respectively, wherein the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model;

[0037] Noise is added to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result;

[0038] The first noise result is denoised using the first model to obtain the first denoised result.

[0039] The second noise-adding result is denoised using the first model to obtain the second denoised result;

[0040] Based on the first denoising result and the second denoising result, a first loss is obtained, and the second model is updated based on the first loss.

[0041] In one possible implementation, the first processing result and the second processing result are at least one of the following:

[0042] The denoising score, the data after augmentation of the first data, or the predicted noise.

[0043] In one possible implementation, the processing module is specifically used for:

[0044] The first processing result and the second processing result are respectively denoised by the target step size to obtain the first denoised result and the second denoised result;

[0045] Using the first model, the first noise-adding result is denoised at the target step size to obtain a first denoised result. Using the first model, the second noise-adding result is denoised at the target step size to obtain a second denoised result.

[0046] In one possible implementation, the target step size is obtained by sampling within a preset step size range, wherein all step sizes within the preset step size range are less than one-quarter of the total denoising step size.

[0047] In one possible implementation, the acquisition module is further configured to:

[0048] Obtain the second data, which is the truth value data corresponding to the first data;

[0049] The processing module is further configured to:

[0050] The second data is then subjected to noise to obtain the third noise-added result;

[0051] Based on the third noise-adding result and the second noise-adding result, the first feature and the second feature are obtained respectively through the encoding network in the first model;

[0052] Based on the first feature and the second feature, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0053] Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model is updated based on the second loss.

[0054] In one possible implementation, the processing module is specifically used for:

[0055] The target step size is mapped using a mapping network to obtain the first parameter;

[0056] The first parameter is fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result;

[0057] Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0058] In one possible implementation, the first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature.

[0059] The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different;

[0060] The processing module is specifically used for:

[0061] The first sub-parameter and the first sub-feature are fused together, and the second sub-parameter and the second sub-feature are fused together to obtain a first fusion result.

[0062] In one possible implementation, the second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature.

[0063] The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different;

[0064] The processing module is specifically used for:

[0065] The first sub-parameter and the third sub-feature are fused together, and the second sub-parameter and the fourth sub-feature are fused together to obtain a second fusion result.

[0066] In one possible implementation, the processing module is specifically used for:

[0067] Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model, the mapping network, and the discriminator are updated based on the second loss.

[0068] In one possible implementation, the first data is an image, and the first processing result and the second processing result are enhanced images.

[0069] Thirdly, embodiments of this application provide a data processing apparatus, which may include a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the first aspect above and any of its optional methods.

[0070] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any optional methods thereof, as well as the methods described in the second aspect and any optional methods thereof.

[0071] Fifthly, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any optional methods thereof, as well as the methods described in the second aspect and any optional methods thereof.

[0072] In another aspect, this application provides a chip system including a processor for supporting an execution data processing device in implementing the functions involved in the above aspects, such as transmitting or processing data involved in the above methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the execution device or training device. This chip system may be composed of chips or may include chips and other discrete devices. Attached Figure Description

[0073] Figure 1A A structural diagram illustrating the main framework of artificial intelligence;

[0074] Figure 1B Hezhi Figure 1C This is a schematic diagram of the application system framework of the present invention;

[0075] Figure 1D This is a schematic diagram of an optional hardware structure for a terminal.

[0076] Figure 2 This is a schematic diagram of the structure of a server;

[0077] Figure 3 This is a schematic diagram of a system architecture according to this application;

[0078] Figure 4 A process for providing a cloud service;

[0079] Figure 5 A flowchart illustrating a data processing method provided in an embodiment of this application;

[0080] Figure 6 A schematic diagram of a data processing method provided in an embodiment of this application;

[0081] Figure 7 A schematic diagram of a data processing method provided in an embodiment of this application;

[0082] Figure 8 A schematic diagram of a data processing method provided in an embodiment of this application;

[0083] Figures 9A to 9B A schematic diagram of the architecture of the method provided in the embodiments of this application;

[0084] Figure 10 A schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application;

[0085] Figure 11 A schematic diagram of the structure of the execution device provided in the embodiments of this application;

[0086] Figure 12 A schematic diagram of the structure of the training device provided in the embodiments of this application;

[0087] Figure 13 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation

[0088] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the invention.

[0089] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0090] The terms "first," "second," etc., used in the specification, claims, 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 terms can be used interchangeably where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion so as to include a process, method, system, product, or device that comprises a series of elements.

[0091] The terms “substantially,” “about,” and similar terms used herein are used as approximations rather than as terms of degree, and are intended to take into account the inherent biases of measurements or calculations known to those skilled in the art. Furthermore, the use of “may” in describing embodiments of the invention refers to “one or more possible embodiments.” The terms “use,” “using,” and “used” used herein are to be considered synonymous with the terms “utilize,” “utilizing,” and “utilized,” respectively. Additionally, the term “exemplary” is intended to refer to an instance or illustration.

[0092] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1A , Figure 1A The diagram illustrates a structural framework for artificial intelligence (AI). The framework is further elaborated below along two dimensions: the "Intelligent Information Chain" (horizontal axis) and the "IT Value Chain" (vertical axis). The "Intelligent Information Chain" reflects a series of processes from data acquisition to processing. For example, it could be the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. In this process, data undergoes a condensation process of "data—information—knowledge—wisdom." The "IT Value Chain" reflects the value that AI brings to the information technology industry, from the underlying infrastructure of human intelligence and information (provided and processed through technological means) to the industrial ecosystem of the system.

[0093] (1) Infrastructure

[0094] Infrastructure provides computing power to support artificial intelligence systems, enabling communication with the external world and providing support through a basic platform. This communication occurs through sensors; computing power is provided by intelligent chips (hardware acceleration chips such as CPUs, NPUs, GPUs, ASICs, and FPGAs); and the basic platform includes distributed computing frameworks and related platform guarantees and support, which may include cloud storage and computing, interconnected networks, etc. For example, sensors communicate with the outside world to acquire data, and this data is provided to intelligent chips in the distributed computing system provided by the basic platform for computation.

[0095] (2) Data

[0096] The data at the next layer of infrastructure is used to represent the data sources in the field of artificial intelligence. The data involves graphics, images, voice, text, and IoT data from traditional devices, including business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.

[0097] (3) Data processing

[0098] Data processing typically includes methods such as data training, machine learning, deep learning, search, reasoning, and decision-making.

[0099] Among them, machine learning and deep learning can perform intelligent information modeling, extraction, preprocessing, and training on data, including symbolization and formalization.

[0100] Reasoning refers to the process in which, in a computer or intelligent system, the machine thinks and solves problems by simulating human intelligent reasoning, based on reasoning control strategies and using formalized information. Typical functions include search and matching.

[0101] Decision-making refers to the process of making decisions based on intelligent information after reasoning, and it typically provides functions such as classification, sorting, and prediction.

[0102] (4) General ability

[0103] After the data processing mentioned above, the results of the data processing can be used to form some general capabilities, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.

[0104] (5) Smart Products and Industry Applications

[0105] Intelligent products and industry applications refer to products and applications of artificial intelligence systems in various fields. They are the encapsulation of overall artificial intelligence solutions, productizing intelligent information decision-making and realizing practical applications. Their application areas mainly include: intelligent terminals, intelligent transportation, intelligent healthcare, autonomous driving, smart cities, etc.

[0106] This application can be applied to the field of natural language processing in the field of artificial intelligence. The following will introduce several application scenarios that have been implemented in products, taking natural language processing as an example.

[0107] First, we will introduce the application scenarios of this application. This application can be applied, but is not limited to, to applications with image generation capabilities (hereinafter referred to as generation applications) or cloud services provided by cloud-side servers, etc., which will be introduced separately below:

[0108] I. Generating class applications

[0109] The product form of this application embodiment can be a generative application. Generative applications can run on terminal devices or cloud servers.

[0110] In one possible implementation, a generative application can perform image generation tasks and obtain the processed results. For example, text-based image generation tasks. Another example is image enhancement tasks based on images (including but not limited to super-resolution, denoising, and dehazing).

[0111] For example, generative applications can implement image generation tasks that include at least diffusion-based methods, but are not limited to this.

[0112] In one possible implementation, a user can open a generative application installed on a terminal device and input image data and text data (the text may be triggered by an instruction, not necessarily actively input by the user). The generative application can process the image and text using a model trained by the method provided in the embodiments of this application, or by the method provided in the embodiments of this application, and present the processing result to the user (the presentation method may include, but is not limited to, displaying, playing, saving, uploading to the cloud, etc.).

[0113] In one possible implementation, a user can open a generative application installed on a terminal device and input image and text data. The generative application can then send the image and text data to a cloud-based server. The cloud-based server processes the image or text using a model trained by the method provided in this application embodiment and sends the processing result back to the terminal device. The terminal device can then present the processing result to the user (the presentation method may include, but is not limited to, displaying, playing, saving, or uploading to the cloud).

[0114] The following sections will introduce the generated application class in this application embodiment from the perspectives of functional architecture and product architecture that implements the functions.

[0115] Reference Figure 1B , Figure 1B This is a schematic diagram of the functional architecture of the generated application class in the embodiments of this application:

[0116] In one possible implementation, such as Figure 1B As shown, the generative application 102 can receive input parameters 101 (e.g., including images or text) and generate processing results 103. The generative application 102 can be executed on at least one computer system (for example) and includes computer code that, when executed by one or more computers, causes the computers to execute a model trained by the methods provided in the embodiments of this application.

[0117] Reference Figure 1C , Figure 1C This is a schematic diagram of the entity architecture for running the generated application in this embodiment of the application:

[0118] See Figure 1C , Figure 1C A schematic diagram of a system architecture is shown. The system may include a terminal 100 and a server 200. The server 200 may include one or more servers (…). Figure 1C (The example includes a server), where server 200 can provide image synthesis functionality for one or more terminals.

[0119] The terminal 100 may have a generation application installed, or a webpage related to image synthesis or natural language generation functions opened. The application and webpage can provide an interface. The terminal 100 can receive relevant parameters input by the user on the image synthesis or natural language generation function interface and send the parameters to the server 200. The server 200 can obtain the processing result based on the received parameters and return the processing result to the terminal 100.

[0120] It should be understood that in some optional implementations, the terminal 100 can also complete the action of obtaining the processing result based on the received parameters on its own, without the need for the server to cooperate. This application embodiment is not limited to this.

[0121] The following description Figure 1C The product form of the mid-terminal 100;

[0122] The terminal 100 in this application embodiment can be a mobile phone, tablet computer, wearable device, vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc., and this application embodiment does not impose any restrictions on it.

[0123] Figure 1D A schematic diagram of an optional hardware structure for terminal 100 is shown.

[0124] refer to Figure 1D As shown, the terminal 100 may include a radio frequency unit 110, a memory 120, an input unit 130, a display unit 140, a camera 150 (optional), an audio circuit 160 (optional), a speaker 161 (optional), a microphone 162 (optional), a processor 170, an external interface 180, a power supply 190, and other components. Those skilled in the art will understand that... Figure 1D These are merely examples of terminals or multi-functional devices and do not constitute a limitation on terminals or multi-functional devices. They may include more or fewer components than shown in the illustration, or combine certain components, or use different components.

[0125] The input unit 130 can be used to receive input numerical or character information, and to generate key signal inputs related to user settings and function control of the portable multi-functional device. Specifically, the input unit 130 may include a touchscreen 131 (optional) and / or other input devices 132. The touchscreen 131 can collect touch operations performed by the user on or near it (such as operations performed by the user using fingers, knuckles, styluses, or any suitable object on or near the touchscreen), and drive the corresponding connection devices according to a pre-set program. The touchscreen can detect the user's touch actions, convert the touch actions into touch signals and send them to the processor 170, and can receive and execute commands sent by the processor 170; the touch signal includes at least touch point coordinate information. The touchscreen 131 can provide an input interface and an output interface between the terminal 100 and the user. In addition, various types of touchscreens, such as resistive, capacitive, infrared, and surface acoustic wave, can be used to implement the touchscreen. Besides the touchscreen 131, the input unit 130 may also include other input devices. Specifically, other input devices 132 may include, but are not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.

[0126] Other input devices 132 can receive input image data or text data.

[0127] The display unit 140 can be used to display information input by the user or information provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In this embodiment, the display unit 140 can be used to display the interface of a generation-type application, processing results, etc.

[0128] The memory 120 can be used to store instructions and data. The memory 120 may primarily include an instruction storage area and a data storage area. The data storage area can store various types of data, such as multimedia files and text. The instruction storage area can store software units such as operating systems, applications, and instructions required for at least one function, or subsets or extended sets thereof. It may also include non-volatile random access memory. It provides the processor 170 with hardware, software, and data resources for managing the computing device, supporting control software and applications. It is also used for storing multimedia files, as well as storing running programs and applications.

[0129] The processor 170 is the control center of the terminal 100. It connects various parts of the terminal 100 via various interfaces and lines. By running or executing instructions stored in the memory 120 and calling data stored in the memory 120, it performs various functions and processes data of the terminal 100, thereby controlling the terminal device as a whole. Optionally, the processor 170 may include one or more processing units; preferably, the processor 170 may integrate an application processor and a modem processor, wherein the application processor mainly handles the operating system, user interface, and applications, and the modem processor mainly handles wireless communication. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory can be implemented on a single chip; in some embodiments, they can also be implemented separately on independent chips. The processor 170 can also be used to generate corresponding operation control signals, send them to the corresponding components of the computing processing device, read and process data in the software, especially read and process data and programs in the memory 120, so that the various functional modules therein perform corresponding functions, thereby controlling the corresponding components to act according to the instructions.

[0130] The memory 120 can be used to store software code related to the data processing method, and the processor 170 can execute the steps of the chip's data processing method, and can also schedule other units (such as the above-mentioned input unit 130 and display unit 140) to achieve the corresponding functions.

[0131] The radio frequency unit 110 (optional) can be used for receiving and transmitting signals during information transmission or calls. For example, it can receive downlink information from the base station and process it for the processor 170; additionally, it can transmit uplink data to the base station. Typically, the RF circuit includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc. Furthermore, the radio frequency unit 110 can also communicate wirelessly with network devices and other devices. This wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), email, Short Messaging Service (SMS), etc.

[0132] In this embodiment of the application, the radio frequency unit 110 can send image data or text data to the server 200 and receive the processing results sent by the server 200.

[0133] It should be understood that the radio frequency unit 110 is optional and can be replaced with other communication interfaces, such as a network port.

[0134] The terminal 100 also includes a power supply 190 (such as a battery) that supplies power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby enabling functions such as charging, discharging, and power consumption management through the power management system.

[0135] Terminal 100 also includes an external interface 180, which can be a standard Micro USB interface or a multi-pin connector, which can be used to connect terminal 100 to other devices for communication or to connect a charger to charge terminal 100.

[0136] Although not shown, terminal 100 may also include a flash, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with various functions, etc., which will not be described in detail here. Some or all of the methods described below can be applied to, for example... Figure 1D In the terminal 100 shown.

[0137] The following description Figure 1C The product form of the mid-range server 200;

[0138] Figure 2 A structural diagram of a server 200 is provided, as follows: Figure 2 As shown, server 200 includes bus 201, processor 202, communication interface 203, and memory 204. Processor 202, memory 204, and communication interface 203 communicate with each other via bus 201.

[0139] Bus 201 can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 2 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0140] The processor 202 can be any one or more of the following processors: central processing unit (CPU), graphics processing unit (GPU), microprocessor (MP), or digital signal processor (DSP).

[0141] Memory 204 may include volatile memory, such as random access memory (RAM). Memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0142] The memory 204 can be used to store software code related to the data processing method, and the processor 202 can execute the steps of the chip's data processing method, and can also schedule other units to achieve corresponding functions.

[0143] It should be understood that the aforementioned terminal 100 and server 200 can be centralized or distributed devices. The processors (e.g., processor 170 and processor 202) in the aforementioned terminal 100 and server 200 can be hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the processor can be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0144] It should be understood that the steps related to the model inference process in the embodiments of this application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and server is not limited to the processor-memory architecture described above. The following section will further explain... Figure 3 The system architecture provided in the embodiments of this application will be described in detail.

[0145] Figure 3 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 3 As shown, the system architecture 500 includes an execution device 510, a training device 520, a database 530, a client device 540, a data storage system 550, and a data acquisition system 560.

[0146] The execution device 510 includes a calculation module 511, an I / O interface 512, a preprocessing module 513, and a preprocessing module 514. The calculation module 511 may include a target model / rule 501, while the preprocessing modules 513 and 514 are optional.

[0147] The execution device 510 can be a terminal device or server that runs the above-mentioned generation application, or image classification or retrieval application.

[0148] The data acquisition device 560 is used to collect training samples. Training samples can be image data or text data, etc. After collecting the training samples, the data acquisition device 560 stores these training samples in the database 530.

[0149] The training device 520 can maintain training samples in the database 530 and obtain the target model / rule 501 from the neural network to be trained (e.g., the neural network model in the embodiments of this application (e.g., including encoder, generative model (e.g., diffusion model)).

[0150] It should be understood that the training device 520 can perform a pre-training process on the neural network to be trained based on the training samples maintained in the database 530, or fine-tune the model based on the pre-training.

[0151] It should be noted that in practical applications, the training samples maintained in database 530 may not all come from the data acquisition device 560; they may also be received from other devices. Furthermore, it should be noted that training device 520 may not necessarily train the target model / rule 501 entirely based on the training samples maintained in database 530; it may also obtain training samples from the cloud or other sources for model training. The above description should not be construed as limiting the embodiments of this application.

[0152] The target model / rule 501 trained using training device 520 can be applied to different systems or devices, such as... Figure 3 The execution device 510 shown can be a terminal, such as a mobile phone terminal, tablet computer, laptop computer, augmented reality (AR) / virtual reality (VR) device, vehicle terminal, etc., or it can be a server, etc.

[0153] Specifically, the training device 520 can transfer the trained model to the execution device 510.

[0154] exist Figure 3 In the execution device 510, an input / output (I / O) interface 512 is configured for data interaction with external devices. Users can input data (such as image data or text data in this embodiment) into the I / O interface 512 through the client device 540.

[0155] Preprocessing modules 513 and 514 are used to preprocess the input data received from the I / O interface 512. It should be understood that preprocessing modules 513 and 514 may be absent, or only one preprocessing module may be used. When preprocessing modules 513 and 514 are absent, the calculation module 511 can be used directly to process the input data.

[0156] During the preprocessing of input data by the execution device 510, or during the calculation module 511 of the execution device 510 performing calculations and other related processes, the execution device 510 can call data, code, etc. in the data storage system 550 for corresponding processing, or store the data, instructions, etc. obtained from the corresponding processing into the data storage system 550.

[0157] Finally, the I / O interface 512 provides the processing result to the client device 540, thereby providing it to the user.

[0158] exist Figure 3 In the illustrated scenario, the user can manually provide input data, which can be done through the interface provided by I / O interface 512. Alternatively, the client device 540 can automatically send input data to I / O interface 512. If user authorization is required for the client device 540 to automatically send input data, the user can set the corresponding permissions in the client device 540. The user can view the output results of the execution device 510 on the client device 540, which can be presented in various ways such as display, sound, or animation. The client device 540 can also act as a data acquisition terminal, collecting the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530. Alternatively, data can be collected directly from the I / O interface 512 without going through the client device 540, using the input data and output results of the input I / O interface 512 as shown in the figure, and storing them as new sample data in database 530.

[0159] It is worth noting that, Figure 3 This is merely a schematic diagram of a system architecture provided in an embodiment of this application. The positional relationships between the devices, components, modules, etc., shown in the diagram do not constitute any limitation. For example, in Figure 3 In this context, the data storage system 550 is an external storage device relative to the execution device 510. However, in other cases, the data storage system 550 may also be placed within the execution device 510. It should be understood that the aforementioned execution device 510 may be deployed within the client device 540.

[0160] From the inference side of the model:

[0161] In this embodiment of the application, the computing module 511 of the execution device 510 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in this embodiment of the application.

[0162] In this embodiment of the application, the computing module 511 of the execution device 510 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0163] Specifically, the computing module 511 of the execution device 510 can be a hardware system with the function of executing instructions. The steps related to the model inference process provided in this application embodiment can be software code stored in the memory. The computing module 511 of the execution device 510 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model inference process provided in this application embodiment.

[0164] It should be understood that the computing module 511 of the execution device 510 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the model reasoning process provided in the embodiments of this application can also be implemented by the hardware system in the computing module 511 of the execution device 510 without the function of executing instructions, which is not limited here.

[0165] From the training side of the model:

[0166] In this embodiment of the application, the training device 520 can access the memory ( Figure 3 (Not shown in the diagram, but can be integrated into the training device 520 or deployed separately from the training device 520) The code stored in the diagram can be used to implement the steps related to model training in the embodiments of this application.

[0167] In this embodiment of the application, the training device 520 may include hardware circuits (such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), general-purpose processors, digital signal processors (DSPs), microprocessors or microcontrollers, etc.) or combinations of these hardware circuits. For example, the training device 520 may be a hardware system with instruction execution capabilities, such as a CPU or DSP, or a hardware system without instruction execution capabilities, such as an ASIC or FPGA, or a combination of the aforementioned hardware systems without instruction execution capabilities and hardware systems with instruction execution capabilities.

[0168] It should be understood that the training device 520 can be a combination of a hardware system without the function of executing instructions and a hardware system with the function of executing instructions. Some steps related to the training of the neutralization model provided in the embodiments of this application can also be implemented by the hardware system in the training device 520 without the function of executing instructions, which is not limited here.

[0169] III. Cloud services providing image compositing functionality:

[0170] In one possible implementation, the server can provide image compositing services to the client side via an application programming interface (API).

[0171] In this process, the terminal device can send relevant parameters (such as images, text, and other data) to the server through the API provided by the cloud. The server can then obtain the processing results based on the received parameters and return the processing results to the terminal.

[0172] The description of the terminal and server can be found in the above embodiments, and will not be repeated here.

[0173] like Figure 4 The process of using an image compositing function cloud service provided by a cloud platform is illustrated.

[0174] 1. Activate and purchase content moderation services.

[0175] 2. Users can download the software development kit (SDK) corresponding to the content moderation service. Cloud platforms usually provide multiple development versions of the SDK for users to choose from according to their development environment needs, such as JAVA version SDK, Python version SDK, PHP version SDK, Android version SDK, etc.

[0176] 3. After downloading the corresponding version of the SDK to their local machine according to their needs, users can import the SDK project into their local development environment, configure and debug it in the local development environment, and develop other functions in the local development environment to form an application that integrates image synthesis capabilities.

[0177] 4. When an application needs to perform image compositing, it can trigger an API call for the image compositing function. When the application triggers the image compositing function, it sends an API request to the running instance of the image compositing service in the cloud environment. The API request carries an image or text, which is then processed by the running instance in the cloud environment to obtain the result.

[0178] 5. The cloud environment returns the processing results to the application, thus completing one image compositing function call.

[0179] Since the embodiments of this application involve a large number of neural network applications, for ease of understanding, the relevant terms and concepts such as neural networks involved in the embodiments of this application will be introduced below.

[0180] (1) Neural Network

[0181] A neural network can be composed of neural units, which can be defined as a computational unit that takes xs (i.e., input data) and an intercept of 1 as input. The output of this computational unit can be:

[0182]

[0183] Where s = 1, 2, ..., n, where n is a natural number greater than 1, Ws is the weight of xs, and b is the bias of the neural unit. f is the activation function of the neural unit, used to introduce nonlinear characteristics into the neural network to convert the input signal in the neural unit into an output signal. The output signal of this activation function can be used as the input of the next convolutional layer, and the activation function can be the sigmoid function. A neural network is a network formed by connecting multiple of the above-mentioned individual neural units together, that is, the output of one neural unit can be the input of another neural unit. The input of each neural unit can be connected to the local receptive field of the previous layer to extract the features of the local receptive field, which can be a region composed of several neural units.

[0184] (2) Deep Neural Networks

[0185] Deep Neural Networks (DNNs), also known as multilayer neural networks, can be understood as neural networks with many hidden layers, though there's no specific metric for "many." DNNs can be categorized into three layers based on their position: input layers, hidden layers, and output layers. Generally, the first layer is the input layer, the last layer is the output layer, and the layers in between are hidden layers. All layers are fully connected, meaning that any neuron in the i-th layer is connected to any neuron in the (i+1)-th layer. Although DNNs appear complex, the operation of each layer is actually quite simple, resembling a linear relationship as follows: in, It is the input vector. It is the output vector. α is the offset vector, W is the weight matrix (also called coefficients), and α() is the activation function. Each layer is simply an adjustment of the input vector. The output vector is obtained through such a simple operation. Because DNNs have many layers, the coefficients W and the offset vector... The number of these parameters is therefore quite large. The definitions of these parameters in a DNN are as follows: Taking the coefficient W as an example: Assuming a three-layer DNN, the linear coefficient from the 4th neuron in the second layer to the 2nd neuron in the third layer is defined as... The superscript 3 represents the layer number where coefficient W resides, while the subscript corresponds to the output third layer index 2 and the input second layer index 4. In summary, the coefficients from the k-th neuron in layer L-1 to the j-th neuron in layer L are defined as follows: It's important to note that the input layer does not have a W parameter. In deep neural networks, more hidden layers allow the network to better represent complex real-world situations. Theoretically, the more parameters a model has, the higher its complexity and "capacity," meaning it can perform more complex learning tasks. Training a deep neural network is essentially the process of learning the weight matrix, with the ultimate goal of obtaining the weight matrix of all layers in the trained deep neural network (a weight matrix formed by the vectors W from many layers).

[0186] (3) Loss Function

[0187] In training a deep neural network, to ensure the output closely approximates the desired predicted value, we compare the network's prediction with the target value. Based on the difference, we update the weight vector of each layer (usually pre-configuring parameters before the initial update). For example, if the prediction is too high, the weight vector is adjusted to predict a lower value. This adjustment continues until the deep neural network predicts the target value or a value very close to it. Therefore, we need to predefine "how to compare the difference between the predicted and target values," which is the loss function or objective function. These are important equations used to measure the difference between the predicted and target values. Taking the loss function as an example, a higher output value (loss) indicates a greater difference, and training the deep neural network becomes a process of minimizing this loss.

[0188] (4) Backpropagation algorithm

[0189] Backpropagation (BP) can be used during training to correct the parameters in the initial model, thereby reducing the model's error loss. Specifically, forward propagation of the input signal to the output generates error loss; this error loss information is then propagated back to update the parameters in the initial model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining optimal model parameters, such as the weight matrix.

[0190] (5) Diffusion model

[0191] A diffusion model is a generative model used to generate data such as images and text. The core idea of ​​a diffusion model is to diffuse noise into the data and then gradually remove the noise to recover the original data. The diffusion model consists of two stages: a forward process (noise diffusion) and a reverse process (noise removal and recovery).

[0192] Diffusion models, as a novel generative model, have attracted increasing attention due to their ability to model complex data distributions and are gradually replacing generative adversarial models in various downstream tasks. However, diffusion models require tens or even hundreds of iterative samplings during inference to refine the model's output, resulting in high latency and computational costs, posing a significant challenge to the model's deployment and application. To address this issue, existing methods compress the sampling path of diffusion models by redesigning the diffusion process, using high-order numerical solvers, and employing knowledge distillation techniques.

[0193] Among these methods, knowledge distillation is currently the mainstream approach to accelerate diffusion model sampling because it has the potential to accelerate sampling efficiency while maintaining model performance. Furthermore, this technique can be generalized to different diffusion models, exhibiting strong generalization ability. However, existing knowledge distillation techniques for diffusion models require the teacher model to process the noisy output of the student model to obtain the teacher model's output, and then align the teacher and student model outputs. However, the teacher model's output is highly similar to real high-resolution images, and existing methods introduce meaningless gradient directions into the student model, making it difficult to effectively transfer the teacher model's prior knowledge to the student model. This results in low-quality output data from the distilled student model.

[0194] The data processing method of this application embodiment will be described in detail below with reference to the accompanying drawings.

[0195] Reference Figure 5 , Figure 5 This is a flowchart illustrating a data processing method provided in an embodiment of this application, such as... Figure 5 As shown in the embodiment of this application, a data processing method may include steps 501 to 506, which are described in detail below.

[0196] 501. Obtain the first data.

[0197] Figure 5 A corresponding implementation could be the training process of a model (e.g., a diffusion model), such as model pre-training or model fine-tuning.

[0198] Specifically, the training process can be described as knowledge distillation. For a given diffusion model (i.e., the teacher model), a student model with the same network structure is first initialized using the teacher model.

[0199] The diffusion model can generate corresponding data based on the input data. For example, the first data can be the original input of the training samples (the second data can be the ground truth data corresponding to the first data). For instance, when the processing task is image super-resolution, the first data can be a low-resolution image, and the second data can be high-resolution data. The input data can be text, and the diffusion model can be a text graph model that generates images that include the semantic content indicated by the input text.

[0200] 502. Based on the first data, a first processing result and a second processing result are obtained through a first model and a second model, respectively, wherein the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model;

[0201] The original data is input into two models. First, the single-step output of the student model and the multi-step output of the teacher model are displayed in a normal distillation manner.

[0202] In one possible implementation, the first processing result and the second processing result are at least one of the following: a denoised score (also known as a score function of the first data distribution), data after augmentation of the first data, or prediction noise.

[0203] In one possible implementation, the specific structure of the diffusion model is not limited in the embodiments of this application.

[0204] 503. Add noise to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result;

[0205] 504. Using the first model, the first noise-adding result is denoised to obtain the first denoised result;

[0206] 505. Using the first model, the second noise-added result is denoised to obtain the second denoised result;

[0207] In one possible implementation, the outputs of the two models can be re-noiseed, and the performance of the student model can be further improved using the high-frequency enhanced consistency score distillation method proposed in the embodiments of this application.

[0208] In one possible implementation, the first processing result and the second processing result can be denoised at the target step size to obtain a first denoised result and a second denoised result. Similarly, the first denoised result can be denoised at the target step size using the first model to obtain a first denoised result, and the second denoised result can be denoised at the target step size using the first model to obtain a second denoised result. That is, the same step size (t) is used in both the denoising and denoising processes.

[0209] In one possible implementation, the target step size is obtained by sampling within a preset step size range, wherein all step sizes within the preset step size range are less than one-quarter of the total denoising step size.

[0210] like Figure 7 As shown in the second row, the denoising scores of the teacher model and the student model differ significantly mainly at small time steps. Since the diffusion model focuses primarily on high-frequency details of the image at small time steps, this indicates that the image generated by the student model is significantly inferior in terms of high-frequency details compared to the image generated by the teacher model. Therefore, this application proposes to optimize the student model by calculating the difference in denoising scores between the outputs of the teacher model and the student model under slight noise interference, thereby enhancing the student model's ability to accurately capture and reproduce high-frequency details. Specifically, embodiments of this application apply slight noise (i.e., noise added at small steps) to perturb the outputs of the student model and the teacher model, and model their data distributions (i.e., predict their score functions) using the teacher model.

[0211] 506. Based on the first denoising result and the second denoising result, obtain the first loss, and update the second model based on the first loss.

[0212] Existing score distillation sampling methods inherently introduce meaningless gradient directions into the student model (since the teacher model processes the noisy output of the student model, which struggles to accurately predict the noise added to the student model's output), leading to problems such as blurred output and oversaturation. Existing distribution matching distillation methods require training a new diffusion model to learn the score function of samples generated by the student model and updating the generator based on the difference between the score function predicted by the new model and the score function predicted by the teacher model. However, this approach involves a complex training process, requiring alternating training between the student model and the new diffusion model.

[0213] In this embodiment, in order to simply and effectively eliminate the bias (existing in score distillation sampling) and provide a clear gradient direction for the optimization of the student model, the diffusion model, acting as the teacher, processes the noisy output of the student model while simultaneously processing the original image (consistent with the student model). Then, the teacher model is used to process the noisy output of the teacher model, and the two results obtained from the teacher model are used to construct the loss and update the student model. Thus, without introducing a new model, no meaningless gradient direction is introduced into the student model, thereby improving the quality of the distilled student model.

[0214] The method described in this application is primarily used to accelerate the sampling efficiency of diffusion models. One application framework of this application can be as follows: Figure 6 As shown, it mainly consists of a teacher model, a student model, and a discriminator (including a time modulation part and a discriminator head). During training, the single-step output of the student model and the multi-step output of the teacher model are first constrained, transferring the knowledge of the teacher model to the student model (e.g., ...). Figure 6 (As shown in the upper left part). Subsequently, this application introduces slight noise into the samples generated by the student model and the teacher model, predicts the score function (or other form of output) through the teacher model, and uses the difference between the two score functions to guide the optimization of the student network (e.g. Figure 6 (As shown in the upper right part). Furthermore, to alleviate the performance constraints of the teacher model on the student model, this application designs a time-aware discriminator based on the pre-trained teacher model, enhancing the perceptual quality of generated samples through adversarial training in the latent space (e.g., Figure 6 (As shown in the lower middle section).

[0215] Unlike score distillation sampling ( Figure 8 In (a) of this application, the gradient between the student model's output and its output predicted by the teacher model is not calculated, thus avoiding bias caused by the diffusion model itself. (Distribution-matched distillation) Figure 8 Unlike (b), this embodiment does not require training a new diffusion model to eliminate the unavoidable deviation between the diffusion model's predictions and the true values. This embodiment fully utilizes the potential of the teacher model, optimizing the student model by calculating the score difference between the outputs of the teacher and student models under noise perturbation. This eliminates sampling bias from score distillation and reduces computational overhead. Furthermore, compared to the two techniques described above, this embodiment enhances the student model's ability to generate high-frequency details in images by sampling noise at small time steps.

[0216] In one possible implementation, a second set of data can be obtained, which is the ground truth data corresponding to the first data; noise is added to the second set of data to obtain a third noise-added result; based on the third noise-added result and the second noise-added result, a first feature and a second feature are obtained respectively through the encoding network in the first model; based on the first feature and the second feature, a first discrimination result and a second discrimination result are obtained respectively through a discriminator; based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model is updated based on the second loss.

[0217] In one possible implementation, the target step size is mapped using a mapping network to obtain a first parameter; the first parameter is then fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result.

[0218] Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0219] In one possible implementation, the first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature; the first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; the first sub-parameter and the first sub-feature are fused, and the second sub-parameter and the second sub-feature are fused to obtain a first fusion result.

[0220] In one possible implementation, the second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature; the first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; the first sub-parameter and the third sub-feature are fused, and the second sub-parameter and the fourth sub-feature are fused to obtain a second fusion result.

[0221] In one possible implementation, the target step size can be mapped using a mapping network to obtain a first parameter; the first parameter is then fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result.

[0222] Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0223] In one possible implementation, the first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature; the first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; the first sub-parameter and the first sub-feature can be fused, and the second sub-parameter and the second sub-feature can be fused to obtain a first fusion result.

[0224] In one possible implementation, the second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature; the first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; the first sub-parameter and the third sub-feature are fused, and the second sub-parameter and the fourth sub-feature are fused to obtain a second fusion result.

[0225] In one possible implementation, a second loss is obtained based on the first discrimination result and the second discrimination result, and the second model, the mapping network, and the discriminator are updated based on the second loss.

[0226] Existing techniques can distinguish between the distributions of synthetic and real data after perturbation in the latent space; however, they ignore the strong correlation between the output of the diffusion model and the time step, resulting in limited discriminator performance. This application's embodiments utilize a pre-trained teacher model to design a time-aware discriminator. For example... Figure 9A As shown, during the training phase, the outputs of the real images and the student network are re-noised in the latent space and input into the pre-trained teacher model to extract multi-scale features. It is noteworthy that the information contained in these features is highly correlated with the noisy time step; therefore, this embodiment designs a time modulation module to map the time information into two sets of learnable parameters β. k ,γ k (These correspond to weights and biases, respectively). These two sets of parameters modulate the corresponding multi-scale features, adaptively adjusting the information intensity derived from the features. Finally, the features at each scale are input into an independent discriminator for discrimination, and the output is obtained by averaging the results of all discriminators.

[0227] The discriminator in this embodiment distinguishes between synthetic and real data in the latent space. Furthermore, unlike methods that directly use features extracted by the diffusion model to distinguish data, this approach considers the strong correlation between the features (or output) extracted by the diffusion model and the time step. A time modulation module is designed to map time information into embeddings and modulate the corresponding multi-scale features, adaptively adjusting the information intensity derived from the features. Finally, synthetic and real data are distinguished based on the modulated features, thereby improving the data processing accuracy of the trained student model.

[0228] For example, the block diagram illustrating the structure of the embodiments of this application can be as follows: Figure 9B As shown, for a given diffusion model (i.e., the teacher model), a student model with the same network structure is first initialized using the teacher model. Based on this, the original data is input into both models respectively. First, the single-step output of the aligned student model and the multi-step output of the teacher model are displayed using a standard distillation method. Then, noise is added to the outputs of both models, and the high-frequency enhanced consistency score distillation method proposed in this application is used to further improve the performance of the student model. In addition, a time-aware discriminator proposed in this invention is used to distinguish between synthetic and target data, and the student model is supervised through generative adversarial training. In this application embodiment, diffusion model distillation for super-resolution is implemented, but the solution of this invention is not limited to this task.

[0229] There are two main types of super-resolution networks based on diffusion models: one is a super-resolution network trained from scratch using diffusion loss, and the other is a fine-tuning-based super-resolution network. When the first type of super-resolution network is used as the teacher model, during training, the student model is initialized using the weights of the teacher model and trained using ordinary distillation loss as well as the two losses proposed in this invention. All parameters of the student network are updated using gradients. After optimization, the student model can generate high-resolution images through a single-step inference.

[0230] Furthermore, when implementing high-frequency enhanced consistency score distillation, the differences in denoising scores between teacher and student models at different levels of noise can be calculated uniformly, or the differences in denoising scores under specific noise intensities can be calculated with emphasis on constraints.

[0231] The beneficial effects of the embodiments of this application will be described below with reference to experiments.

[0232] On multiple given datasets for low-level computer vision tasks (general image super-resolution and blind face restoration), the embodiments of this application are compared with the state-of-the-art general image super-resolution algorithms and blind face restoration algorithms, and have the following beneficial effects.

[0233] Table 1 compares the objective metrics of different image super-resolution methods on the synthetic dataset ImageNet-test, a general image super-resolution task. The numbers after the methods represent the number of sampling steps of the diffusion model, and * indicates that the result was obtained by reproducing the original method.

[0234] Table 1

[0235]

[0236] Table 2 compares the objective metrics of different image super-resolution methods on two real datasets for a general image super-resolution task.

[0237] Table 2

[0238]

[0239] Table 3 compares the objective metrics of different face restoration methods on the synthetic dataset CelebA-test for the blind face restoration task.

[0240] Table 3

[0241]

[0242] Table 4 compares the objective metrics of different face restoration methods on three real-world datasets for the blind face restoration task.

[0243] Table 4

[0244]

[0245] In experiments on general image super-resolution tasks, the method of this invention performs comparably to state-of-the-art methods on synthetic datasets and multiple real datasets, and significantly outperforms existing methods on metrics that are close to human subjective perception.

[0246] In experiments on blind face reconstruction, the method of this invention performed comparably to state-of-the-art methods on synthetic datasets and multiple real face datasets.

[0247] In terms of subjective visual effect, the method of the present invention is superior to existing methods in generating fine details such as animal fur and human face texture.

[0248] Compared to existing super-resolution methods based on diffusion models, the method in this application can generate high-resolution images through a single-step inference process, which greatly improves the inference efficiency of the model.

[0249] Table 5 shows a schematic diagram of the ablation experiment.

[0250] Table 5

[0251]

[0252] As shown in Table 5, compared with (a) and (b), the high-frequency enhanced consistency score distillation strategy in this application embodiment guides the optimization of the student model by calculating the difference between the scores of the teacher model output and the student model output under slight noise perturbation, thereby improving the performance of the student model.

[0253] Compared with (c) and (d) in Table 5, the time-aware discriminator in this embodiment of the application distinguishes between synthetic and real data (t-GAN), which significantly improves the performance of the model while reducing the training cost of generative adversarial methods.

[0254] Reference Figure 10 , Figure 10 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this application, such as... Figure 10 As shown in the embodiment of this application, a data processing apparatus 1000 is provided, the apparatus comprising:

[0255] Module 1001 is used to acquire the first data;

[0256] For a detailed description of the acquisition module 1001, please refer to the description of step 501 in the above embodiment, which will not be repeated here.

[0257] Processing module 1002 is used to obtain a first processing result and a second processing result based on the first data through a first model and a second model, respectively, wherein the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model;

[0258] Noise is added to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result;

[0259] The first noise result is denoised using the first model to obtain the first denoised result.

[0260] The second noise-adding result is denoised using the first model to obtain the second denoised result;

[0261] Based on the first denoising result and the second denoising result, a first loss is obtained, and the second model is updated based on the first loss.

[0262] For a detailed description of the processing module 1002, please refer to the description of steps 502 to 506 in the above embodiments, which will not be repeated here.

[0263] In one possible implementation, the first processing result and the second processing result are at least one of the following:

[0264] The denoising score, the data after augmentation of the first data, or the predicted noise.

[0265] In one possible implementation, the processing module is specifically used for:

[0266] The first processing result and the second processing result are respectively denoised by the target step size to obtain the first denoised result and the second denoised result;

[0267] Using the first model, the first noise-adding result is denoised at the target step size to obtain a first denoised result. Using the first model, the second noise-adding result is denoised at the target step size to obtain a second denoised result.

[0268] In one possible implementation, the target step size is obtained by sampling within a preset step size range, wherein all step sizes within the preset step size range are less than one-quarter of the total denoising step size.

[0269] In one possible implementation, the acquisition module is further configured to:

[0270] Obtain the second data, which is the truth value data corresponding to the first data;

[0271] The processing module is further configured to:

[0272] The second data is then subjected to noise to obtain the third noise-added result;

[0273] Based on the third noise-adding result and the second noise-adding result, the first feature and the second feature are obtained respectively through the encoding network in the first model;

[0274] Based on the first feature and the second feature, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0275] Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model is updated based on the second loss.

[0276] In one possible implementation, the processing module is specifically used for:

[0277] The target step size is mapped using a mapping network to obtain the first parameter;

[0278] The first parameter is fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result;

[0279] Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

[0280] In one possible implementation, the first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature.

[0281] The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different;

[0282] The processing module is specifically used for:

[0283] The first sub-parameter and the first sub-feature are fused together, and the second sub-parameter and the second sub-feature are fused together to obtain a first fusion result.

[0284] In one possible implementation, the second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature.

[0285] The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different;

[0286] The processing module is specifically used for:

[0287] The first sub-parameter and the third sub-feature are fused together, and the second sub-parameter and the fourth sub-feature are fused together to obtain a second fusion result.

[0288] In one possible implementation, the processing module is specifically used for:

[0289] Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model, the mapping network, and the discriminator are updated based on the second loss.

[0290] In one possible implementation, the first data is an image, and the first processing result and the second processing result are enhanced images.

[0291] The following describes a terminal device provided in an embodiment of this application. Please refer to [link to relevant documentation]. Figure 11 , Figure 11 This is a schematic diagram of a terminal device provided in an embodiment of this application. The terminal device 1100 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop computer, a smart wearable device, etc., and is not limited thereto. Specifically, the terminal device 1100 includes: a receiver 1101, a transmitter 1102, a processor 1103, and a memory 1104 (wherein the number of processors 1103 in the terminal device 1100 can be one or more). Figure 11 (Taking a processor as an example), processor 1103 may include application processor 11031 and communication processor 11032. In some embodiments of this application, receiver 1101, transmitter 1102, processor 1103 and memory 1104 may be connected via bus or other means.

[0292] Memory 1104 may include read-only memory and random access memory, and provides instructions and data to processor 1103. A portion of memory 1104 may also include non-volatile random access memory (NVRAM). Memory 1104 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0293] Processor 1103 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together through a bus system, which may include not only the data bus, but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.

[0294] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1103. The processor 1103 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuits in the hardware of the processor 1103 or by instructions in software form. The processor 1103 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The processor 1103 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 1104. Processor 1103 reads the information in memory 1104 and, in conjunction with its hardware, completes the steps involved in the model training or model inference process described above.

[0295] Receiver 1101 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the execution device. Transmitter 1102 can be used to output digital or character information through the first interface; transmitter 1102 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 1102 may also include a display device such as a display screen.

[0296] This application also provides a server; please refer to [link / reference]. Figure 12 , Figure 12This is a schematic diagram of a server structure provided in an embodiment of this application. The server 1200 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 1212 (e.g., one or more processors) and memory 1232, and one or more storage media 1230 (e.g., one or more mass storage devices) for storing application programs 1242 or data 1244. The memory 1232 and storage media 1230 may be temporary or persistent storage. The program stored in the storage media 1230 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 1212 may be configured to communicate with the storage media 1230 and execute the series of instruction operations in the storage media 1230 on the server 1200.

[0297] Server 1200 may also include one or more power supplies 1226, one or more wired or wireless network interfaces 1250, one or more input / output interfaces 1258; or, one or more operating systems 1241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0298] In this embodiment, the central processing unit 1212 is used to perform actions related to model training or model inference in the above embodiments.

[0299] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0300] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned execution device, or causes the computer to perform steps as performed by the aforementioned training device.

[0301] The execution device, training device, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip within the execution device to execute the data processing method described in the above embodiments, or to cause the chip within the training device to execute the data processing method described in the above embodiments. Optionally, the storage unit can be a storage unit within the chip, such as a register or cache. Alternatively, the storage unit can be a storage unit located outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices capable of storing static information and instructions, such as random access memory (RAM).

[0302] For details, please refer to Figure 13 , Figure 13 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 1300. The NPU 1300 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core part of the NPU is the arithmetic circuit 1303, which is controlled by the controller 1304 to extract matrix data from the memory and perform multiplication operations.

[0303] In some implementations, the arithmetic circuit 1303 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1303 is a two-dimensional pulsating array. The arithmetic circuit 1303 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 1303 is a general-purpose matrix processor.

[0304] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 1302 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1301 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1308.

[0305] Unified memory 1306 is used to store input and output data. Weight data is directly transferred to weight memory 1302 via Direct Memory Access Controller (DMAC) 1305. Input data is also transferred to unified memory 1306 via DMAC.

[0306] BIU stands for Bus Interface Unit, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 1309.

[0307] The Bus Interface Unit (BIU) 1310 is used by the instruction fetch memory 1309 to fetch instructions from external memory, and also by the memory access controller 1305 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0308] The DMAC is mainly used to move input data from external memory DDR to unified memory 1306, or to weight data to weight memory 1302, or to input data to input memory 1301.

[0309] The vector computation unit 1307 includes multiple processing units that further process the output of the computation circuit 1303 when needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as Batch Normalization, pixel-level summation, and upsampling of feature planes.

[0310] In some implementations, the vector computation unit 1307 can store the processed output vector in the unified memory 1306. For example, the vector computation unit 1307 can apply a linear function, or a nonlinear function, to the output of the computation circuit 1303, such as performing linear interpolation on the feature planes extracted by the convolutional layer, or, for example, accumulating a vector of values ​​to generate activation values. In some implementations, the vector computation unit 1307 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as an activation input to the computation circuit 1303, for example, for use in subsequent layers of the neural network.

[0311] The instruction fetch buffer 1309 connected to the controller 1304 is used to store the instructions used by the controller 1304;

[0312] Unified memory 1306, input memory 1301, weighted memory 1302, and instruction fetch memory 1309 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0313] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0314] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0315] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, training equipment, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0316] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0317] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a training device or data center that integrates one or more available media. The available media may be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).

Claims

1. A data processing method, characterized in that, The method includes: Get the first data; Based on the first data, a first processing result and a second processing result are obtained through a first model and a second model, respectively, wherein the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model; Noise is added to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result; The first noise result is denoised using the first model to obtain the first denoised result. The second noise-adding result is denoised using the first model to obtain the second denoised result; Based on the first denoising result and the second denoising result, a first loss is obtained, and the second model is updated based on the first loss.

2. The method according to claim 1, characterized in that, The first processing result and the second processing result are at least one of the following: The denoising score, the data after augmentation of the first data, or the predicted noise.

3. The method according to claim 1 or 2, characterized in that, The step of adding noise to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result includes: The first processing result and the second processing result are respectively denoised by the target step size to obtain the first denoised result and the second denoised result; The step of denoising the first noise-added result using the first model to obtain a first denoised result, and denoising the second noise-added result using the first model to obtain a second denoised result, includes: Using the first model, the first noise-adding result is denoised at the target step size to obtain a first denoised result. Using the first model, the second noise-adding result is denoised at the target step size to obtain a second denoised result.

4. The method according to any one of claims 1 to 3, characterized in that, The target step size is obtained by sampling within a preset step size range, and the step size included in the preset step size range is less than one-quarter of the total denoising step size.

5. The method according to any one of claims 1 to 4, characterized in that, The method further includes: Obtain the second data, which is the truth value data corresponding to the first data; The second data is then subjected to noise to obtain the third noise-added result; Based on the third noise-adding result and the second noise-adding result, the first feature and the second feature are obtained respectively through the encoding network in the first model; Based on the first feature and the second feature, a first discrimination result and a second discrimination result are obtained by a discriminator. Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model is updated based on the second loss.

6. The method according to claim 5, characterized in that, The step of obtaining a first discrimination result and a second discrimination result respectively through a discriminator based on the first feature and the second feature includes: The target step size is mapped using a mapping network to obtain the first parameter; The first parameter is fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result; Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

7. The method according to claim 6, characterized in that, The first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature; The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; The step of fusing the first parameter with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result includes: The first sub-parameter and the first sub-feature are fused together, and the second sub-parameter and the second sub-feature are fused together to obtain a first fusion result.

8. The method according to claim 6 or 7, characterized in that, The second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature; The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; The step of fusing the first parameter with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result includes: The first sub-parameter and the third sub-feature are fused together, and the second sub-parameter and the fourth sub-feature are fused together to obtain a second fusion result.

9. The method according to any one of claims 6 to 8, characterized in that, The step of obtaining a second loss based on the first discrimination result and the second discrimination result, and updating the second model based on the second loss, includes: Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model, the mapping network, and the discriminator are updated based on the second loss.

10. The method according to any one of claims 1 to 9, characterized in that, The first data is an image, and the first processing result and the second processing result are enhanced images.

11. A data processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire the first data; The processing module is used to obtain a first processing result and a second processing result based on the first data through a first model and a second model, respectively, wherein the first model and the second model are diffusion models, the first model is a teacher model, and the second model is a student model; Noise is added to the first processing result and the second processing result respectively to obtain a first noise-added result and a second noise-added result; The first noise result is denoised using the first model to obtain the first denoised result. The second noise-adding result is denoised using the first model to obtain the second denoised result; Based on the first denoising result and the second denoising result, a first loss is obtained, and the second model is updated based on the first loss.

12. The apparatus according to claim 11, characterized in that, The first processing result and the second processing result are at least one of the following: The denoising score, the data after augmentation of the first data, or the predicted noise.

13. The apparatus according to claim 11 or 12, characterized in that, The processing module is specifically used for: The first processing result and the second processing result are respectively denoised by the target step size to obtain the first denoised result and the second denoised result; Using the first model, the first noise-adding result is denoised at the target step size to obtain a first denoised result. Using the first model, the second noise-adding result is denoised at the target step size to obtain a second denoised result.

14. The apparatus according to any one of claims 11 to 13, characterized in that, The target step size is obtained by sampling within a preset step size range, and the step size included in the preset step size range is less than one-quarter of the total denoising step size.

15. The apparatus according to any one of claims 11 to 14, characterized in that, The acquisition module is also used for: Obtain the second data, which is the truth value data corresponding to the first data; The processing module is further configured to: The second data is then subjected to noise to obtain the third noise-added result; Based on the third noise-adding result and the second noise-adding result, the first feature and the second feature are obtained respectively through the encoding network in the first model; Based on the first feature and the second feature, a first discrimination result and a second discrimination result are obtained by a discriminator. Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model is updated based on the second loss.

16. The apparatus according to claim 15, characterized in that, The processing module is specifically used for: The target step size is mapped using a mapping network to obtain the first parameter; The first parameter is fused with the first feature and the second feature respectively to obtain a first fusion result and a second fusion result; The second parameter and the second feature are fused to obtain the second fusion result; Based on the first fusion result and the second fusion result, a first discrimination result and a second discrimination result are obtained by a discriminator.

17. The apparatus according to claim 16, characterized in that, The first feature includes a first sub-feature and a second sub-feature; the first sub-feature and the second sub-feature are features with different scales in the first feature; The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; The processing module is specifically used for: The first sub-parameter and the first sub-feature are fused together, and the second sub-parameter and the second sub-feature are fused together to obtain a first fusion result.

18. The apparatus according to claim 16 or 17, characterized in that, The second feature includes a third sub-feature and a fourth sub-feature; the third sub-feature and the third and fourth sub-features are features with different scales in the second feature; The first parameter includes a first sub-parameter and a second sub-parameter; the first sub-parameter and the second sub-parameter are different; The processing module is specifically used for: The first sub-parameter and the third sub-feature are fused together, and the second sub-parameter and the fourth sub-feature are fused together to obtain a second fusion result.

19. The apparatus according to any one of claims 16 to 18, characterized in that, The processing module is specifically used for: Based on the first discrimination result and the second discrimination result, a second loss is obtained, and the second model, the mapping network, and the discriminator are updated based on the second loss.

20. The apparatus according to any one of claims 11 to 19, characterized in that, The first data is an image, and the first processing result and the second processing result are enhanced images.

21. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which, when executed by one or more computers, cause the one or more computers to perform the operation of the method according to any one of claims 1 to 10.

22. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 10.

23. A system comprising at least one processor and at least one memory; the processor and the memory are connected via a communication bus and communicate with each other. The at least one memory is used to store code; The at least one processor is used to execute the code to perform the method as described in any one of claims 1 to 10.

24. A chip, comprising a processor, characterized in that, The processor is used to support the data processing device in implementing the method as described in any one of claims 1 to 10.