Image processing method and related device

By using a two-stage image expansion generation method, combined with noise processing and feature extraction, the problem of poor image quality at low resolutions in existing technologies is solved, and high-quality image content expansion is achieved.

CN121961841APending Publication Date: 2026-05-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-10-31
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

In existing technologies, the low-resolution images generated using a two-stage approach have poor quality, resulting in poor image quality after super-resolution.

Method used

A two-stage image expansion generation method is adopted. First, noise processing and feature extraction are performed on the image to eliminate negative interference from low-quality images. Then, the image content is expanded through a pre-trained model, and the location indication information is combined to ensure that the expanded result is consistent with the original image.

Benefits of technology

It improves the clarity and semantic detail of the image content expansion results, ensures consistency between texture and material expansion and the entire image, and eliminates the effects of blurring and line distortion in low-quality images.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121961841A_ABST
    Figure CN121961841A_ABST
Patent Text Reader

Abstract

The invention discloses an image processing method. The method comprises the following steps: acquiring a first image and a second image; the first image is obtained by performing image content expansion on the second image; performing noise addition and feature extraction on the first image to obtain a noise-added first image and feature representation of the first image; and according to the second image, the noise-added first image and the feature representation, carrying out image content expansion on the second image to obtain a third image. According to the method, based on a two-stage image expansion generation mode (the first stage generates an expanded small image, namely the first image, and the second stage performs an image expansion result, namely the third image), noise addition is performed on the first image firstly, so that negative interference such as low-quality image blurring and line distortion can be eliminated, and equivalently, decoupling of semantic content and image quality is realized; therefore, the generation effect of the image content extension result is 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 (AI) technology, and more particularly to an image processing method, a computer-readable storage medium, and a computer program product. 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] As AIGC technology develops and improves, its application scenarios are also expanding. For example, there is AI image expansion technology based on aesthetic composition and adapted to different aspect ratios (that is, expanding the image content).

[0004] However, existing technologies employ a two-stage approach of "generating a small-resolution image and then super-resolution to a high-resolution image," which is currently the mainstream approach for high-quality image generation. The small-resolution image generated in the first stage of image expansion is called a "low-quality small image." However, due to the poor quality of the low-quality small image, the quality of the super-resolution image (i.e., the result obtained by expanding the image content) will also be poor. Summary of the Invention

[0005] In a first aspect, this application provides an image processing method, the method comprising: acquiring a first image and a second image; the first image being obtained by expanding the image content of the second image; adding noise and extracting features from the first image to obtain a noisy first image and a feature representation of the first image; and expanding the image content of the second image based on the second image, the noisy first image, and the feature representation to obtain a third image.

[0006] This application is based on a two-stage image expansion generation method (the first stage generates the expanded small image, i.e., the first image, and the second stage generates the expanded image result, i.e., the third image). Since the first image is first noise-added, negative interference such as low-quality image blurring and line distortion can be eliminated, which is equivalent to decoupling semantic content and image quality, thereby improving the generation effect of image content expansion results.

[0007] Image content expansion can be understood as extending and expanding the content contained in an image. The expanded image includes not only the image content of the original image but also image content not included in the original image. For example, a first image can be obtained by expanding a second image using a pre-trained machine learning model.

[0008] In one possible implementation, the feature extraction specifically involves extracting semantic features from the first image.

[0009] In one possible implementation, the noisy first image is an image that includes the semantic contours of the first image.

[0010] Among them, semantic contours can be the outlines or boundaries of objects in an image that have clear semantic meanings (e.g., animals, people, etc.).

[0011] It can decouple the semantic content and basic image quality of the input guide graph, realize high-level semantic extraction and injection for guided generation, and eliminate negative interference such as low-quality image blurring and line distortion. It stimulates the high-quality detail generation capability of the expanded image generation base model, and performs well in object semantic detail representation, especially in the correction of architectural lines and object generation results, with high clarity.

[0012] In one possible implementation, the method further includes: acquiring indication information, the indication information being used to indicate the location indication information of the area where the second image is located and the location indication information of the area where the image content of the second image is expanded; the step of expanding the image content of the second image according to the second image, the noisy first image and the feature representation to obtain a third image includes: expanding the image content of the second image according to the second image, the indication information, the noisy first image and the feature representation to obtain a third image.

[0013] In this embodiment, by using the instruction information as input, the task requirements of 1) maintaining the original image area and 2) ensuring a coherent connection between the expanded image area and the original image area can be met. Specifically, the expanded image generation model is selected as the super-resolution model, which can achieve high-quality generation while preserving the original image area to the greatest extent possible, and guides the expanded image area to maintain consistency with the original image area. The innovative design decouples the low-quality contour injection control module and the low-quality semantic injection control module. While performing semantic and contour injection control, it eliminates the low-quality influence of the input small image, fully releasing the capabilities of the expanded image model. The final output image has high clarity, excellent semantic detail correction, and rich texture and material expansion. Figure 1 It has strong consistency and harmony.

[0014] In one possible implementation, the indication information is mask information.

[0015] In one possible implementation, the step of expanding the image content of the second image based on the second image, the noisy first image, and the feature representation to obtain the third image includes: taking the second image, the noisy first image, and the feature representation as input conditions, and denoising the noisy first image using a diffusion model to obtain the third image.

[0016] In one possible implementation, the second image is an image patch of the input image; the method further includes: fusing multiple images, including the third image, to obtain a fourth image, each of which is obtained by expanding the image content of an image patch of the input image.

[0017] Secondly, this application provides an image processing apparatus, the apparatus comprising:

[0018] The acquisition module is used to acquire a first image and a second image; the first image is obtained by expanding the image content of the second image;

[0019] The noise-adding module is used to add noise and extract features from the first image to obtain the noise-adding first image and the feature representation of the first image.

[0020] The denoising module is used to perform image content expansion on the second image based on the second image, the first image after noise addition, and the feature representation to obtain a third image.

[0021] In one possible implementation, the feature extraction specifically involves extracting semantic features from the first image.

[0022] In one possible implementation, the noisy first image is an image that includes the semantic contours of the first image.

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

