Image processing method and related device
By converting the image to the frequency domain and using high-frequency and low-frequency information to predict noise, the problems of low image restoration accuracy and long time in existing technologies are solved, achieving high-quality image restoration and improved time efficiency.
Patent Information
- Application Number
- CN202310233422.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-28
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2043-02-28
AI Technical Summary
Existing image restoration technologies have low processing accuracy and long processing time, especially for large-size images, where the block processing leads to boundary artifacts and increased time consumption.
The image is converted to the frequency domain for processing, and the noise is predicted using high-frequency information and low-frequency information containing noise. The image is restored through the network, reducing the block processing, improving the image quality and reducing the processing time.
The image restoration quality is significantly improved, more details are restored, the sampling time is significantly reduced, and the total number of sampling steps is reduced to about 1/5 of the original.
Smart Images

Figure CN116258651B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence, and in particular to an image processing method and related devices. Background Art
[0002] Artificial intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a branch of computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0003] In real life, due to environmental factors and photographic techniques, captured images often contain degradation artifacts such as raindrops, blur, noise, and moiré, resulting in reduced image quality. Image restoration involves using technical means to remove these degradation artifacts from low-quality images, thereby restoring a clear, high-quality image.
[0004] Numerous image restoration methods exist in the industry, targeting single or multiple tasks. Early approaches were mostly based on traditional statistical priors. However, due to limitations, these methods cannot effectively remove degraded components and may produce color artifacts. In recent years, a number of deep learning-based methods have been proposed. These methods, most of which rely on CNNs or Transformers, directly predict the corresponding clear image from a blurred image through end-to-end training, often requiring large amounts of training data.
[0005] However, the processing accuracy of the image restoration technology in the prior art is low. Summary of the Invention
[0006] This application provides an image processing method that can improve image restoration quality and reduce processing time.
[0007] In a first aspect, an embodiment of the present application provides an image processing method, comprising: acquiring a first image; converting the first image into a frequency domain to obtain first data; the spatial resolution of the first data is lower than that of the first image; determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image; acquiring first low-frequency information, the first low-frequency information containing noise of a low-frequency channel of the high-quality image; obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to denoise the first low-frequency information to obtain second low-frequency information; the second low-frequency information and the first high-frequency information are used to obtain a second image.
[0008] In the embodiments of the present application, converting an image to the frequency domain for image restoration avoids the need for image segmentation (which requires separate processing and merging, potentially resulting in boundary artifacts, and excessive number of segments when the image size is large, resulting in long processing times), thereby improving restoration quality and reducing processing time. Furthermore, by predicting noise based on high-frequency information and low-frequency information containing noise, image restoration based on this noise yields higher quality images (recovering more detail while significantly reducing the total sampling time).
[0009] In a possible implementation, obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information includes obtaining first noise information through a first network based on the first high-frequency information, the first data, and the first low-frequency information.
[0010] In one possible implementation, obtaining first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed at an i-th iteration, where i is a positive integer greater than 1. The method further includes obtaining second noise information through the first network based on the first high-frequency information and the second low-frequency information at an i+1-th iteration, where the second noise information is used to denoise the second low-frequency information to obtain third low-frequency information. The first low-frequency information and the first high-frequency information are used to obtain a second image, including using the third low-frequency information and the first high-frequency information to obtain the second image.
[0011] In one possible implementation, the method further includes: performing target mapping on the second low-frequency information to obtain target low-frequency information; the target mapping does not include a noise estimation item; the second low-frequency information and the first high-frequency information are used to obtain a second image, including: the target low-frequency information and the first high-frequency information are used to fuse to obtain a fusion result, and the second image is obtained by mapping the fusion result to the spatial domain.
[0012] In one possible implementation, the second low-frequency information can be subjected to target mapping to obtain target low-frequency information; the target mapping does not include a noise estimation item; the target low-frequency information and the first high-frequency information are used to fuse (for example, splice) to obtain a fusion result, and the second image is obtained by mapping the fusion result to the spatial domain (for example, through an inverse wavelet transform).
[0013] Through the above method, the total number of sampling steps can be greatly reduced (for example, reduced to about 1 / 5 of the original), thereby improving the sampling efficiency.
[0014] In a possible implementation, the first low-frequency information is randomly generated noise.
[0015] In a possible implementation, determining the first high-frequency information according to the first data includes: determining the first high-frequency information through a second network according to the first data.
[0016] In a possible implementation, converting the first image into the frequency domain includes: converting the first image into the frequency domain through a second-order wavelet transform.
[0017] In a second aspect, the present application provides a model training method, the method comprising:
[0018] Acquire a first image and a second image; the first image and the second image are captured for the same scene; the second image is a high-quality image corresponding to the first image;
[0019] Converting the first image and the second image into a frequency domain to obtain first data and second data, respectively; the spatial resolution of the first data is lower than that of the first image; the spatial resolution of the second data is lower than that of the second image; the second data includes first low-frequency information; and the first low-frequency information is information of a low-frequency channel in the second data;
[0020] Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image;
[0021] Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to determine a first loss together with the second noise information; and the second noise information is randomly generated noise;
[0022] The first network is updated according to the first loss.
[0023] In the embodiments of the present application, converting an image to the frequency domain for image restoration avoids the need for image segmentation (which requires separate processing and merging, potentially resulting in boundary artifacts, and excessive number of segments when the image size is large, resulting in long processing times), thereby improving restoration quality and reducing processing time. Furthermore, by predicting noise based on high-frequency information and low-frequency information containing noise, image restoration based on this noise yields higher quality images (recovering more detail while significantly reducing the total sampling time).
[0024] In a possible implementation, obtaining first noise information through a first network according to the first high-frequency information and the first low-frequency information includes:
[0025] First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0026] In a possible implementation, obtaining the first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed at an i-th iteration, where i is a positive integer; and the method further includes:
[0027] superimposing noise on the first low-frequency information to obtain third low-frequency information;
[0028] At the (i+1)th iteration, third noise information is obtained through the first network based on the first high-frequency information and the third low-frequency information; the third noise information is used to determine the second loss together with fourth noise information; the fourth noise information is randomly generated noise;
[0029] The updated first network is updated according to the second loss.
[0030] In a possible implementation, determining first high-frequency information according to the first data includes:
[0031] Based on the first data, first high-frequency information is determined through a second network; the second network is a pre-trained network.
[0032] In a possible implementation, converting the first image and the second image into a frequency domain includes:
[0033] The first image and the second image are converted into the frequency domain by second-order wavelet transform.
[0034] In a third aspect, the present application provides an image processing device, comprising:
[0035] An acquisition module, configured to acquire a first image;
[0036] A processing module, configured to convert the first image into a frequency domain to obtain first data; the spatial resolution of the first data is lower than that of the first image;
[0037] Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image;
[0038] acquiring first low-frequency information, where the first low-frequency information includes noise in a low-frequency channel of the high-quality image;
[0039] Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; using the first noise information to denoise the first low-frequency information to obtain second low-frequency information;
[0040] The second low-frequency information and the first high-frequency information are used to obtain a second image.
[0041] In a possible implementation, the processing module is specifically configured to:
[0042] First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0043] In a possible implementation, obtaining the first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed in an i-th iteration, where i is a positive integer greater than 1; and the processing module is further configured to:
[0044] In the (i+1)th iteration, second noise information is obtained through the first network based on the first high-frequency information and the second low-frequency information, and the second noise information is used to denoise the second low-frequency information to obtain third low-frequency information;
[0045] The first low-frequency information and the first high-frequency information are used to obtain a second image, including:
[0046] The third low-frequency information and the first high-frequency information are used to obtain a second image.
[0047] In a possible implementation, the processing module is further configured to:
[0048] Applying target mapping to the second low-frequency information to obtain target low-frequency information; wherein the target mapping does not include a noise estimation item;
[0049] The processing module is specifically used to:
[0050] The target low-frequency information and the first high-frequency information are used to fuse to obtain a fusion result, and the second image is obtained by mapping the fusion result to a spatial domain.
[0051] In a possible implementation, the first low-frequency information is randomly generated noise.
[0052] In a possible implementation, the processing module is specifically configured to:
[0053] First high-frequency information is determined through a second network based on the first data.
[0054] In a possible implementation, the processing module is specifically configured to:
[0055] The first image is converted into the frequency domain by second-order wavelet transform.
[0056] In a fourth aspect, the present application provides a model training device, comprising:
[0057] an acquisition module, configured to acquire a first image and a second image; the first image and the second image are captured for the same scene; the second image is a high-quality image corresponding to the first image;
[0058] a processing module, configured to convert the first image and the second image into a frequency domain to obtain first data and second data, respectively; the spatial resolution of the first data is lower than that of the first image; the spatial resolution of the second data is lower than that of the second image; the second data includes first low-frequency information; and the first low-frequency information is information of a low-frequency channel in the second data;
[0059] Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image;
[0060] Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to determine a first loss together with the second noise information; and the second noise information is randomly generated noise;
[0061] The first network is updated according to the first loss.
[0062] In a possible implementation, the processing module is specifically configured to:
[0063] First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0064] In a possible implementation, obtaining the first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed at an i-th iteration, where i is a positive integer; and the processing module is further configured to:
[0065] superimposing noise on the first low-frequency information to obtain third low-frequency information;
[0066] At the (i+1)th iteration, third noise information is obtained through the first network based on the first high-frequency information and the third low-frequency information; the third noise information is used to determine the second loss together with fourth noise information; the fourth noise information is randomly generated noise;
[0067] The updated first network is updated according to the second loss.
[0068] In a possible implementation, the processing module is specifically configured to:
[0069] Based on the first data, first high-frequency information is determined through a second network; the second network is a pre-trained network.
[0070] In a possible implementation, the processing module is specifically configured to:
[0071] The first image and the second image are converted into the frequency domain by second-order wavelet transform.
[0072] In a third aspect, an embodiment of the present application provides an image processing device, which may include a memory, a processor, and a bus system, wherein the memory is used to store programs, and the processor is used to execute the programs in the memory to perform any optional method as described in the first aspect above.
[0073] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the above-mentioned first aspect and any optional method.
[0074] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising code, which, when executed, is used to implement the above-mentioned first aspect and any optional method.
[0075] In a sixth aspect, the present application provides a chip system comprising a processor configured to support an image processing device in implementing the functions described in the aforementioned aspects, such as transmitting or processing data or information described in the aforementioned methods. In one possible design, the chip system further comprises a memory configured to store program instructions and data necessary for executing or training the device. The chip system may consist solely of a chip or may include a chip and other discrete components. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] Figure 1A A structural diagram of the main framework of artificial intelligence;
[0077] Figure 1B and Figure 2 This is a schematic diagram of the application system framework of the present invention;
[0078] Figure 3 Schematic diagram of an optional hardware structure of the terminal;
[0079] Figure 4 A schematic diagram of the structure of a server;
[0080] Figure 5 This is a schematic diagram of the system architecture of this application;
[0081] Figure 6 A process for a cloud service;
[0082] Figure 7 This is a schematic diagram of the structure of a neural network model in an embodiment of the present application;
[0083] Figure 8 This is a schematic diagram of the structure of a neural network model in an embodiment of the present application;
[0084] Figure 9 The figure shows a process flow of an image processing method;
[0085] Figure 10 Schematic diagram of an image processing method;
[0086] Figure 11 Schematic diagram of an image processing method;
[0087] Figure 12A To indicate a beneficial effect;
[0088] Figure 12B It is a schematic diagram of an architecture;
[0089] Figure 13 A schematic diagram of the structure of an image processing device provided in an embodiment of the present application;
[0090] Figure 14 A schematic diagram of an execution device provided in an embodiment of the present application;
[0091] Figure 15 A schematic diagram of a training device provided in an embodiment of the present application;
[0092] Figure 16 A schematic diagram of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION
[0093] The following describes the embodiments of the present invention in conjunction with the accompanying drawings. The terms used in the embodiments of the present invention are only used to explain the specific embodiments of the present invention, and are not intended to limit the present invention.
[0094] The embodiments of the present application are described below in conjunction with the accompanying drawings. Those skilled in the art will appreciate that, with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0095] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, and this is merely a way of distinguishing the objects of the same attributes when describing them in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0096] First, the overall workflow of the artificial intelligence system is described. Figure 1A , Figure 1A The following diagram illustrates a structural diagram of the AI framework. This framework is explained below from two perspectives: the "intelligent information chain" (horizontal axis) and the "IT value chain" (vertical axis). The "intelligent information chain" reflects the entire process from data acquisition to processing. For example, it encompasses the general process of intelligent information perception, intelligent information representation and formation, intelligent reasoning, intelligent decision-making, and intelligent execution and output. Throughout this process, data undergoes a condensed progression from "data-information-knowledge-wisdom." The "IT value chain," encompassing the entire process from the underlying infrastructure of human intelligence, information (provided and processed by technology), to the system's industrial ecosystem, reflects the value that AI brings to the information technology industry.
[0097] (1) Infrastructure
[0098] Infrastructure provides computing power for AI systems, enabling communication with the outside world and supporting this through a foundational platform. External communication occurs through sensors; computing power is provided by intelligent chips (CPUs, NPUs, GPUs, ASICs, FPGAs, and other hardware accelerators). The foundational platform includes a distributed computing framework and network-related platform guarantees and support, including cloud storage and computing, and interconnected networks. For example, sensors communicate with the outside world to acquire data, which is then fed into the intelligent chips within the distributed computing system provided by the foundational platform for computation.
[0099] (2) Data
[0100] Data above the infrastructure layer represents data sources for AI. This data includes graphics, images, voice, and text, as well as IoT data from traditional devices. This includes business data from existing systems and sensor data such as force, displacement, liquid level, temperature, and humidity.
[0101] (3) Data processing
[0102] Data processing generally includes data training, machine learning, deep learning, search, reasoning, decision-making, etc.
[0103] Among them, machine learning and deep learning can symbolize and formalize data for intelligent information modeling, extraction, preprocessing, and training.
[0104] Reasoning refers to the process of simulating human intelligent reasoning in computers or intelligent systems, using formalized information to perform machine thinking and solve problems based on reasoning control strategies. Typical functions are search and matching.
[0105] Decision-making refers to the process of making decisions after intelligent information is reasoned, and usually provides functions such as classification, sorting, and prediction.
[0106] (4) General ability
[0107] After the data has undergone the data processing mentioned above, some general capabilities can be further formed based on the results of the data processing, such as algorithms or a general system, for example, translation, text analysis, computer vision processing, speech recognition, image recognition, etc.
[0108] (5) Smart products and industry applications
[0109] Smart products and industry applications refer to the products and applications of artificial intelligence systems in various fields. They are the encapsulation of the overall artificial intelligence solution, which productizes intelligent information decision-making and realizes practical application. Its application areas mainly include: smart terminals, smart transportation, smart medical care, autonomous driving, smart cities, etc.
[0110] The embodiments of the present application can be applied to image processing related tasks, such as image enhancement and other fields.
[0111] Next, we will first introduce the application scenarios of this application. This application can be applied to, but is not limited to, applications with image processing functions or cloud services provided by cloud-side servers. The following are introduced separately:
[0112] 1. Image processing applications
[0113] The product form of the embodiment of the present application can be an image processing application. The image processing application can be run on a terminal device or a cloud-side server.
[0114] In a possible implementation, an image processing application may implement image processing tasks or tasks based on image processing results.
[0115] In one possible implementation, a user can open an application with image processing functions installed on a terminal device. The application can obtain image data captured by the camera or image data specified by the user. The image processing application can obtain processing results based on the input data through the method provided in the embodiment of the present application, and present the image processing results or downstream task results based on the image processing results to the user (the presentation method can be but is not limited to display, saving, uploading to the cloud side, etc.).
[0116] In one possible implementation, a user can open an image processing application installed on a terminal device. The application can obtain image data captured by the camera or image data specified by the user. The image processing application can send the data (or the result obtained after certain processing of the data) to a server on the cloud side. The server on the cloud side generates an image processing result based on the image through the method provided in an embodiment of the present application, and transmits the image processing result or the downstream task result implemented based on the image processing result back to the terminal device. The terminal device can present the image processing result or the downstream task result implemented based on the image processing result to the user (the presentation method can be but is not limited to display, saving, uploading to the cloud side, etc.).
[0117] Next, the image processing application in the embodiment of this application is introduced from the perspective of functional architecture and product architecture that implements the functions.
[0118] Reference Figure 1B , Figure 1B This is a schematic diagram of the functional architecture of the image processing application in the embodiment of this application:
[0119] In one possible implementation, Figure 1B As shown, an image processing application 102 can receive input data 101 (e.g., image and event data) and generate processing results 103. The image processing application 102 can be executed on, for example, at least one computer system and includes computer code that, when executed by one or more computers, causes the computers to execute the image processing method described herein.
[0120] Reference Figure 2 , Figure 2 The following is a schematic diagram of the physical architecture for running image processing applications in the embodiment of the present application:
[0121] See also Figure 2 , Figure 2A 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 2 (The description is made by taking one server as an example), the server 200 can provide image processing services for one or more terminals or perform downstream tasks based on the image processing results.
[0122] Among them, the terminal 100 can be installed with an image processing application, or a web page related to image processing or downstream tasks based on image processing results can be opened. The above application and web page can provide an interface. The terminal 100 can receive relevant parameters entered by the user on the image processing or downstream task interface based on image processing results, and send the above parameters to the server 200. The server 200 can obtain the processing results based on the received parameters and return the processing results to the terminal 100.
[0123] It should be understood that in some optional implementations, the terminal 100 can also complete the data processing results based on the received parameters by itself without the need for cooperation from the server, and the embodiments of the present application are not limited to this.
[0124] Next describe Figure 2 The product form of the mid-terminal 100;
[0125] The terminal 100 in the embodiment of the present application can be a mobile phone, a tablet computer, a wearable device, an in-vehicle device, an augmented reality (AR) / virtual reality (VR) device, a laptop computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc., and the embodiment of the present application does not impose any restrictions on this.
[0126] Figure 3 A schematic diagram of an optional hardware structure of the terminal 100 is shown.
[0127] refer to Figure 3 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 3These are merely examples of terminals or multi-function devices and do not limit the terminal or multi-function device. The terminal or multi-function device may include more or fewer components than shown in the figure, or may combine certain components or different components.
[0128] The input unit 130 can be used to receive input digital or character information and generate key signal input related to user settings and function control of the portable multifunction device. Specifically, the input unit 130 may include a touch screen 131 (optional) and / or other input devices 132. The touch screen 131 can detect user touch operations on or near it (for example, operations performed on or near the touch screen using a finger, joint, stylus, or any other suitable object) and drive corresponding connected devices according to pre-set programs. The touch screen can detect user touch actions on the touch screen, convert the touch actions into touch signals and transmit them to the processor 170. It can also receive and execute commands sent by the processor 170; the touch signals include at least touch point coordinate information. The touch screen 131 provides an input interface and an output interface between the terminal 100 and the user. Touch screens can be implemented using various types, including resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch screen 131, the input unit 130 may also include other input devices. Specifically, the other input devices 132 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0129] Among them, other input devices 132 can obtain image data collected by a camera or image data specified by a user, etc.
[0130] The display unit 140 may be used to display information input by the user or provided to the user, various menus of the terminal 100, interactive interfaces, file display, and / or playback of any multimedia file. In an embodiment of the present application, the display unit 140 may be used to display interfaces of application programs related to image processing, etc.
[0131] Memory 120 can be used to store instructions and data. It primarily includes an instruction storage area and a data storage area. The data storage area can store various data, such as multimedia files and text. The instruction storage area can store software units such as the operating system, applications, and instructions required for at least one function, or subsets or extensions thereof. It may also include non-volatile random access memory (RAM). It provides processor 170 with management functions for the hardware, software, and data resources within the computing and processing device, supporting control software and applications. It is also used to store multimedia files and running programs and applications.
[0132] The processor 170 is the control center of the terminal 100. It connects all components of the terminal 100 using various interfaces and circuits. By executing instructions stored in the memory 120 and accessing data stored therein, it executes various functions of the terminal 100 and processes data, thereby providing overall control of the terminal device. Optionally, the processor 170 may include one or more processing units. Preferably, the processor 170 may integrate an application processor and a modem processor, with the application processor primarily processing the operating system, user interface, and application programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into the processor 170. In some embodiments, the processor and memory may be implemented on a single chip; in other embodiments, they may be implemented on separate chips. The processor 170 may also generate corresponding operational control signals and send them to the corresponding components of the computing and processing device. It may also read and process data in the software, particularly the data and programs in the memory 120, to enable the various functional modules therein to perform their corresponding functions, thereby controlling the corresponding components to operate as instructed.
[0133] Among them, the memory 120 can be used to store software codes related to the image processing method, 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 implement corresponding functions.
[0134] The RF unit 110 (optional) can be used to send and receive information or receive and send signals during a call. For example, after receiving downlink information from the base station, it is passed to the processor 170 for processing; in addition, the designed uplink data is sent to the base station. Generally, 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. In addition, the RF unit 110 can also communicate with network devices and other devices via wireless communication. This wireless communication can use any communication standard or protocol, including but not limited to Global System of 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.
[0135] In this embodiment of the present application, the RF unit 110 can send image data to the server 200 and receive information about processing results sent by the server 200.
[0136] It should be understood that the radio frequency unit 110 is optional and can be replaced by other communication interfaces, such as a network port.
[0137] The terminal 100 also includes a power supply 190 (such as a battery) for supplying power to various components. Preferably, the power supply can be logically connected to the processor 170 through a power management system, thereby managing functions such as charging, discharging, and power consumption through the power management system.
[0138] The terminal 100 further includes an external interface 180 , which may be a standard Micro USB interface or a multi-pin connector, and may be used to connect the terminal 100 to other devices for communication, or to connect a charger to charge the terminal 100 .
[0139] Although not shown, the terminal 100 may also include a flashlight, a wireless fidelity (WiFi) module, a Bluetooth module, sensors with different functions, etc., which will not be described in detail here. Some or all of the methods described below can be applied to Figure 3 In the terminal 100 shown.
[0140] Next describe Figure 2 The product form of the server 200;
[0141] Figure 4 A structural diagram of a server 200 is provided, such as Figure 4 As shown, the server 200 includes a bus 201, a processor 202, a communication interface 203, and a memory 204. The processor 202, the memory 204, and the communication interface 203 communicate with each other via the bus 201.
[0142] The bus 201 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 Only one thick line is used in the diagram, but this does not mean that there is only one bus or one type of bus.
[0143] The processor 202 may be any one or more of a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).
[0144] The memory 204 may include volatile memory, such as random access memory (RAM). The memory 204 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard drive (HDD), or solid state drive (SSD).
[0145] The memory 204 may be used to store software codes related to the image processing method, and the processor 202 may execute the steps of the image processing method of the chip, and may also schedule other units to implement corresponding functions.
[0146] It should be understood that the above-mentioned terminal 100 and server 200 can be centralized or distributed devices, and the processors in the above-mentioned terminal 100 and server 200 (such as processor 170 and processor 202) can be hardware circuits (such as application specific integrated circuit (ASIC), field-programmable gate array (FPGA), general-purpose processor, digital signal processor (DSP), microprocessor or microcontroller, etc.), or a combination of these hardware circuits. For example, the processor can be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0147] It should be understood that the steps related to the model reasoning process in the embodiments of the present application involve AI-related operations. When performing AI operations, the instruction execution architecture of the terminal device and the server is not limited to the processor combined with the memory architecture described above. Figure 5 The system architecture provided in the embodiments of the present application is introduced in detail.
[0148] See also Figure 5 , Figure 5 A system architecture diagram of the system provided in the embodiment of the present application, Figure 5 In the example, task processing system 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 device 560. The execution device 510 includes a computing module 511. The data acquisition device 560 is used to obtain large-scale, open-source data sets (i.e., training sets) required by users and store the training sets in the database 530. The training device 520 trains the target model / rule 501 based on the training sets maintained in the database 530. The trained neural network is then applied on the execution device 510. The execution device 510 can access data, code, etc. in the data storage system 550, or store data, instructions, etc. in the data storage system 550. The data storage system 550 can be located in the execution device 510, or it can be an external memory relative to the execution device 510.
[0149] The trained neural network obtained after training the target model / rule 501 by the training device 520 can be applied to different systems or devices (i.e., the execution device 510), which can be edge devices or end-side devices, such as mobile phones, tablets, laptops, monitoring systems (such as cameras), security systems, etc. Figure 5 In the embodiment, the execution device 510 is configured with an I / O interface 512 for data exchange with external devices. The "user" can input data into the I / O interface 512 through the client device 540. For example, the client device 540 can be a camera device of a monitoring system. The images and event data captured by the camera device are input as input data to the computing module 511 of the execution device 510. The computing module 511 processes the input target image to obtain a processing result, and then outputs the processing result to the camera device or directly displays it on the display interface of the execution device 510 (if any). In addition, in some embodiments of the present application, the client device 540 can also be integrated into the execution device 510. For example, when the execution device 510 is a mobile phone, the target task can be directly obtained through the mobile phone (for example, the image and event data can be captured by the camera of the mobile phone) or the target task sent by other devices (for example, another mobile phone). The computing module 511 in the mobile phone then detects the target task and obtains the detection result, and directly presents the detection result on the display interface of the mobile phone. The product forms of the execution device 510 and the client device 540 are not limited here.
[0150] It is worth noting that Figure 5 This is only a schematic diagram of a system architecture provided by an embodiment of the present application. The positional relationship between the devices, components, modules, etc. shown in the figure does not constitute any limitation. For example, Figure 5 In the embodiment, the data storage system 550 is an external memory relative to the execution device 510. In other cases, the data storage system 550 can also be placed in the execution device 510. It should be understood that the execution device 510 can be deployed in the client device 540.
[0151] From the inference side of the model:
[0152] In the embodiment of the present application, the computing module 511 of the above-mentioned execution device 520 can obtain the code stored in the data storage system 550 to implement the steps related to the model reasoning process in the embodiment of the present application.
[0153] In an embodiment of the present application, the computing module 511 of the execution device 520 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0154] Specifically, the computing module 511 of the execution device 520 can be a hardware system with the function of executing instructions, and the steps related to the model reasoning process provided in the embodiment of the present application can be software codes stored in the memory. The computing module 511 of the execution device 520 can obtain the software code from the memory and execute the obtained software code to implement the steps related to the model reasoning process provided in the embodiment of the present application.
[0155] It should be understood that the computing module 511 of the execution device 520 can be a combination of a hardware system that does not have the function of executing instructions and a hardware system that has the function of executing instructions. Some of the steps related to the model reasoning process provided in the embodiment of the present application can also be implemented by the hardware system that does not have the function of executing instructions in the computing module 511 of the execution device 520, which is not limited here.
[0156] From the training side of the model:
[0157] In the embodiment of the present application, the training device 520 can obtain the memory ( Figure 5 Not shown in the figure, the code stored in the training device 520 can be integrated into or deployed separately from the training device 520 to implement the steps related to model training in the embodiments of the present application.
[0158] In an embodiment of the present application, the training device 520 may include a hardware circuit (such as an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a general-purpose processor, a digital signal processor (DSP), a microprocessor or a microcontroller, etc.), or a combination of these hardware circuits. For example, the training device 520 may be a hardware system with an instruction execution function, such as a CPU, DSP, etc., or a hardware system without an instruction execution function, such as an ASIC, FPGA, etc., or a combination of the above-mentioned hardware systems without an instruction execution function and hardware systems with an instruction execution function.
[0159] It should be understood that the training device 520 can be a combination of a hardware system that does not have the function of executing instructions and a hardware system that has the function of executing instructions. Some of the steps related to model training provided in the embodiments of the present application can also be implemented by the hardware system in the training device 520 that does not have the function of executing instructions, which is not limited here.
[0160] 2. Image processing cloud services provided by the server:
[0161] In a possible implementation, the server may provide image processing services or perform downstream tasks based on image processing results to the terminal side through an application programming interface (API).
[0162] Among them, 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 processing results based on the received parameters and return the processing results (such as enhanced image data) to the terminal.
[0163] The description of the terminal and the server can be the same as that of the above embodiments, and will not be repeated here.
[0164] like Figure 6 This section shows the process of using an image processing cloud service provided by a cloud platform.
[0165] 1. Activate and purchase content review services.
[0166] 2. Users can download the software development kit (SDK) corresponding to the content review service. Usually, the cloud platform provides multiple development versions of the SDK for users to choose according to the requirements of the development environment, such as JAVA version SDK, Python version SDK, PHP version SDK, Android version SDK, etc.
[0167] 3. After the user downloads the corresponding version of the SDK to the local computer as needed, import the SDK project into the local development environment, configure and debug it in the local development environment. The local development environment can also be used to develop other functions, forming an application that integrates image processing capabilities.
[0168] 4. When image processing applications are used and need to perform image processing or downstream tasks based on the image processing results, they can trigger API calls for image processing or downstream tasks based on the image processing results. When an application triggers image processing or performs downstream tasks based on the image processing results, it initiates an API request to a running instance of the image processing service in the cloud environment. The API request includes an image, and the running instance in the cloud environment processes the image and obtains the processing results.
[0169] 5. The cloud environment returns the processing results to the application, thereby completing the image processing or making downstream task service calls based on the image processing results.
[0170] Since the embodiments of the present application involve the application of a large number of neural networks, in order to facilitate understanding, the relevant terms and related concepts such as neural networks involved in the embodiments of the present application are first introduced below.
[0171] (1) Neural Network
[0172] A neural network can be composed of neural units. A neural unit can refer to an operation unit that takes xs (i.e., input data) and intercept 1 as input. The output of the operation unit can be:
[0173]
[0174] Where s = 1, 2, ... n, 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, which is used to introduce nonlinear characteristics into the neural network to convert the input signal of the neural unit into the output signal. The output signal of the activation function can be used as the input of the next convolutional layer, and the activation function can be a sigmoid function. A neural network is a network formed by connecting multiple single neural units mentioned above, 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. The local receptive field can be an area composed of several neural units.
[0175] (2) Convolutional neural network (CNN) is a deep neural network with a convolutional structure. Convolutional neural network contains a feature extractor consisting of a convolution layer and a subsampling layer, which can be regarded as a filter. The convolution layer refers to the neuron layer in the convolutional neural network that performs convolution processing on the input signal. In the convolution layer of the convolutional neural network, a neuron can only be connected to some neurons in the adjacent layer. A convolution layer usually contains several feature planes, and each feature plane can be composed of some rectangularly arranged neural units. The neural units in the same feature plane share weights, and the shared weights here are convolution kernels. Shared weights can be understood as the way of extracting features is independent of position. The convolution kernel can be formalized as a matrix of random size, and the convolution kernel can obtain reasonable weights through learning during the training process of the convolutional neural network. In addition, the direct benefit of shared weights is to reduce the connections between the layers of the convolutional neural network, while reducing the risk of overfitting.
[0176] CNN is a very common neural network. Figure 7 This section focuses on a detailed introduction to the structure of CNNs. As mentioned in the previous basic concepts, a convolutional neural network is a deep neural network with a convolutional structure and a deep learning architecture. Deep learning architectures use machine learning algorithms to perform multiple levels of learning at different levels of abstraction. As a deep learning architecture, a CNN is a feed-forward artificial neural network in which individual neurons respond to input images.
[0177] like Figure 7As shown, the convolutional neural network (CNN) 200 may include an input layer 210 , a convolutional layer / pooling layer 220 (wherein the pooling layer is optional), and a fully connected layer 230 .
[0178] Convolutional layer / pooling layer 220:
[0179] Convolutional layer:
[0180] like Figure 7 The convolutional layer / pooling layer 220 shown may include layers 221-226. For example, in one implementation, layer 221 is a convolutional layer, layer 222 is a pooling layer, layer 223 is a convolutional layer, layer 224 is a pooling layer, layer 225 is a convolutional layer, and layer 226 is a pooling layer. In another implementation, layers 221 and 222 are convolutional layers, layer 223 is a pooling layer, layers 224 and 225 are convolutional layers, and layer 226 is a pooling layer. That is, the output of a convolutional layer can be used as the input of a subsequent pooling layer, or as the input of another convolutional layer to continue the convolution operation.
[0181] The following will take convolutional layer 221 as an example to introduce the internal working principle of a convolutional layer.
[0182] Convolution layer 221 can include multiple convolution operators, also known as kernels. In image processing, a convolution operator acts as a filter that extracts specific information from an input image matrix. A convolution operator is essentially a weight matrix, which is typically predefined. During the convolution operation, the weight matrix is typically applied horizontally to the input image, pixel by pixel (or two pixels by two pixels, depending on the stride), thereby extracting specific features from the image. The size of the weight matrix should be related to the image size. It is important to note that the depth dimension of the weight matrix is the same as the depth dimension of the input image. During the convolution operation, the weight matrix extends across the entire depth of the input image. Therefore, convolution with a single weight matrix produces a convolution output with a single depth dimension. However, in most cases, a single weight matrix is not used. Instead, multiple weight matrices of the same size (rows × columns) are applied, i.e., multiple homogeneous matrices. The outputs of each weight matrix are stacked to form the depth dimension of the convolved image, where the dimension is determined by the "multiple" mentioned above. Different weight matrices can be used to extract different features from an image. For example, one weight matrix can be used to extract edge information, another weight matrix can be used to extract specific colors, and yet another weight matrix can be used to blur unwanted noise in the image. The weight matrices have the same size (rows × columns), and the feature maps extracted by these weight matrices are also the same size. The extracted feature maps of the same size are then merged to form the output of the convolution operation.
[0183] The weight values in these weight matrices need to be obtained through a lot of training in practical applications. The weight matrices formed by the weight values obtained through training can be used to extract information from the input image, so that the convolutional neural network 200 can make correct predictions.
[0184] When the convolutional neural network 200 has multiple convolutional layers, the initial convolutional layer (for example, 221) often extracts more general features, which can also be called low-level features. As the depth of the convolutional neural network 200 increases, the features extracted by the later convolutional layers (for example, 226) become more and more complex, such as high-level semantic features. Features with higher semantics are more suitable for the problem to be solved.
[0185] Pooling layer:
[0186] Since it is often necessary to reduce the number of training parameters, it is often necessary to periodically introduce a pooling layer after the convolution layer, such as Figure 7The layers 221-226 illustrated in Figure 220 can be a convolutional layer followed by a pooling layer, or multiple convolutional layers followed by one or more pooling layers. During image processing, the sole purpose of the pooling layer is to reduce the spatial size of the image. The pooling layer can include an average pooling operator and / or a maximum pooling operator to sample the input image to obtain a smaller image. The average pooling operator can calculate the pixel values in the image within a specific range to produce an average value as the result of average pooling. The maximum pooling operator can take the pixel with the largest value within a specific range as the result of maximum pooling. In addition, just as the size of the weight matrix used in the convolutional layer should be related to the image size, the operators in the pooling layer should also be related to the image size. The size of the image output after processing by the pooling layer can be smaller than the size of the image input to the pooling layer. Each pixel in the image output by the pooling layer represents the average or maximum value of the corresponding sub-region of the image input to the pooling layer.
[0187] Fully connected layer 230:
[0188] After being processed by the convolution layer / pooling layer 220, the convolution neural network 200 is still not sufficient to output the required output information. As mentioned above, the convolution layer / pooling layer 220 only extracts features and reduces the parameters brought by the input image. However, in order to generate the final output information (the required class information or other related information), the convolution neural network 200 needs to use the fully connected layer 230 to generate one or a group of outputs of the required number of classes. Therefore, the fully connected layer 230 may include multiple hidden layers (such as Figure 7 As shown in 231, 232 to 23n), the parameters contained in the multi-layer hidden layer can be pre-trained based on relevant training data of a specific task type, for example, the task type may include image recognition, image classification, image super-resolution reconstruction, etc.
[0189] After the multiple hidden layers in the fully connected layer 230, the last layer of the entire convolutional neural network 200 is the output layer 240, which has a loss function similar to the classification cross entropy, specifically for calculating the prediction error. Once the forward propagation of the entire convolutional neural network 200 (such as Figure 7 The propagation from 210 to 240 is forward propagation) and the reverse propagation (such as Figure 7 The propagation from 240 to 210 is called back propagation) and then the weight values and biases of the aforementioned layers will be updated to reduce the loss of the convolutional neural network 200 and the error between the result output by the convolutional neural network 200 through the output layer and the ideal result.
[0190] It should be noted that if Figure 7The convolutional neural network 200 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models, for example, only including Figure 7 For example, the convolutional neural network used in the embodiment of the present application may only include the input layer 210, the convolution layer / pooling layer 220 and the output layer 240.
[0191] It should be noted that if Figure 7 The convolutional neural network 100 shown is only an example of a convolutional neural network. In specific applications, the convolutional neural network can also exist in the form of other network models, such as Figure 8 The multiple convolutional layers / pooling layers shown are operated in parallel, and the features extracted from each layer are input to the fully connected layer 230 for processing.
[0192] (3) Deep Neural Networks
[0193] Deep Neural Network (DNN), also known as multi-layer neural network, can be understood as a neural network with many hidden layers. There is no special metric for "many" here. Based on the position of different layers in DNN, the neural network inside DNN can be divided into three categories: input layer, hidden layer, and output layer. Generally speaking, the first layer is the input layer, the last layer is the output layer, and the layers in between are all hidden layers. The layers are fully connected, that is, any neuron in the i-th layer must be connected to any neuron in the i+1-th layer. Although DNN looks complicated, the work of each layer is actually not complicated. Simply put, it is the following linear relationship expression: in, is the input vector, is the output vector, is the offset vector, W is the weight matrix (also called coefficient), and α() is the activation function. Each layer is just an input vector After such a simple operation, the output vector Since there are many DNN layers, the coefficient W and the offset vector The definition of these parameters in DNN is as follows: Take the coefficient W as an example: Assume that in 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 of the coefficient W, while the subscript corresponds to the output of the third layer index 2 and the input of the second layer index 4. In summary, the coefficient from the kth neuron in the L-1th layer to the jth neuron in the Lth layer is defined as It's important to note that the input layer has no W parameter. In deep neural networks, more hidden layers allow the network to better capture complex real-world situations. Theoretically, a model with more parameters has higher complexity and greater "capacity," meaning it can handle 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 matrices for all layers of a trained deep neural network (a weight matrix formed by the vectors W across many layers).
[0194] (4) Loss function
[0195] During the training of a deep neural network, because we want the output of the deep neural network to be as close as possible to the desired predicted value, we can compare the current network's predicted value with the desired target value and then update the weight vector of each layer of the neural network based on the difference between the two. (Of course, before the first update, there is usually an initialization process, which pre-configures the parameters for each layer in the deep neural network.) For example, if the network's predicted value is too high, the weight vector is adjusted to make it predict a lower value. This adjustment is continued until the deep neural network can predict the desired target value or a value very close to the desired target value. Therefore, it is necessary to predefine "how to compare the difference between the predicted value and the target value." This is the loss function (or objective function), which is an important equation used to measure the difference between the predicted value and the target value. For example, the loss function output value (loss) indicates a greater difference, so training a deep neural network becomes a process of minimizing this loss.
[0196] (5) Backpropagation algorithm
[0197] The back propagation (BP) algorithm can be used to correct the size of the initial model parameters during training, reducing the model's error loss. Specifically, forward propagation of the input signal to the output generates error loss. This error loss information is then backpropagated to update the parameters in the initial model, thereby converging the error loss. The BP algorithm is a backward propagation movement driven by error loss, aiming to obtain optimal model parameters, such as the weight matrix.
[0198] (6) Diffusion Models: Diffusion Models refers to defining a Markov chain with a diffusion step, gradually adding random noise to the data, and then learning the inverse diffusion process to construct the required data samples from the noise.
[0199] (7) Image Restoration: Image Restoration refers to the process of removing the degraded components in low-quality images caused by various factors and restoring high-quality images with complete details.
[0200] This application can be applied in practical scenarios such as image enhancement and restoration, terminal applications, and autonomous driving.
[0201] For example, during autonomous driving, the front window view is often blocked due to rainy weather, which poses a great safety hazard. This application can effectively remove raindrops and restore a clear view.
[0202] For example, due to the influence of ambient light, photos taken by existing devices are often underexposed. This application can significantly enhance low-light photos to natural light levels, facilitating subsequent processing.
[0203] For example, when taking a picture of the screen directly with the terminal camera, since the screen is refreshed in real time, the photo taken by the camera will have obvious moiré patterns. This application can effectively remove the moiré patterns and make up for the shortcomings of the terminal device.
[0204] In real life, due to environmental factors and photographic techniques, captured images often contain degradation artifacts such as raindrops, blur, noise, and moiré, resulting in reduced image quality. Image restoration involves using technical means to remove these degradation artifacts from low-quality images, thereby restoring a clear, high-quality image.
[0205] Numerous image restoration methods exist in the industry, targeting single or multiple tasks. Early approaches were mostly based on traditional statistical priors. However, due to limitations, these methods cannot effectively remove degraded components and may produce color artifacts. In recent years, a number of deep learning-based methods have been proposed. These methods, most of which rely on CNNs or Transformers, directly predict the corresponding clear image from a blurred image through end-to-end training, often requiring large amounts of training data.
[0206] However, the processing accuracy of the image restoration technology in the prior art is low.
[0207] In order to solve the above problems, the present application provides an image processing method, which can be a feedforward process of model training or an inference process.
[0208] Reference Figure 9 , Figure 9 An image processing method provided in an embodiment of the present application is as follows: Figure 9 As shown, the image processing method provided by this application includes:
[0209] 901. Acquire a first image.
[0210] In an embodiment of the present application, the execution entity of step 901 may be a terminal device, which may be a portable mobile device, such as but not limited to a mobile or portable computing device (such as a smart phone), a personal computer, a server computer, a handheld device (such as a tablet) or a laptop device, a multi-processor system, a game console or controller, a microprocessor-based system, a set-top box, a programmable consumer electronic product, a mobile phone, a mobile computing and / or communication device with a wearable or accessory form factor (such as a watch, glasses, a headset or earbuds), a network PC, a minicomputer, a mainframe computer, a distributed computing environment including any of the above systems or devices, and the like.
[0211] In the embodiment of the present application, the execution entity of step 1001 may be a server on the cloud side, and the server may receive the first image sent from the terminal device, and then the server may obtain the first image.
[0212] In a possible implementation, the first image may be a low-quality image, an image occluded by natural environment such as raindrops, an image that is underexposed due to the influence of ambient light, or an image with obvious moiré patterns.
[0213] 902. Convert the first image into a frequency domain to obtain first data; the spatial resolution of the first data is lower than that of the first image.
[0214] In a possible implementation, the first image may be converted into the frequency domain by a second-order wavelet transform.
[0215] like Figure 11 As shown in the left half, the spatial domain RGB low-quality image X d Perform second-order Haar wavelet transform to obtain the image x in the wavelet domain d , optionally, the image size changes from H×W×3 to This results in a 16-fold reduction in spatial resolution, which can speed up processing time.
[0216] By using the above method to introduce the diffusion model from the spatial domain to the wavelet domain using wavelet transform, the image processing time can be significantly reduced (the model only needs to learn part of the image spectrum, which is relatively simpler. At the same time, due to the reduction in spatial resolution, the model takes less time to process the image).
[0217] 903. Determine first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image.
[0218] In a possible implementation, the first high-frequency information can be determined based on the first data through a pre-trained second network.
[0219] Optionally, the second network can be composed of multiple (e.g. 14) convolutional layers with residual structures. Its main function is to learn the difference between the high-frequency spectrum of the low-quality image and the high-frequency spectrum of its corresponding clear image, so as to predict the high-frequency spectrum of the low-quality image after restoration.
[0220] It should be understood that in the embodiments of the present application, the high-frequency spectrum of an image (or the information corresponding to the high-frequency channel) is relative to the low-frequency spectrum of the image (or the information corresponding to the low-frequency channel). The frequencies corresponding to the high-frequency spectrum are higher than those corresponding to the low-frequency spectrum.
[0221] For example, the high-quality image corresponding to the first image may include information of multiple channels, wherein the multiple channels may include a high-frequency channel and a low-frequency channel relative to the high-frequency channel.
[0222] 904. Acquire first low-frequency information, where the first low-frequency information includes noise in a low-frequency channel of the high-quality image.
[0223] In a possible implementation, step 904 and the subsequent step 905 may be an iterative process, and the result obtained in step 905 may be used as the first low-frequency information obtained in the next step 904 .
[0224] In one possible implementation, if step 904 is the first iteration, the first low-frequency information may be randomly generated noise (e.g., Gaussian white noise). If step 904 is the i-th iteration (i is greater than 1), the first low-frequency information may be randomly generated noise (e.g., Gaussian white noise).
[0225] 905. Obtain first noise information through a first network based on the first high-frequency information and the first low-frequency information; use the first noise information to denoise the first low-frequency information to obtain second low-frequency information.
[0226] In a possible implementation, the first high-frequency information and the first low-frequency information may be input into a first network. The first network is a pre-trained network, and the first noise information may be obtained according to the first high-frequency information and the first low-frequency information.
[0227] In a possible implementation, the first data may also be input into the first network, that is, the first noise information may be obtained through the first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0228] In one possible implementation, obtaining first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed at an i-th iteration, where i is a positive integer greater than 1. At an i+1-th iteration, obtaining second noise information through the first network based on the first high-frequency information and the second low-frequency information, the second noise information is used to denoise the second low-frequency information to obtain third low-frequency information.
[0229] In the sampling frame, the initial time is t=T, and a Gaussian white noise Input into the noise estimation network, the purpose of the network is to estimate the noise that needs to be removed at each moment from the noise, step by step The noise in the image is removed until it becomes a low-frequency spectrum of a clear image. In this noise removal process, the low-quality image x is also required to be d and the high-frequency spectrum of the clear image predicted by HFRM The two are input together into the noise estimation network as the estimation condition. t decreases from T, and the iteration is repeated until t = 0.
[0230] Next, we will introduce how to denoise the first low-frequency information based on the first noise information to obtain the second low-frequency information:
[0231] In one possible implementation, the second low-frequency information can be subjected to target mapping to obtain target low-frequency information; the target mapping does not include a noise estimation item; the target low-frequency information and the first high-frequency information are used to fuse (for example, splice) to obtain a fusion result, and the second image is obtained by mapping the fusion result to the spatial domain (for example, through an inverse wavelet transform).
[0232] Most of the existing diffusion model-related works use DDIM's DIS. In this method, the entire sampling process (t=t-1, 1≤t≤T) uses skip sampling with a quantization interval S as the span to reduce the number of sampling steps from T to T / S. Based on this sampling method, the embodiment of the present application further explores a high-efficiency conditional sampling algorithm that can directly predict the original image at the middle moment M in the sampling process, that is, there is no need to go through the entire DIS process. At this time, the number of sampling steps is (TM) / S. The flow of the sampling method is: it can be a preset proportion of T (such as 80%). For example, the formula for obtaining Xt-1 as follows is the corresponding implementation of denoising the first low-frequency information according to the first noise information, and the formula for obtaining X0 is the corresponding implementation of the target mapping.
[0233]
[0234]
[0235] Through the above method, the total number of sampling steps can be greatly reduced (for example, reduced to about 1 / 5 of the original), thereby improving the sampling efficiency.
[0236] In a possible implementation, the second low-frequency information and the first high-frequency information are used to obtain a second image.
[0237] In the sampling frame, when the Gaussian white noise Restore the low-frequency spectrum of a clear image Then, compare it with the high-frequency spectrum of the clear image predicted by HFRM Fusion, and second-order Haar wavelet inverse transform, we get the low-quality image X d Spatial domain restoration results.
[0238] The present application provides an image processing method, the method comprising: obtaining a first image; converting the first image to a frequency domain to obtain first data; the spatial resolution of the first data being lower than that of the first image; determining first high-frequency information based on the first data; the first high-frequency information being a prediction result of the high-frequency channel of a high-quality image corresponding to the first image; obtaining first low-frequency information, the first low-frequency information containing noise in the low-frequency channel of the high-quality image; obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information being used to denoise the first low-frequency information to obtain second low-frequency information; and the second low-frequency information and the first high-frequency information being used to obtain a second image. In an embodiment of the present application, converting the image to the frequency domain for image restoration can avoid image segmentation (segments need to be processed separately and then merged, which may result in boundary artifacts, and when the image size is large, the number of segments is too large, resulting in a long processing time), thereby improving restoration quality and reducing processing time. In addition, by predicting noise based on high-frequency information and low-frequency information containing noise, image restoration based on the noise yields higher image quality (capable of recovering more details while significantly reducing the total sampling time).
[0239] Reference Figure 10 , Figure 10 A model training method provided in the embodiment of the present application is as follows: Figure 10 As shown, the model training method provided in this application includes:
[0240] 1001. Acquire a first image and a second image; the first image and the second image are captured for the same scene; the second image is a high-quality image corresponding to the first image.
[0241] In a possible implementation, the first image may be a low-quality image, an image occluded by natural environment such as raindrops, an image that is underexposed due to the influence of ambient light, or an image with obvious moiré patterns.
[0242] In one possible implementation, the second image may be a high-quality image corresponding to the first image, for example, an image obtained by removing raindrops from the first image, solving underexposure problems (for example, enhancing a dark photo to natural light levels), or removing moiré patterns.
[0243] 1002. Convert the first image and the second image into the frequency domain to obtain first data and second data, respectively; the spatial resolution of the first data is lower than that of the first image; the spatial resolution of the second data is lower than that of the second image; the second data includes first low-frequency information; and the first low-frequency information is information of a low-frequency channel in the second data.
[0244] In a possible implementation, the first image and the second image may be converted into a frequency domain by a second-order wavelet transform.
[0245] like Figure 11 As shown in the left half, the spatial domain RGB low-quality image X d Perform the second-order Haar wavelet transform together with the corresponding clear image X0 to obtain the image x in the wavelet domain d and x0, optional, the image size changes from H×W×3 to This results in a 16-fold reduction in spatial resolution, which speeds up processing time.
[0246] 1003. Determine first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image.
[0247] In a possible implementation, the first high-frequency information can be determined based on the first data through a second network; the second network is a pre-trained network.
[0248] When training the second network, the frequency domain data corresponding to the low-quality image can be input into the second network to predict the information of the high-frequency channels of the high-quality image corresponding to the low-quality image, and obtain the information of the high-frequency channels of the high-quality image corresponding to the real low-quality image. Based on the two, the loss is constructed to update the second network, thereby enabling the second network to have the ability to predict the information of the high-frequency channels of the high-quality image corresponding to the low-quality image based on the frequency domain data corresponding to the low-quality image.
[0249] 1004. Obtain first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to determine a first loss together with the second noise information; and the second noise information is randomly generated noise.
[0250] In a possible implementation, the first noise information may be obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0251] In one possible implementation, obtaining first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed at an i-th iteration, where i is a positive integer; noise may also be superimposed on the first low-frequency information to obtain third low-frequency information; at an (i+1)-th iteration, obtaining third noise information through the first network based on the first high-frequency information and the third low-frequency information; the third noise information is used to determine a second loss together with fourth noise information; the fourth noise information is randomly generated noise; and the updated first network is updated based on the second loss.
[0252] In the training framework, the low-frequency spectrum of the high-quality image x0 after wavelet transformation is first added with different degrees of Gaussian white noise at different times t, and then sent to the noise estimation network. The noise estimation network is a classic U-network structure, whose purpose is to correctly estimate the noise superimposed on the low-frequency spectrum of the high-quality image x0 at each time. In this estimation process, the low-quality image x0 needs to be added at each time t. d and the high-frequency spectrum of the clear image predicted by HFRM The two are input together into the noise estimation network as the estimation condition. t increases from 0, and the iteration is repeated until t = T.
[0253] 1005. Update the first network according to the first loss.
[0254] In the embodiments of the present application, converting an image to the frequency domain for image restoration avoids the need for image segmentation (which requires separate processing and merging, potentially resulting in boundary artifacts, and excessive number of segments when the image size is large, resulting in long processing times), thereby improving restoration quality and reducing processing time. Furthermore, by predicting noise based on high-frequency information and low-frequency information containing noise, image restoration based on this noise yields higher quality images (recovering more detail while significantly reducing the total sampling time).
[0255] To compare the performance of the present application (WaveDM) with existing algorithms, Tables 1 to 4 show the performance of the present application (WaveDM) on the existing image raindrop removal dataset (RainDrop), defocus blur removal dataset (DPDD), moiré removal dataset (London's Buildings), and dark light enhancement dataset (LOL-v1). The evaluation metrics used are PSNR, SSIM, and recovery time. As can be seen from the table, the present application currently achieves the best results on both evaluation metrics, while having comparable speed.
[0256] Table 1
[0257]
[0258] Table 2
[0259]
[0260] Table 3
[0261]
[0262] Table 4
[0263]
[0264] The visual display of the beneficial effects of the embodiments of the present application is as follows Figure 12A As shown in the figure, it can be seen that compared with other existing methods, this application recovers more image details and the clarity is significantly better than the existing methods.
[0265] An architectural schematic of an embodiment of the present application can be as follows Figure 12B As shown in the figure, it includes a training framework and a sampling framework, which is mainly composed of wavelet transform and spectrum separation, high-frequency fine-tuning module, noise estimation network, high-efficiency sampling algorithm and inverse wavelet transform. The functions of each part are described as follows:
[0266] Wavelet transform: Use a specific wavelet to convert the image from the spatial domain to the wavelet domain to obtain the wavelet spectrum of the image;
[0267] High-frequency fine-tuning module: Recovers the high-frequency spectrum corresponding to the clear image from the high-frequency spectrum of the low-quality image;
[0268] Noise estimation network: Using the output of the high-frequency fine-tuning module and the low-frequency spectrum remaining from spectrum separation as conditions, it iteratively recovers the low-frequency spectrum of the high-quality image from Gaussian white noise.
[0269] High-efficiency conditional sampling algorithm: Using the output of the high-frequency fine-tuning module and the low-frequency spectrum remaining after spectrum separation as conditions, it directly predicts high-quality images during the intermediate sampling step, thereby reducing the number of sampling steps;
[0270] Inverse wavelet transform: The low-frequency spectrum of the high-quality image output by the noise network is combined with the high-frequency spectrum of the high-quality image output by the high-frequency fine-tuning module, and a specific inverse wavelet transform is performed to obtain a clear spatial domain RGB high-quality image.
[0271] Next, an image processing device provided by an embodiment of the present application is introduced from the perspective of the device. Figure 13 , Figure 13 This is a schematic diagram of the structure of an image processing device provided in an embodiment of the present application, as shown in FIG. Figure 13 As shown, an image processing device 1300 provided in an embodiment of the present application includes:
[0272] An acquisition module 1301 is configured to acquire a first image;
[0273] The specific description of the acquisition module 1301 can refer to the description of step 901 in the above embodiment, which will not be repeated here.
[0274] A processing module 1302 is configured to convert the first image into a frequency domain to obtain first data; the spatial resolution of the first data is lower than that of the first image;
[0275] Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image;
[0276] acquiring first low-frequency information, where the first low-frequency information includes noise in a low-frequency channel of the high-quality image;
[0277] Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; using the first noise information to denoise the first low-frequency information to obtain second low-frequency information;
[0278] The second low-frequency information and the first high-frequency information are used to obtain a second image.
[0279] The specific description of the processing module 1302 can refer to the description of steps 902 to 905 in the above embodiment, which will not be repeated here.
[0280] In a possible implementation, the processing module is specifically configured to:
[0281] First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0282] In a possible implementation, obtaining the first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed in an i-th iteration, where i is a positive integer greater than 1; and the processing module is further configured to:
[0283] In the (i+1)th iteration, second noise information is obtained through the first network based on the first high-frequency information and the second low-frequency information, and the second noise information is used to denoise the second low-frequency information to obtain third low-frequency information;
[0284] The first low-frequency information and the first high-frequency information are used to obtain a second image, including:
[0285] The third low-frequency information and the first high-frequency information are used to obtain a second image.
[0286] In a possible implementation, the processing module is further configured to:
[0287] Applying target mapping to the second low-frequency information to obtain target low-frequency information; wherein the target mapping does not include a noise estimation item;
[0288] The processing module is specifically used to:
[0289] The target low-frequency information and the first high-frequency information are used to fuse to obtain a fusion result, and the second image is obtained by mapping the fusion result to a spatial domain.
[0290] In a possible implementation, the first low-frequency information is randomly generated noise.
[0291] In a possible implementation, the processing module is specifically configured to:
[0292] First high-frequency information is determined through a second network based on the first data.
[0293] In a possible implementation, the processing module is specifically configured to:
[0294] The first image is converted into the frequency domain by second-order wavelet transform.
[0295] In addition, the present application embodiment also provides a model training device (which can correspond to Figure 10 The model training method) the device comprises:
[0296] an acquisition module, configured to acquire a first image and a second image; the first image and the second image are captured for the same scene; the second image is a high-quality image corresponding to the first image;
[0297] a processing module, configured to convert the first image and the second image into a frequency domain to obtain first data and second data, respectively; the spatial resolution of the first data is lower than that of the first image; the spatial resolution of the second data is lower than that of the second image; the second data includes first low-frequency information; and the first low-frequency information is information of a low-frequency channel in the second data;
[0298] Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image;
[0299] Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to determine a first loss together with the second noise information; and the second noise information is randomly generated noise;
[0300] The first network is updated according to the first loss.
[0301] In a possible implementation, the processing module is specifically configured to:
[0302] First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
[0303] In a possible implementation, obtaining the first noise information through the first network based on the first high-frequency information and the first low-frequency information is performed at an i-th iteration, where i is a positive integer; and the processing module is further configured to:
[0304] superimposing noise on the first low-frequency information to obtain third low-frequency information;
[0305] At the (i+1)th iteration, third noise information is obtained through the first network based on the first high-frequency information and the third low-frequency information; the third noise information is used to determine the second loss together with fourth noise information; the fourth noise information is randomly generated noise;
[0306] The updated first network is updated according to the second loss.
[0307] In a possible implementation, the processing module is specifically configured to:
[0308] Based on the first data, first high-frequency information is determined through a second network; the second network is a pre-trained network.
[0309] In a possible implementation, the processing module is specifically configured to:
[0310] The first image and the second image are converted into the frequency domain by second-order wavelet transform.
[0311] Next, we will introduce an execution device provided by the embodiment of the present application. Figure 14 , Figure 14 This is a schematic diagram of the structure of the execution device provided in the embodiment of the present application. The execution device 1400 can be specifically manifested as a mobile phone, tablet, laptop, smart wearable device, server, etc., which is not limited here. Figure 10 The functions of the image processing method in the corresponding embodiment. Specifically, the execution device 1400 includes: a receiver 1401, a transmitter 1402, a processor 1403, and a memory 1404 (wherein the number of processors 1403 in the execution device 1400 may be one or more), wherein the processor 1403 may include an application processor 14031 and a communication processor 14032. In some embodiments of the present application, the receiver 1401, the transmitter 1402, the processor 1403, and the memory 1404 may be connected via a bus or other means.
[0312] Memory 1404 may include read-only memory and random access memory, and provides instructions and data to processor 1403. A portion of memory 1404 may also include non-volatile random access memory (NVRAM). Memory 1404 stores processor and operation instructions, executable modules, or data structures, or subsets or extended sets thereof. The operation instructions may include various operation instructions for implementing various operations.
[0313] Processor 1403 controls the operation of the execution device. In specific applications, the various components of the execution device are coupled together via a bus system. In addition to a data bus, the bus system may also include a power bus, a control bus, and a status signal bus. However, for clarity, all bus systems are referred to as a bus system in the figure.
[0314] The method disclosed in the above embodiment of the present application can be applied to the processor 1403, or implemented by the processor 1403. The processor 1403 can be an integrated circuit chip with signal processing capabilities. During the implementation process, the steps of the above method can be completed by the integrated logic circuit of the hardware in the processor 1403 or the instructions in the form of software. The above-mentioned processor 1403 can be a general-purpose processor, a digital signal processor (digital signal processing, DSP), a microprocessor or a microcontroller, and a vision processor (vision processing unit, VPU), a tensor processing unit (tensorprocessing unit, TPU) and other processors suitable for AI computing, and can further include an application specific integrated circuit (ASIC), a field programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The processor 1403 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of this application can be directly implemented as being executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in memory 1404, and processor 1403 reads the information in memory 1404 and, in conjunction with its hardware, completes steps 901 to 905 in the above embodiment.
[0315] Receiver 1401 can be used to receive input digital or character information and generate signal input related to executing device-related settings and function control. Transmitter 1402 can be used to output digital or character information through the first interface. Transmitter 1402 can also be used to send instructions to the disk pack through the first interface to modify data in the disk pack. Transmitter 1402 can also include a display device such as a display screen.
[0316] The present application also provides a training device. Figure 15 , Figure 15This is a structural diagram of a training device provided in an embodiment of the present application. Specifically, the training device 1500 is implemented by one or more servers. The training device 1500 may have relatively large differences due to different configurations or performances. It may include one or more central processing units (CPUs) 1515 (for example, one or more processors) and memory 1532, and one or more storage media 1530 (for example, one or more mass storage devices) storing application programs 1542 or data 1544. Among them, the memory 1532 and the storage medium 1530 can be short-term storage or persistent storage. The program stored in the storage medium 1530 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations in the training device. Furthermore, the central processing unit 1515 can be configured to communicate with the storage medium 1530 to execute a series of instruction operations in the storage medium 1530 on the training device 1500.
[0317] The training device 1500 may also include one or more power supplies 1526, one or more wired or wireless network interfaces 1550, one or more input and output interfaces 1558; or, one or more operating systems 1541, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0318] An embodiment of the present application also provides a computer program product including computer-readable instructions, which, when executed on a computer, enables the computer to execute the steps executed by the aforementioned execution device, or enables the computer to execute the steps executed by the aforementioned training device.
[0319] A computer-readable storage medium is also provided in an embodiment of the present application, which stores a program for signal processing. When the computer-readable storage medium is run on a computer, it enables the computer to execute the steps executed by the aforementioned execution device, or enables the computer to execute the steps executed by the aforementioned training device.
[0320] The execution device, training device or terminal device provided in the embodiments of the present application may specifically be a chip, and the chip includes: a processing unit and a communication unit, wherein the processing unit may be, for example, a processor, and the communication unit may be, for example, an input / output interface, a pin or a circuit, etc. The processing unit may execute the computer execution instructions stored in the storage unit, so that the chip in the execution device executes the model training method described in the above embodiment, or so that the chip in the training device executes the steps related to model training in the above embodiment. Optionally, the storage unit is a storage unit in the chip, such as a register, a cache, etc. The storage unit may also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc.
[0321] For details, please refer to Figure 16 , Figure 16 This is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip can be represented as a neural network processor NPU 1600. NPU 1600 is mounted on the host CPU as a coprocessor and is assigned tasks by the host CPU. The core of the NPU is arithmetic circuit 1603, which is controlled by controller 1604 to extract matrix data from memory and perform multiplication operations.
[0322] In some implementations, arithmetic circuit 1603 includes multiple processing units (PEs). In some implementations, arithmetic circuit 1603 is a two-dimensional systolic array. Arithmetic circuit 1603 can also be a one-dimensional systolic array or other electronic circuitry capable of performing mathematical operations such as multiplication and addition. In some implementations, arithmetic circuit 1603 is a general-purpose matrix processor.
[0323] For example, assume there are input matrix A, weight matrix B, and output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from weight memory 1602 and caches it on each PE in the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from input memory 1601 and performs a matrix operation on matrix B. The partial or final matrix result is stored in accumulator 1608.
[0324] Unified memory 1606 is used to store input and output data. Weight data is directly transferred to weight memory 1602 through the Direct Memory Access Controller (DMAC) 1605. Input data is also transferred to unified memory 1606 through the DMAC.
[0325] BIU stands for Bus Interface Unit 1610 , which is used for interaction between the AXI bus, DMAC, and instruction fetch buffer (IFB) 1609 .
[0326] The bus interface unit 1610 (BIU) is used for the instruction fetch memory 1609 to obtain instructions from the external memory, and is also used for the storage unit access controller 1605 to obtain the original data of the input matrix A or the weight matrix B from the external memory.
[0327] DMAC is mainly used to move input data in the external memory DDR to the unified memory 1606 or move weight data to the weight memory 1602 or move input data to the input memory 1601.
[0328] The vector calculation unit 1607 includes multiple operation processing units. When necessary, it further processes the output of the operation circuit, such as vector multiplication, vector addition, exponential operation, logarithmic operation, size comparison, etc. It is mainly used for non-convolutional / fully connected layer network calculations in neural networks, such as batch normalization, pixel-level summation, and upsampling of feature planes.
[0329] In some implementations, vector calculation unit 1607 can store the processed output vector to unified memory 1606. For example, vector calculation unit 1607 can apply a linear function or a nonlinear function to the output of operation circuit 1603, such as linear interpolation of the feature plane extracted by the convolution layer, or accumulate a vector of values to generate an activation value. In some implementations, vector calculation unit 1607 generates a normalized value, a pixel-level summed value, or both. In some implementations, the processed output vector can be used as an activation input to operation circuit 1603, for example, for use in subsequent layers in a neural network.
[0330] An instruction fetch buffer 1609 connected to the controller 1604 is used to store instructions used by the controller 1604;
[0331] Unified memory 1606, input memory 1601, weight memory 1602, and instruction fetch memory 1609 are all on-chip memories. External memories are private to the NPU hardware architecture.
[0332] The processor mentioned in any of the above places can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits for controlling the execution of the above program.
[0333] It should also be noted that the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed across multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. In addition, in the drawings of the device embodiments provided in this application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines.
[0334] Through the description of the above embodiments, those skilled in the art can clearly understand that the present application can be implemented by means of software plus necessary general hardware, and of course can also be implemented by special hardware including application-specific integrated circuits, special CPUs, special memories, special components, etc. In general, all functions performed by computer programs can be easily implemented with corresponding hardware, and the specific hardware structures used to implement the same function can also be diverse, such as analog circuits, digital circuits or special circuits, etc. However, for the present application, software program implementation is a better implementation method in most cases. Based on this understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a readable storage medium, such as a computer's floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk or optical disk, etc., and includes a number of instructions to enable a computer device (which can be a personal computer, training equipment, or network equipment, etc.) to execute the methods described in each embodiment of the present application.
[0335] In the above embodiments, all or part of the embodiments may be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments may be implemented in the form of a computer program product.
[0336] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, a computer, a training device or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website, a computer, a training device or a data center. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a training device, a data center, etc. that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
Claims
1. An image processing method, characterized in that: The method comprises: acquiring a first image; converting the first image into a frequency domain to obtain first data; wherein the spatial resolution of the first data is lower than that of the first image; Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image; acquiring first low-frequency information, where the first low-frequency information includes noise in a low-frequency channel of the high-quality image; Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; using the first noise information to denoise the first low-frequency information to obtain second low-frequency information; The second low-frequency information and the first high-frequency information are used to obtain a second image.
2. The method according to claim 1, characterized in that The obtaining, through a first network, first noise information according to the first high-frequency information and the first low-frequency information includes: First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
3. The method according to claim 1 or 2, characterized in that The obtaining of the first noise information through the first network according to the first high-frequency information and the first low-frequency information is performed in the i-th iteration, where i is a positive integer greater than 1; The method further comprises: In the (i+1)th iteration, second noise information is obtained through the first network based on the first high-frequency information and the second low-frequency information, and the second noise information is used to denoise the second low-frequency information to obtain third low-frequency information; The second low-frequency information and the first high-frequency information are used to obtain a second image, including: The third low-frequency information and the first high-frequency information are used to obtain a second image.
4. The method according to claim 1 or 2, characterized in that The method further comprises: Applying target mapping to the second low-frequency information to obtain target low-frequency information; wherein the target mapping does not include a noise estimation item; The second low-frequency information and the first high-frequency information are used to obtain a second image, including: The target low-frequency information and the first high-frequency information are used to fuse to obtain a fusion result, and the second image is obtained by mapping the fusion result to a spatial domain.
5. The method according to any one of claims 1 to 4, characterized in that: The first low-frequency information is randomly generated noise.
6. The method according to any one of claims 1 to 5, characterized in that: The determining, based on the first data, first high-frequency information includes: First high-frequency information is determined through a second network based on the first data.
7. The method according to any one of claims 1 to 6, characterized in that: The converting the first image into the frequency domain comprises: The first image is converted into the frequency domain by second-order wavelet transform.
8. A model training method, characterized in that: The method comprises: Acquire a first image and a second image; the first image and the second image are captured for the same scene; the second image is a high-quality image corresponding to the first image; Converting the first image and the second image into a frequency domain to obtain first data and second data, respectively; the spatial resolution of the first data is lower than that of the first image; the spatial resolution of the second data is lower than that of the second image; the second data includes first low-frequency information; and the first low-frequency information is information of a low-frequency channel in the second data; Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image; Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to determine a first loss together with the second noise information; and the second noise information is randomly generated noise; The first network is updated according to the first loss.
9. The method according to claim 8, characterized in that The obtaining, through a first network, first noise information according to the first high-frequency information and the first low-frequency information includes: First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
10. The method according to claim 8 or 9, characterized in that The step of obtaining the first noise information through the first network according to the first high-frequency information and the first low-frequency information is performed at the i-th iteration, where i is a positive integer; The method further comprises: superimposing noise on the first low-frequency information to obtain third low-frequency information; At the (i+1)th iteration, third noise information is obtained through the first network based on the first high-frequency information and the third low-frequency information; the third noise information is used to determine the second loss together with fourth noise information; the fourth noise information is randomly generated noise; The updated first network is updated according to the second loss.
11. The method according to any one of claims 8 to 10, characterized in that: The determining, based on the first data, first high-frequency information includes: Based on the first data, first high-frequency information is determined through a second network; the second network is a pre-trained network.
12. The method according to any one of claims 8 to 11, characterized in that: The converting the first image and the second image into the frequency domain comprises: The first image and the second image are converted into the frequency domain by second-order wavelet transform.
13. An image processing device, characterized in that: The device comprises: An acquisition module, configured to acquire a first image; A processing module, configured to convert the first image into a frequency domain to obtain first data; the spatial resolution of the first data is lower than that of the first image; Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image; acquiring first low-frequency information, where the first low-frequency information includes noise in a low-frequency channel of the high-quality image; Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; using the first noise information to denoise the first low-frequency information to obtain second low-frequency information; The second low-frequency information and the first high-frequency information are used to obtain a second image.
14. The device according to claim 13, characterized in that The processing module is specifically used to: First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
15. The device according to claim 13 or 14, characterized in that The obtaining of the first noise information through the first network according to the first high-frequency information and the first low-frequency information is performed in an i-th iteration, where i is a positive integer greater than 1; and the processing module is further configured to: In the (i+1)th iteration, second noise information is obtained through the first network based on the first high-frequency information and the second low-frequency information, and the second noise information is used to denoise the second low-frequency information to obtain third low-frequency information; The second low-frequency information and the first high-frequency information are used to obtain a second image, including: The third low-frequency information and the first high-frequency information are used to obtain a second image.
16. The device according to claim 13 or 14, characterized in that The processing module is further configured to: Applying target mapping to the second low-frequency information to obtain target low-frequency information; wherein the target mapping does not include a noise estimation item; The processing module is specifically used to: The target low-frequency information and the first high-frequency information are used to fuse to obtain a fusion result, and the second image is obtained by mapping the fusion result to a spatial domain.
17. The device according to any one of claims 13 to 16, characterized in that The first low-frequency information is randomly generated noise.
18. The device according to any one of claims 13 to 17, characterized in that The processing module is specifically used to: First high-frequency information is determined through a second network based on the first data.
19. The device according to any one of claims 13 to 18, characterized in that The processing module is specifically used to: The first image is converted into the frequency domain by second-order wavelet transform.
20. A model training device, characterized in that: The device comprises: an acquisition module, configured to acquire a first image and a second image; the first image and the second image are captured for the same scene; the second image is a high-quality image corresponding to the first image; a processing module, configured to convert the first image and the second image into a frequency domain to obtain first data and second data, respectively; the spatial resolution of the first data is lower than that of the first image; the spatial resolution of the second data is lower than that of the second image; the second data includes first low-frequency information; and the first low-frequency information is information of a low-frequency channel in the second data; Determining first high-frequency information based on the first data; the first high-frequency information is an information prediction result of a high-frequency channel of a high-quality image corresponding to the first image; Obtaining first noise information through a first network based on the first high-frequency information and the first low-frequency information; the first noise information is used to determine a first loss together with the second noise information; and the second noise information is randomly generated noise; The first network is updated according to the first loss.
21. The device according to claim 20, characterized in that The processing module is specifically used to: First noise information is obtained through a first network according to the first high-frequency information, the first data, and the first low-frequency information.
22. The device according to claim 20 or 21, characterized in that The obtaining of the first noise information through the first network according to the first high-frequency information and the first low-frequency information is performed at the i-th iteration, where i is a positive integer; and the processing module is further configured to: superimposing noise on the first low-frequency information to obtain third low-frequency information; In the (i+1)th iteration, third noise information is obtained through the first network according to the first high-frequency information and the third low-frequency information; The third noise information is used to determine the second loss together with the fourth noise information; the fourth noise information is randomly generated noise; The updated first network is updated according to the second loss.
23. The device according to any one of claims 20 to 22, characterized in that The processing module is specifically used to: Based on the first data, first high-frequency information is determined through a second network; the second network is a pre-trained network.
24. The device according to any one of claims 20 to 23, characterized in that The processing module is specifically used to: The first image and the second image are converted into the frequency domain by second-order wavelet transform.
25. A computing device, characterized in that The computing device includes a memory and a processor; the memory stores codes, and the processor is configured to obtain the codes and execute the method according to any one of claims 1 to 12.
26. A computer storage medium, characterized in that The computer storage medium stores one or more instructions, which, when executed by one or more computers, enable the one or more computers to implement the method according to any one of claims 1 to 12.
27. A computer program product comprising code, characterized in that When the code is executed, it is used to implement the method according to any one of claims 1 to 12.