[0024] Obtain indication information, which is used to indicate the location indication information of the area where the second image is located and the location indication information of the area where the image content of the second image is expanded;

[0025] The noise reduction module is specifically used for:

[0026] Based on the second image, the indication information, the noisy first image, and the feature representation, the second image is expanded to obtain a third image.

[0027] In one possible implementation, the indication information is mask information.

[0028] In one possible implementation, the noise reduction module is specifically used for:

[0029] Using the second image, the noisy first image, and the feature representation as input conditions, the noisy first image is denoised using a diffusion model to obtain the third image.

[0030] In one possible implementation, the second image is an image patch of the input image;

[0031] The device further includes:

[0032] The fusion module is used to fuse multiple images, including the third image, to obtain a fourth image, wherein each image is obtained by expanding the image content of an image block of the input image.

[0033] Thirdly, this application provides a chip including at least one processing unit and an interface circuit. The interface circuit is used to provide program instructions or data to the at least one processing unit. The at least one processing unit is used to execute the program instructions to implement the method described in any one of the first aspects. The at least one processing unit includes a first hardware unit and a second hardware unit. The first hardware unit is used to calculate the prefix sum in the channel dimension, and the second hardware unit is used to calculate the prefix sum in the spatial dimension.

[0034] Fourthly, embodiments of this application provide an image 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 and any of the optional methods thereon.

[0035] Fifthly, 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 of its alternatives.

[0036] Sixthly, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the first aspect and any of its optional methods described above.

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

[0038] To more clearly illustrate the technical methods of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly described below.

[0039] Figure 1 A schematic diagram of an application architecture provided for an embodiment of this application;

[0040] Figures 2 to 7 A schematic diagram of an application architecture provided for an embodiment of this application;

[0041] Figure 8 This is a schematic diagram of an image processing method provided in an embodiment of this application;

[0042] Figure 9 This is a schematic diagram of an image processing method provided in an embodiment of this application;

[0043] Figure 10 This is a schematic diagram of an application architecture according to an embodiment of this application;

[0044] Figure 11 This application provides a schematic diagram of the structure of an image processing apparatus according to an embodiment of the present application.

[0045] Figure 12 A schematic diagram of an apparatus provided in an embodiment of this application;

[0046] Figure 13 A schematic diagram of an apparatus provided in an embodiment of this application;

[0047] Figure 14 This is a schematic diagram of a chip provided in an embodiment of this application. Detailed Implementation

[0048] 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.

[0049] 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.

[0050] 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 are interchangeable 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 that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0051] First, the overall workflow of the artificial intelligence system is described; please refer to [link / reference]. Figure 1 , Figure 1 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.

[0052] (1) Infrastructure

[0053] 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.

[0054] (2) Data

[0055] 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.

[0056] (3) Data processing

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

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

[0059] 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.

[0060] 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.

[0061] (4) General ability

[0062] 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.

[0063] 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.

[0064] This application can be applied, but is not limited to, to the field of natural language processing in the field of artificial intelligence. Specifically, it can be applied to neural network search and neural network inference in the field of natural language processing. The following will introduce several application scenarios that have been implemented in products.

[0065] To better understand the solutions of the embodiments of this application, the following will first combine... Figures 2 to 5 A brief introduction to the possible application scenarios of the embodiments of this application is provided.

[0066] I. Image Editing Applications

[0067] The product form of this application embodiment can be an image editing application. Image editing applications can run on terminal devices or cloud-based servers.

[0068] In one possible implementation, refer to Figure 2 Image editing applications can perform image editing tasks and obtain processing results.

[0069] Image editing tasks can include expanding image content, etc.

[0070] In one possible implementation, a user can open an image editing application installed on a terminal device and input an image. The image editing application can process the image 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.).

[0071] In one possible implementation, a user can open an image editing application installed on a terminal device and input an image. The image editing application can then send the image to a cloud-based server. The cloud-based server processes the image 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).

[0072] The image editing application in this application will be described in the following sections, focusing on its functional architecture and the product architecture that implements its functions.

[0073] Reference Figure 2 , Figure 2 This is a schematic diagram of the functional architecture of the image editing application in the embodiments of this application:

[0074] In one possible implementation, such as Figure 2 As shown, the image editing application 102 can receive input parameters 101 (e.g., including an image) and generate a processing result 103. The image editing 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.

[0075] Reference Figure 3 , Figure 3 This is a schematic diagram of the entity architecture for running an image editing application in this embodiment of the application:

[0076] See Figure 3 , Figure 3 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 3 (The example includes a server), where server 200 can provide image processing functions for one or more terminals.

[0077] The terminal 100 may have an image editing application installed, or a webpage related to image processing functions open. The application and webpage can provide an interface. The terminal 100 can receive relevant parameters input by the user on the image processing 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.

[0078] 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.

[0079] The following description Figure 3 The product form of the mid-terminal 100;

[0080] 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.

[0081] Figure 4 A schematic diagram of an optional hardware structure for terminal 100 is shown.

[0082] refer to Figure 4 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 4 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.

[0083] 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.

[0084] Other input devices 132 can receive input images.

[0085] 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 an image editing application, processing results, etc.

[0086] 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.

[0087] 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.

[0088] The memory 120 can be used to store software code related to the image processing method, and the processor 170 can execute the steps of the chip's image 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.

[0089] 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.

[0090] In this embodiment of the application, the radio frequency unit 110 can send an image to the server 200 and receive the processing result sent by the server 200.

[0091] 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.

[0092] 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.

[0093] 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.

[0094] 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 4 In the terminal 100 shown.

[0095] The following description Figure 3 The product form of the mid-range server 200;

[0096] Figure 5 A structural diagram of a server 200 is provided, as follows: Figure 5 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.

[0097] 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 5 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.

[0098] 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).

[0099] 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).

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

[0101] 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.

[0102] 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 6 The system architecture provided in the embodiments of this application will be described in detail.

[0103] Figure 6 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 6 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.

[0104] 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.

[0105] The execution device 510 can be a terminal device or a server that runs the aforementioned image editing application.

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

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

[0108] 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.

[0109] 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.

[0110] The target model / rule 501 trained using training device 520 can be applied to different systems or devices, such as... Figure 6 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.

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

[0112] exist Figure 6 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 images in this embodiment) into the I / O interface 512 through the client device 540.

[0113] 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.

[0114] 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.

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

[0116] exist Figure 6 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 forms 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.

[0117] It is worth noting that, Figure 6 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 6 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.

[0118] The following describes a more detailed architecture of the execution entity that performs the image processing method in the embodiments of this application.

[0119] The following is combined Figure 6 The system architecture provided in the embodiments of this application will be described in detail. Figure 6 This is a schematic diagram of the system architecture provided for an embodiment of this application. Figure 6 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.

[0120] 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.

[0121] The data acquisition device 560 is used to collect training samples. Training samples can be images, text data, audio data, etc. In this embodiment, the training samples are the data used to train multiple candidate neural networks. After collecting the training samples, the data acquisition device 560 stores them in the database 530.

[0122] It should be understood that a search space can also be maintained in database 530.

[0123] The training device 520 can construct multiple candidate neural networks based on the search space maintained in the database 530, and train the multiple candidate neural networks based on training samples to search for the target model / rule 501. In this embodiment, the target model / rule 501 can be the target neural network.

[0124] 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.

[0125] The target model / rule 501 trained using training device 520 can be applied to different systems or devices, such as... Figure 6 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 or cloud, etc.

[0126] Specifically, the training device 520 can transmit the target neural network to the execution device 510.

[0127] exist Figure 6 In the process, the execution device 510 is configured with an input / output (I / O) interface 512 for data interaction with external devices. Users can input data (such as the data to be processed in the embodiments of this application) into the I / O interface 512 through the client device 540.

[0128] 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.

[0129] 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.

[0130] Finally, the I / O interface 512 presents the processing results (such as the data processing results in this embodiment) to the client device 540, thereby providing them to the user.

[0131] In this embodiment, the computing module 511 of the execution device 510 can obtain the code stored in the data storage system 550 to implement the image processing method in this embodiment.

[0132] 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.

[0133] Specifically, the computing module 511 of the execution device 510 can be a hardware system with the function of executing instructions. The image processing method 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 image processing method provided in this application embodiment.

[0134] 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 of the image processing method provided in the embodiments of this application can also be implemented by the hardware system without the function of executing instructions in the computing module 511 of the execution device 510, which is not limited here.

[0135] From the training side of the model:

[0136] In this embodiment of the application, the training device 520 can access the memory ( Figure 6 The image processing method in the embodiments of this application can be implemented by code stored in the training device 520 (not shown in the figure) or separately deployed from the training device 520.

[0137] 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.

[0138] Specifically, the training device 520 can be a hardware system with instruction execution capabilities. The image processing method provided in this application embodiment can be software code stored in a memory. The training device 520 can retrieve the software code from the memory and execute the retrieved software code to implement the image processing method provided in this application embodiment.

[0139] 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 of the image processing method 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.

[0140] II. Image editing functions provided by the server (like cloud services):

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

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

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

[0144] like Figure 7 This demonstrates the process of using image editing features provided by a cloud platform, similar to cloud services.

[0145] 1. Activate and purchase image processing services.

[0146] 2. Users can download the software development kit (SDK) corresponding to the image processing 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.

[0147] 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 editing capabilities.

[0148] 4. When an image editing application needs to perform image processing, it can trigger an API call for the image processing function. When the application triggers the image processing function, it sends an API request to the running instance of the image editing function service in the cloud environment. The API request carries the image, and the running instance in the cloud environment processes the image to obtain the processing result.

[0149] 5. The cloud environment returns the processing result to the application, thus completing one image processing function call.

[0150] 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.

[0151] (1) Neural Network

[0152] A neural network can be composed of neural units, which can be operational units that take xs and an intercept of 1 as inputs, and whose output can be:

[0153]

[0154] 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.

[0155] (2) Loss Function

[0156] 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.

[0157] (3) Backpropagation algorithm

[0158] Convolutional neural networks can employ backpropagation (BP) to correct the parameters in the initial super-resolution model during training, thereby reducing the reconstruction error loss. Specifically, forward propagation of the input signal to the output generates an error loss; this error loss information is then propagated back to update the parameters in the initial super-resolution model, leading to convergence of the error loss. The backpropagation algorithm is an error-loss-driven backpropagation process aimed at obtaining the optimal parameters of the super-resolution model, such as the weight matrix.

[0159] (4) Deep Neural Networks

[0160] 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).

[0161] (5) SOTA (State Of The Art): refers to the best performance in this technology field in the industry.

[0162] (6) SD (Stable Diffusion): This model performs noise addition and denoising operations in the latent coding space of the image, thereby saving training and inference time and resource costs; at the same time, this model uses cross-attention layers to introduce various control conditions, including text.

[0163] (7) LDM (Latent Diffusion Model): LDM is an image generation model proposed in 2021. This model is primarily a diffusion model. Considering the overhead issue, this architecture models diffusion in the image's encoded feature space, greatly compressing the feature scale of the diffusion network input and thus reducing overhead. Because its overhead is significantly reduced compared to diffusion models that directly model in pixel space, it has received widespread attention and adoption.

[0164] (8) T2I (Text-to-Image Generation): This is an important task in the field of computer vision. Its goal is to generate an image output that conforms to the text description based on a given text input. This task requires the model to understand the text language, model the distribution of image data, and find the transformation relationship between the text language and the visual features of the image. In this task, the generated image needs to visually reflect the visual content of the text description, and also needs to have a certain degree of textual consistency and coherence.

[0165] (9) DiT (Diffusion Transformers): A new diffusion network proposed in 2022, with the Transformer model structure as its backbone. Combining the complete theory of diffusion modeling, and using Transformer, it has been proven to have better scalability than Unet Diffusion, becoming the mainstream architecture for the new generation of generative models.

[0166] (10) CA (Cross Attention): Transformer network module, mainly refers to the attention mechanism for cross-modal interaction such as text and images. The attention mechanism here refers to the ability to calculate the relation weight of each position in the input sequence, so as to handle the problem of long-distance dependencies in the sequence well.

[0167] (11) DDPM (Denoising Diffusion Probabilistic Models): An image generation model proposed in 2020, which achieves image denoising and denoising generation through a Markov chain-like denoising and denoising process. DDPM denoising refers to adding some random Gaussian noise to the image.

[0168] (12) AIGC (Artificial Intelligence Generated Content): This refers to the technology of generating relevant content with appropriate generalization ability by learning from and recognizing existing data, based on artificial intelligence techniques such as generative adversarial networks and large-scale pre-trained models. The core idea of ​​AIGC technology is to use artificial intelligence algorithms to generate content with a certain degree of creativity and quality. Through training models and learning from a large amount of data, AIGC can generate relevant content based on input conditions or guidance. For example, by inputting keywords, descriptions, or samples, AIGC can generate articles, images, audio, etc. that match them.

[0169] (13) CLIP (Contrastive Language-Image Pretraining): An open-domain multimodal neural network model proposed by OpenAI in 2021, pretrained on a massive (400 million) dataset of text and image pairs. It includes a text encoder and an image encoder. The text encoder extracts features from the text, and the image encoder extracts features from the image. It learns open-domain and transferable text and image representations by maximizing the similarity of paired text and image features and minimizing the similarity of unpaired text and image features.

[0170] (14) Concat: refers to the information combination method of connecting features on the channel.

[0171] (15) ControlNet: Proposed in 2023, ControlNet is a plugin for content control of diffusion model generation, allowing users to finely control the generated images. This makes ControlNet very useful in many application scenarios, such as computer vision, art design, virtual reality, etc., helping users to precisely control the generation of AI images to achieve better visual effects. Generally, the structure and weights of the backbone network are copied as the initial structure.

[0172] (16) Pre-training: This usually refers to the model trained on massive amounts of text, image, and video data. Starting with multimodal large models, pre-training on massive amounts of data has become the first-stage paradigm for training multimodal large models.

[0173] (17) low-level: generally refers to low-level visual information, such as clarity and texture details. In contrast, high-level refers to high-level semantic information, indicating that it is a certain object or category.

[0174] (18) Multi-Diffusion: Because AIGC models have high memory overhead for inference, it is generally difficult to directly infer high-resolution images in one step. This scheme divides the image into blocks for inference to reduce overhead. In order to ensure the overall consistency between blocks, there will be overlap between adjacent blocks when the image is divided into blocks. In the output results of each step of the diffusion inference link, the overlapping areas between blocks are weighted and fused. This scheme has now become the widely used inference link for inference of high-resolution images in the UET diffusion architecture. There are still a series of optimization works, such as tile-diffusion.

[0175] (19) Padding image: This refers to the diffusion inference chain not starting with randomly selected Gaussian noise to generate the result, but instead, given a known image, adding noise to it at a certain number of steps, and feeding the noisy image to the diffusion network as an intermediate result. The diffusion network then continues to perform further denoising based on this noisy result. This operation can control the generated result to have a similar contour layout to the input image.

[0176] As AIGC technology develops and improves, its application scenarios are also expanding. For example, there is AI image expansion technology based on aesthetic composition and adapted to different aspect ratios (that is, expanding the image content).

[0177] However, existing technologies employ a two-stage approach of "generating a small-resolution image and then super-resolution to a high-resolution image," which is currently the mainstream approach for high-quality image generation. The small-resolution image generated in the first stage of image expansion is called a "low-quality small image." However, due to the poor quality of the low-quality small image, the quality of the super-resolution image (i.e., the result obtained by expanding the image content) will also be poor.

[0178] The embodiments of this application aim to address the following low-quality generation problems in existing AI image augmentation technologies: 1) smooth transition of the augmented area, resulting in loss of texture details; 2) loss of semantic and structural details; and 3) insufficient clarity. Based on a two-stage approach of 'generating small-resolution images + super-resolution to high-resolution images', for the second-stage super-resolution / enhancement module, we propose a generative high-quality image augmentation method that decouples semantic content and image quality. While maintaining the semantic content and contour layout of the small image, feature extraction decouples and avoids the influence of low-quality information such as distorted lines and blurring / smoothing on the small image, fully releasing the fundamental model capability, significantly improving the basic quality of the output image, and resulting in harmonious and consistent augmentation results.

[0179] To address the aforementioned problems, embodiments of this application provide an image processing method. (Refer to...) Figure 8 , Figure 8 This is an illustration of an embodiment of an image processing method provided in this application, such as... Figure 8 As shown, the image processing method provided in this application embodiment may include:

[0180] 901. Obtain a first image and a second image; the first image is obtained by expanding the image content of the second image;

[0181] Reference Figure 9 , Figure 9 This is a flowchart illustrating the process of this application.

[0182] In this application, the user can upload the image X_in to be expanded (i.e., the second image in this embodiment), and the user can specify the expansion box X_bbox. There are several different interaction methods, not limited to the examples below. Method 1: The user obtains the expansion box by dragging; Method 2: The user selects the default expansion mode, such as expanding 0.5X on one side, or expanding 0.5X evenly in four directions, etc.

[0183] In one possible implementation, X_bbox can be converted into a mask image. Within the X_bbox, all values ​​are 0 except for the original image area, which is 1. This mask is denoted as Mask. Based on X_bbox, the image X_in uploaded by the user in step one is expanded into X_painted, where the original image area is preserved, and the area from the original image to the outer frame is all 0.

[0184] Optionally, the user-uploaded image and the bounding box can be first input into the image expansion generation module to obtain a low-quality, coarse expanded small image result X_out_s (that is, the first image in the embodiment of this application). The architecture and scheme of this module are not limited and are not within the core scope of this invention, so they will not be described in detail.

[0185] In one possible implementation, indication information (e.g., a mask image) can be obtained, which is used to indicate the location indication information of the area where the second image is located and the location indication information of the area where the image content of the second image is expanded.

[0186] 902. Noise is added and features are extracted from the first image to obtain the noisy first image and the feature representation of the first image;

[0187] In one possible implementation, the noisy first image is an image that includes the semantic contours of the first image.

[0188] For example, X_painted, mask image Mask, and outer size can be used. Figure X The values ​​_out_s and the number of noise-adding steps T_layout are input into the high-quality image expansion module to generate the high-quality image expansion result X_out_h. Specifically, the outer expansion can be reduced. Figure X The parameters are: X_out_s, the number of steps for adding noise to the padding image, and T_layout. Input is the 'Contour Injection Control Module'. Specifically, X_out_s is expanded to the target size using AI-UpBlock and image distribution mapping is performed to obtain X_out_hinit. Then, noise (Noise_T) corresponding to the number of steps T_layout is added to X_out_hinit. Fine details in X_out_hinit are erased, resulting in a noisy image with only a general semantic contour layout remaining. Figure X _layout. No constraints are placed on the structure or selection of AI-UpBlock here, which may include but is not limited to GAN, simple Conv encoding, etc.;

[0189] In one possible implementation, the feature extraction specifically involves extracting semantic features from the first image.

[0190] For example, the outer expansion can be reduced. Figure X The `_out_s` input is fed into the 'semantic injection control module' to obtain the high-level semantic features `X_feature` that decouple the basic image quality. The selection of the semantic injection control module includes, but is not limited to, high-level image semantic encoders such as clip encoders.

[0191] For example, high-level semantic extraction control can be achieved through high-level image semantic encoders (not limited to clip) such as clip encoders, eliminating the low-quality influence of small input images.

[0192] This application is based on a two-stage image expansion generation method (the first stage generates the expanded small image, i.e., the first image, and the second stage generates the expanded image result, i.e., the third image). Since the first image is first noise-added, negative interference such as low-quality image blurring and line distortion can be eliminated, which is equivalent to decoupling semantic content and image quality, thereby improving the generation effect of image content expansion results.

[0193] Optionally, a lightweight AI-UpBlock can be used to perform a coarse mapping of the low-quality to high-quality image distribution, which is the first step in decoupling the low-quality input image and achieves an initial improvement in basic quality such as sharpness. By using a diffusion model to add noise in the forward direction, high-frequency signals such as distorted lines on the global small image can be removed and decoupled. By adjusting the appropriate signal-to-noise ratio to match the diffusion link distribution, global semantic layout control can be achieved without affecting the output image quality. The expanded image has high sharpness and excellent overall semantic expansion, coherence, and harmony.

[0194] Optionally, the semantic injection module can employ a high-level image semantic encoder such as a clip encoder, which can decouple the semantic content of the input guide graph from the basic image quality, enabling high-level semantic extraction and injection for guided generation. At the same time, it eliminates negative interference from low-quality images such as blurring and distorted lines, stimulating the high-quality detail generation capability of the expanded image generation base model. It excels in the concretization of object semantic details, especially in the correction of architectural lines and object generation results, with high clarity.

[0195] 903. Based on the second image, the first image with added noise, and the feature representation, perform image content expansion on the second image to obtain a third image.

[0196] In one possible implementation, X_painted, the mask image Mask, X_layout, and X_feature can be input into the expansion image generation base module to obtain the noisy generated image X_out_t from the middle of the diffusion model. The expansion image generation base module is a diffusion model, including but not limited to LDM, uninterrupt diffusion, and DiT diffusion model architectures.

[0197] Among them, X_painted, the mask image Mask, and X_layout are jointly used as inputs to the diffusion model, and the concat method is generally used, but not limited to. X_feature interacts and fuses with the features in the diffusion network, and the methods include, but are not limited to, concat, CA, etc.

[0198] In one possible implementation, X_painted, the mask image Mask, X_layout, and X_out_t can be input into the image expansion generation base module to obtain a noisy generated image from the middle of the diffusion model. Similarly, the image expansion generation base module is a diffusion model, including but not limited to LDM, unet diffusion, DiT, and other diffusion model architectures; X_painted, the mask image Mask obtained from the user-uploaded image expansion, and X_out_t obtained from the previous diffusion step are jointly used as input to the diffusion model, generally using, but not limited to, the concat joint method; the obtained X_feature interacts and fuses with the features in the diffusion network, using methods including but not limited to concat, CA, etc.

[0199] Existing generative super-base modules all use the T2I model. Considering the task requirements of expanding the image, which requires maintaining the original image area and ensuring a harmonious connection between the expanded and original image areas, we innovatively adopt an expanding image generation model as the basic model. By adding the original image and mask image as input, we can maintain the original image area to the greatest extent and guide the expanded area to maintain consistent texture details and realistic style with the original image area, thus achieving high-quality expanding image generation.

[0200] In one possible implementation, the above steps can be repeated until the final high-quality expanded map result X_out_h is obtained.

[0201] This application's embodiments decouple semantic content and image quality by decoupling the low-quality contour injection control module and the low-quality semantic injection control module. It employs an expanded image generation model as a generative super-resolution basis model, achieving high-quality generation suitable for expanding image tasks that require preserving the original image and ensuring seamless expansion. The solution guarantees the final high-quality expanded image generation results: 1) high clarity; 2) excellent semantic detail, especially in the correction of architectural lines and object generation results; 3) consistent texture and material expansion, exhibiting excellent harmony with the original image.

[0202] In one possible implementation, the second image can be expanded based on the second image, the indication information, the noisy first image, and the feature representation to obtain a third image.

[0203] In this embodiment, by using the instruction information as input, the task requirements of 1) maintaining the original image area and 2) ensuring a coherent connection between the expanded image area and the original image area can be met. Specifically, the expanded image generation model is selected as the super-resolution model, which can achieve high-quality generation while preserving the original image area to the greatest extent possible, and guides the expanded image area to maintain consistency with the original image area. The innovative design decouples the low-quality contour injection control module and the low-quality semantic injection control module. While performing semantic and contour injection control, it eliminates the low-quality influence of the input small image, fully releasing the capabilities of the expanded image model. The final output image has high clarity, excellent semantic detail correction, and rich texture and material expansion. Figure 1 It has strong consistency and harmony.

[0204] Among them, the map expansion generation base module can select the map expansion generation model as the super-resolution base module, which can generate high-quality data while preserving the original map area to the greatest extent. The map expansion result has strong consistency with the original map area and no sense of segmentation. Moreover, the expansion generation result guided by the original map has a realistic and high-quality style.

[0205] In one possible implementation, the second image, the noisy first image, and the feature representation can be used as input conditions, and the noisy first image can be denoised using a diffusion model to obtain the third image.

[0206] In one possible implementation, the second image is an image block of the input image; multiple images, including the third image, can be fused to obtain a fourth image, each of which is obtained by expanding the image content of an image block of the input image.

[0207] This application proposes a generative high-quality image augmentation scheme based on a two-stage image augmentation generation (first stage generates augmentation mini-images, second stage performs super-resolution enhancement), decoupling semantic content and image quality. It comprises three core modules: an innovatively designed image augmentation generation base model adapted to the needs of the augmentation task; a decoupled low-quality contour injection control module; and a decoupled low-quality semantic injection control module. The specific device system is as follows: Figure 9 As shown, the solution is applicable to any diffusion architecture, whether it is LDM, unetdiffusion, or the latest DiT framework; it is also applicable to full-graph direct inference and slice inference (Multi-Diffusion) links.

[0208] This section uses sliding window slice reasoning (Multi-Diffusion) as an example to introduce the detailed process of the slice reasoning chain, as follows:

[0209] Step 1: The user uploads the image X_in that needs to be expanded;

[0210] Step 2: The user specifies the outer bounding box X_bbox. There are several different interaction methods, not limited to the examples below. Format 1: The user obtains the outer bounding box by dragging; Format 2: The user selects the default outer bounding mode, such as expanding 0.5X on one side, or expanding 0.5X evenly in all four directions, etc.

[0211] Step 3: The X_bbox will be converted into a mask image. Within the X_bbox, all areas except the original image area (which is 1) are 0, denoted as Mask. Based on the X_bbox, the image X_in uploaded by the user in Step 1 is expanded into X_painted, where the original image area is preserved, and the area from the original image to the outer frame is all 0.

[0212] Step 4: The user-uploaded image from Step 1 and the expanded bounding box from Step 2 are first input into the expanded image generation module to obtain a low-quality, coarse expanded small image result X_out_s. The architecture and scheme of this module are not limited and are not within the core scope of this invention, so they will not be elaborated upon.

[0213] Step 5: Combine X_painted from Step 3, the mask image Mask, and the outer expansion obtained from Step 4. Figure X The values ​​_out_s and the number of noise-adding steps T_layout are input into the high-quality image expansion module to generate the high-quality image expansion result X_out_h. Specifically:

[0214] Step 5(1): Using the segmentation scheme F(x), slide windows are sliced ​​according to the final required size to obtain the view window coordinates of multiple slices such as [x_window1, x_window2, ..., x_windowN]. No specific restrictions are placed on the segmentation scheme.

[0215] Step 5 (2): Expand the outer diameter obtained in Step 4. Figure X The parameters are: X_out_s, the number of steps for adding noise to the padding image, and T_layout. Input is the 'Contour Injection Control Module'. Specifically, X_out_s is expanded to the target size using AI-UpBlock and image distribution mapping is performed to obtain X_out_hinit. Then, noise (Noise_T) corresponding to the number of steps T_layout is added to X_out_hinit. Fine details in X_out_hinit are erased, resulting in a noisy image with only a general semantic contour layout remaining. Figure X _layout. No constraints are placed on the structure or selection of AI-UpBlock here, which may include but is not limited to GAN, simple Conv encoding, etc.;

[0216] Step 5 (3): If a sliding window slice inference link is used, slice X_out_s according to [x_window1, x_window2, ..., x_windowN] obtained in Step 5 (1) to obtain [X_out_s_1, X_out_s_2, ..., X_out_s_N]. Input each slice into the 'semantic injection control module' to obtain the high-level semantic features [X_feature_1, X_feature_2, ..., X_feature_N] that decouple the basic image quality. The selection of the semantic injection control module includes, but is not limited to, high-level image semantic encoders such as clip encoders. If a direct push link is used, directly use the expanded small slice obtained in Step 4. Figure X The _out_s input is fed into the 'semantic injection control module' to obtain the high-level semantic features X_feature that decouple the basic image quality.

[0217] Step 5 (4): If a sliding window slicing inference link is used, slice the X_painted, mask image Mask, and X_layout obtained in Step 3 according to [x_window1,x_window2,…,x_windowN] obtained in Step 5 (1), and obtain the user-uploaded image slice [X_painted_1,X_painted_2,…,X_painted_N], the mask image Mask slice [Mask_1,Mask_2,…,Mask_N], and the X_layout slice [X_layout_1,X_layout_2,…,X_layout_N].

[0218] Step 5 (5) inputs the user-uploaded image extended map slice X_painted_i, mask image slice Mask_i, and X_layout_i obtained in Step 5 (4) into the extended map generation base module to obtain the noisy generated image X_out_t_i of each slice in the diffusion model. Among them, the extended map generation base module is a diffusion model, including but not limited to LDM, unetdiffuion, DiT and other diffusion model architectures; the user-uploaded image extended map slice X_painted_i, mask image slice Mask_i, and X_layout_i obtained in Step 5 (4) are jointly used as the input of the diffusion model, generally using but not limited to the concat joint method; X_feature_i obtained in Step 5 (3) interacts and fuses with the features in the diffusion network, including but not limited to concat, CA and other methods.

[0219] Step 5 (6) Perform weighted fusion on the noisy generated slice results [X_out_t_1,X_out_t_2,…,X_out_t_N] obtained in Step 5 to obtain the fused noisy slicing result. Figure X _out_t. The weighted fusion schemes here include, but are not limited to, the average weighting used by MultiDiffusion, or the Gaussian kernel weighting used by tile_diffusion.

[0220] Step 5 (7) The noisy intermediate data obtained in Step 5 (6) Figure X _out_t is divided according to [x_window1,x_window2,…,x_windowN] obtained in step 5 (1) to obtain [X_out_t_1',X_out_t_2',…,X_out_t_N'], which is used for the next step of noise reduction generation.

[0221] Step 5 (8) inputs the user-uploaded image extended map slice X_painted_i, the mask image slice Mask_i obtained in Step 5 (4), and the fused intermediate noisy map slice X_out_t_i' obtained in Step 5 (7) into the extended map generation base module to obtain the noisy generated image slice X_out_(t-1)_1 of each slice in the diffusion model. Similarly, the extended map generation base module is a diffusion model, including but not limited to LDM, unet diffusion, DiT and other diffusion model architectures; the user-uploaded image extended map slice X_painted_i, the mask image slice Mask_i obtained in Step 5 (4), and X_out_t_i' obtained in Step 5 (7) are jointly used as the input of the diffusion model, generally using but not limited to the concat joint method; X_feature_i obtained in Step 5 (3) interacts and fuses with the features in the diffusion network, including but not limited to concat, CA and other methods.

[0222] Step 5 (9) Perform weighted fusion on the noisy generated slice results [X_out_(t-1)_1,X_out_(t-1)_2,…,X_out_(t-1)_N] obtained in Step 5 (8) to obtain the fused noisy slice. Figure X _out_(t-1). The weighted fusion schemes here include, but are not limited to, the average weighting used by MultiDiffusion, or the Gaussian kernel weighting used by tile_diffusion.

[0223] Step 5 (10): Repeat steps 5 (7) to 5 (9) for a total of T times until the final high-quality map expansion result X_out_h is obtained.

[0224] The system architecture of this application embodiment is as follows: Figure 10 As shown, a two-stage scheme of 'generating a small-resolution image + super-resolution to a high-resolution image' is adopted. The user uploads the image to be expanded and specifies the expansion box. The pre-expansion image generation module generates a low-quality small image with coarse semantics. Then, the core device of this invention, the 'high-quality expansion image module that decouples semantics and basic quality', is called to carry out high-quality expansion image generation. The high-quality expansion image device is shown in the figure. The input consists of four elements: low-quality small image, original image, expansion box (mask image), and padding parameters (optional). The device mainly includes three core modules: expansion image generation base module, low-quality contour injection control module, and low-quality semantic injection control module.

[0225] The high-quality image expansion method proposed in this application can support the AI ​​image expansion feature to achieve 2k / 4k high-quality generation, including sharpness enhancement, texture detail enhancement, and fine structure correction, ensuring overall harmony, consistency, and realistic high quality.

[0226] Reference Figure 11 , Figure 11 This application provides an example of an image processing apparatus, as illustrated in the illustration. Figure 11 As shown, the image processing apparatus 1200 provided in this application embodiment may include:

[0227] The acquisition module 1201 is used to acquire a first image and a second image; the first image is obtained by expanding the image content of the second image;

[0228] The description of the acquisition module 1201 can be found in the description of step 901 in the above embodiments, and will not be repeated here.

[0229] The noise-adding module 1202 is used to add noise and extract features from the first image to obtain the noise-adding first image and the feature representation of the first image.

[0230] The description of the noise-adding module 1202 can be found in the description of step 902 in the above embodiment, and will not be repeated here.

[0231] The denoising module is used to perform image content expansion on the second image based on the second image, the first image after noise addition, and the feature representation to obtain a third image.

[0232] The description of the noise reduction module 1203 can be found in the description of step 903 in the above embodiment, and will not be repeated here.

[0233] In one possible implementation, the feature extraction specifically involves extracting semantic features from the first image.

[0234] In one possible implementation, the noisy first image is an image that includes the semantic contours of the first image.

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

[0236] Obtain indication information, which is used to indicate the location indication information of the area where the second image is located and the location indication information of the area where the image content of the second image is expanded;

[0237] The noise reduction module is specifically used for:

[0238] Based on the second image, the indication information, the noisy first image, and the feature representation, the second image is expanded to obtain a third image.

[0239] In one possible implementation, the indication information is mask information.

[0240] In one possible implementation, the noise reduction module is specifically used for:

[0241] Using the second image, the noisy first image, and the feature representation as input conditions, the noisy first image is denoised using a diffusion model to obtain the third image.

[0242] In one possible implementation, the second image is an image patch of the input image;

[0243] The device further includes:

[0244] The fusion module is used to fuse multiple images, including the third image, to obtain a fourth image, wherein each image is obtained by expanding the image content of an image block of the input image.

[0245] The following describes an execution device provided in an embodiment of this application. Please refer to [link / reference]. Figure 12 , Figure 12 This is a schematic diagram of an execution device provided in an embodiment of this application. The execution device 1300 can specifically be a virtual reality (VR) device, a mobile phone, a tablet, a laptop, a smart wearable device, a monitoring data processing device, or a server, etc., and is not limited thereto. Specifically, the execution device 1300 includes: a receiver 1301, a transmitter 1302, a processor 1303, and a memory 1304 (wherein the execution device 1300 may have one or more processors 1303). Figure 12(Taking a processor as an example), processor 1303 may include application processor 13031 and communication processor 13032. In some embodiments of this application, receiver 1301, transmitter 1302, processor 1303 and memory 1304 may be connected via bus or other means.

[0246] Memory 1304 may include read-only memory and random access memory, and provides instructions and data to processor 1303. A portion of memory 1304 may also include non-volatile random access memory (NVRAM). Memory 1304 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.

[0247] Processor 1303 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.

[0248] The methods disclosed in the embodiments of this application can be applied to or implemented by the processor 1303. The processor 1303 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 circuitry in the hardware of the processor 1303 or by instructions in software form. The processor 1303 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 1303 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 1304. Processor 1303 reads the information in memory 1304 and, in conjunction with its hardware, completes the steps of the above method.

[0249] Receiver 1301 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 1302 can be used to output digital or character information; transmitter 1302 can also be used to send instructions to the disk group to modify the data in the disk group.

[0250] In one embodiment of this application, the processor 1303 is used to execute the image processing method executed by the execution device in the above embodiment.

[0251] This application also provides a training device; please refer to [link / reference]. Figure 13 , Figure 13 This is a schematic diagram of a training device provided in an embodiment of this application. The training device 1400 can be equipped with... Figure 11Specifically, in the corresponding embodiment described, the training device 1400 is implemented by one or more servers. The training device 1400 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1414 (e.g., one or more processors) and memory 1432, and one or more storage media 1430 (e.g., one or more mass storage devices) for storing application programs 1442 or data 1444. The memory 1432 and storage media 1430 can be temporary or persistent storage. The program stored in the storage media 1430 may include one or more modules (not shown in the figure), each module including a series of instruction operations on the training device. Furthermore, the CPU 1414 may be configured to communicate with the storage media 1430 and execute the series of instruction operations in the storage media 1430 on the training device 1400.

[0252] The training device 1400 may also include one or more power supplies 1426, one or more wired or wireless network interfaces 1450, one or more input / output interfaces 1458; or, one or more operating systems 1441, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0253] In this embodiment of the application, the central processing unit 1414 is used to execute... Figure 8 The method in the corresponding embodiment.

[0254] 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 image processing apparatus, or causes the computer to perform steps as performed by the aforementioned image processing apparatus.

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

[0256] 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 image processing method described in the above embodiments, or to cause the chip within the training device to execute the image 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).

[0257] For details, please refer to Figure 14 , Figure 14 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) 1500. The NPU 1500 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 1503, which is controlled by the controller 1504 to extract matrix data from the memory and perform multiplication operations.

[0258] In some implementations, the arithmetic circuit 1503 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 1503 is a two-dimensional pulsating array. The arithmetic circuit 1503 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 1503 is a general-purpose matrix processor.

[0259] 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 1502 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 1501 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 1508.

[0260] Unified memory 1506 is used to store input and output data. Weight data is directly transferred to weight memory 1502 via Direct Memory Access Controller (DMAC) 1505. Input data is also transferred to unified memory 1506 via DMAC.

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

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

[0263] The DMAC is mainly used to move input data from external memory DDR to unified memory 1506, or to weight data to weight memory 1502, or to input data to input memory 1501.

[0264] The vector computation unit 1507 includes multiple arithmetic processing units that further process the output of the computation circuit as 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.

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

[0266] The instruction fetch buffer 1509 connected to the controller 1504 is used to store the instructions used by the controller 1504;

[0267] Unified memory 1506, input memory 1501, weighted memory 1502, and instruction fetch memory 1509 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0268] 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.

[0269] 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.

[0270] 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.

[0271] 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.

[0272] 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. An image processing method, characterized in that, The method includes: Acquire a first image and a second image; the first image is obtained by expanding the image content of the second image. The first image is subjected to noise addition and feature extraction to obtain the noisy first image and the feature representation of the first image. Based on the second image, the first image with added noise, and the feature representation, the second image is expanded to obtain a third image.

2. The method according to claim 1, characterized in that, The feature extraction specifically involves extracting the semantic features of the first image.

3. The method according to claim 1 or 2, characterized in that, The first image after adding noise is an image that includes the semantic contours of the first image.

4. The method according to any one of claims 1 to 3, characterized in that, The method further includes: Obtain indication information, which is used to indicate the location indication information of the area where the second image is located and the location indication information of the area where the image content of the second image is expanded; The step of expanding the image content of the second image based on the second image, the noisy first image, and the feature representation to obtain the third image includes: Based on the second image, the indication information, the noisy first image, and the feature representation, the second image is expanded to obtain a third image.

5. The method according to claim 4, characterized in that, The indication information is mask information.

6. The method according to any one of claims 1 to 5, characterized in that, The step of expanding the image content of the second image based on the second image, the noisy first image, and the feature representation to obtain the third image includes: Using the second image, the noisy first image, and the feature representation as input conditions, the noisy first image is denoised using a diffusion model to obtain the third image.

7. The method according to any one of claims 1 to 6, characterized in that, The second image is a patch of the input image; The method further includes: Multiple images, including the third image, are fused to obtain a fourth image, where each image is obtained by expanding the image content of an image block of the input image.

8. An image processing apparatus, characterized in that, The device includes: The acquisition module is used to acquire a first image and a second image; the first image is obtained by expanding the image content of the second image; The noise-adding module is used to add noise and extract features from the first image to obtain the noise-adding first image and the feature representation of the first image. The denoising module is used to perform image content expansion on the second image based on the second image, the first image after noise addition, and the feature representation to obtain a third image.

9. The apparatus according to claim 8, characterized in that, The feature extraction specifically involves extracting the semantic features of the first image.

10. The apparatus according to claim 8 or 9, characterized in that, The first image after adding noise is an image that includes the semantic contours of the first image.

11. The apparatus according to any one of claims 8 to 10, characterized in that, The acquisition module is also used for: Obtain indication information, which is used to indicate the location indication information of the area where the second image is located and the location indication information of the area where the image content of the second image is expanded; The noise reduction module is specifically used for: Based on the second image, the indication information, the noisy first image, and the feature representation, the second image is expanded to obtain a third image.

12. The apparatus according to claim 11, characterized in that, The indication information is mask information.

13. The apparatus according to any one of claims 8 to 12, characterized in that, The noise reduction module is specifically used for: Using the second image, the noisy first image, and the feature representation as input conditions, the noisy first image is denoised using a diffusion model to obtain the third image.

14. The apparatus according to any one of claims 8 to 13, characterized in that, The second image is a patch of the input image; The device further includes: The fusion module is used to fuse multiple images, including the third image, to obtain a fourth image, wherein each image is obtained by expanding the image content of an image block of the input image.

15. A computing device, characterized in that, The device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions to cause the computing device to perform the method as described in any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that, Includes computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 7.

17. A computer program product, characterized in that, Includes computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 7.

18. A chip, characterized in that, It includes at least one processing unit and an interface circuit, the interface circuit being used to provide program instructions or data to the at least one processing unit, the at least one processing unit being used to execute the program instructions to implement the method of any one of claims 1 to 7.