Integrated image restoration method and system based on image mask modeling
By adopting the pre-training and importance evaluation technology of image mask modeling in the image repair network and fine-tuning the key layers, the imbalance problem in the existing technology when dealing with multiple image degradation types is solved, and the low-level vision is achieved. Efficient and balanced image restoration tasks.
Patent Information
- Application Number
- CN202410610768.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-16
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2044-05-16
AI Technical Summary
It is difficult for the existing technology to process multiple image degradation types at the same time, resulting in unbalanced processing results, and it is difficult to effectively learn image details in image restoration.
Using a pre-training strategy based on image mask modeling, the image restoration network is trained through random masks, the importance of each network layer is calculated and the key layers are fine-tuned, the essential information of the image is extracted, and fully blind image restoration is achieved.
It achieves effective learning of image essential information in low-level vision, improves the balance and scalability of image repair, and can handle multiple image repair tasks at the same time to maintain a balanced repair effect.
Smart Images

Figure CN118628408A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image restoration, and in particular to an integrated image restoration method and system based on image mask modeling. Background Art
[0002] Image inpainting involves the restoration of low-quality images affected by various degradations, which usually originate from adverse environmental conditions (e.g., rain, fog, low light), hardware-related issues (e.g., noise and blur), and post-processing artifacts (e.g., JPEG compression). The value of image inpainting lies not only in enhancing the visual appeal of images, but also in helping practical application scenarios such as autonomous driving and surveillance. These applications require high-quality images to ensure the accuracy and safety of operations, and image inpainting technology plays a key role in these fields.
[0003] Modern techniques in this area focus on learning fixed patterns formed during the degradation process, i.e., degradation priors. Some studies use task-specific priors to solve a certain degradation problem, while another research line is to design a general network architecture (such as SwinIR, MPRNet, Restormer, etc.) that can effectively learn each degradation pattern through independent training. However, the above method only enables the network to learn a single degradation type at a time during training, and cannot handle multiple types of degradation at the same time. When multiple types of degradation data are used for training at the same time, it will lead to unbalanced processing results.
[0004] To address the above problems, some integrated methods have emerged, aiming to use one model for multiple image restoration tasks. Most of these methods tend to utilize explicit classification priors (e.g., AirNet) or introduce additional modules (e.g., PromptIR) to identify image degradation patterns to help the model perform restoration. However, these methods focus on distinguishing the degradation types in the image rather than the image content itself, which leads to reduced scalability and blurred decision boundaries when more degradation types are involved.
[0005] Inspired by masked language modeling (such as BERT and GPT), Mask Image Modeling (MIM) was first introduced as a pre-training method for learning general representations in high-level vision. MAE first adopted image mask modeling as a pre-training method in high-level vision to predict masked image patches, showing significant power and effectively generalizing to various downstream tasks. However, mask image modeling has not yet been widely attempted in the field of image restoration. This is because image mask modeling is more effective for knowledge extraction for semantic understanding and it is difficult to learn image details. However, the optimization goal of image mask modeling is similar to that in the field of image restoration, and it helps to improve the scalability of the model. Therefore, image mask modeling methods suitable for low-level vision need and are worth exploring in depth. Summary of the invention
[0006] In order to address the deficiencies of the prior art, the present invention provides an integrated image restoration method and system based on image mask modeling, focusing on solving the problem of how to extract intrinsic image information from a variety of damaged images.
[0007] On the one hand, an integrated image restoration method based on image mask modeling is provided, comprising:
[0008] Inputting the first training set into the image restoration network, using the low-quality image with random mask as the input value of the image restoration network, using the corresponding high-quality image as the output value of the image restoration network, training the image restoration network, and obtaining a pre-trained image restoration network;
[0009] For the pre-trained image restoration network, calculate the importance of each network layer and select the top k network layers with the highest importance.
[0010] The second training set is input into the pre-trained image restoration network, the low-quality image without random mask is used as the input value of the pre-trained image restoration network, and the corresponding high-quality image is used as the output value of the pre-trained image restoration network, and the pre-trained image restoration network is trained; wherein, in the process of training the pre-trained image restoration network, the network parameters of the non-first k network layers are fixed, and only the network parameters of the first k network layers are optimized to obtain the final trained image restoration network;
[0011] The image to be repaired is obtained, and the image to be repaired is input into the finally trained image repair network to obtain the repaired image.
[0012] On the other hand, an integrated image restoration system based on image mask modeling is provided, comprising:
[0013] A pre-training module is configured to: input the first training set into the image restoration network, use the low-quality image with a random mask as the input value of the image restoration network, use the corresponding high-quality image as the output value of the image restoration network, train the image restoration network, and obtain a pre-trained image restoration network;
[0014] The importance calculation module is configured to: calculate the importance of each network layer of the pre-trained image restoration network, and select the top k network layers with the highest importance;
[0015] A fine-tuning module is configured to: input the second training set into a pre-trained image restoration network, use low-quality images without random masks as input values of the pre-trained image restoration network, use corresponding high-quality images as output values of the pre-trained image restoration network, and train the pre-trained image restoration network; wherein, in the process of training the pre-trained image restoration network, the network parameters of non-first k network layers are fixed, and only the network parameters of the first k network layers are optimized to obtain the final trained image restoration network;
[0016] The restoration module is configured to: obtain the image to be restored, input the image to be restored into the finally trained image restoration network, and obtain the restored image.
[0017] On the other hand, there is also provided an electronic device, comprising:
[0018] a memory for non-transitory storage of computer-readable instructions; and
[0019] a processor for executing the computer readable instructions,
[0020] When the computer-readable instructions are executed by the processor, the method described in the first aspect is executed.
[0021] On the other hand, a storage medium is provided, which non-temporarily stores computer-readable instructions, wherein when the non-temporary computer-readable instructions are executed by a computer, the instructions of the method described in the first aspect are executed.
[0022] On the other hand, a computer program product is provided, comprising a computer program, wherein the computer program is used to implement the method described in the first aspect when running on one or more processors.
[0023] The above technical solution has the following advantages or beneficial effects:
[0024] This paper discusses the challenges of adopting MIM in low-level vision and proposes an image mask modeling pre-training strategy suitable for all-in-one comprehensive image restoration, which enables the restoration network to effectively learn the essential information of the image while ensuring the reconstruction results.
[0025] The present invention proposes mask attribute propagation to evaluate the importance of each layer in resolving the input completeness gap, so as to fine-tune a small fraction (e.g., 5%) of key layers to bridge this gap while preserving the image prior learned by MIM.
[0026] The proposed image restoration method (RAM) provides a new perspective for achieving a more balanced and powerful all-blind image restoration, which focuses on extracting intrinsic image information from damaged images. The present invention can be applied to any image restoration network without introducing additional computational overhead.
[0027] The present invention can use one model to process multiple image restoration effects at the same time, and ensure balanced restoration effects for different image restoration tasks. Compared with the most advanced methods, the present invention has stronger scalability. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0029] Figure 1 Schematic diagram of the basic process of the implementation method of the present invention.
[0030] Figure 2 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the defogging task.
[0031] Figure 3 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the rain removal task.
[0032] Figure 4 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the denoising task.
[0033] Figure 5 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the low-light enhancement task.
[0034] Figure 6 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the denuclearization task.
[0035] Figure 7 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods in the task of removing JPEG compression artifacts.
[0036] Figure 8 It is a schematic diagram of the statistical results of the implementation method of the present invention. DETAILED DESCRIPTION
[0037] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0038] Embodiment 1
[0039] This embodiment provides an integrated image restoration method based on image mask modeling;
[0040] like Figure 1 As shown, an integrated image restoration method based on image mask modeling includes:
[0041] S101: inputting the first training set into the image restoration network, using the low-quality image with random mask as the input value of the image restoration network (such as SwinIR network, PromptIR network, etc.), using the corresponding high-quality image as the output value of the image restoration network, training the image restoration network, and obtaining a pre-trained image restoration network;
[0042] S102: For the pre-trained image restoration network, calculate the importance of each network layer, and select the top k network layers with the highest importance.
[0043] S103: Input the second training set into the pre-trained image restoration network, use the low-quality image without random mask as the input value of the pre-trained image restoration network, use the corresponding high-quality image as the output value of the pre-trained image restoration network, and train the pre-trained image restoration network; wherein, in the process of training the pre-trained image restoration network, the network parameters of the non-first k network layers are fixed, and only the network parameters of the first k network layers are optimized, so as to obtain the final trained image restoration network;
[0044] S104: Acquire the image to be repaired, and input the image to be repaired into the finally trained image repair network to obtain a repaired image.
[0045] Furthermore, the S101: constructing a first training set, the first training set includes: a plurality of high-quality images, each of which is provided with a corresponding low-quality image provided with a random mask.
[0046] Furthermore, the low-quality images refer to images taken in rainy days, foggy days, at night, or with noise, kernel blur, motion blur, or with JPEG format compression artifacts;
[0047] Furthermore, the low-quality image with random mask refers to randomly masking the low-quality image with pixel blocks of 1*1 pixel level, and the masking rate is 50%.
[0048] Furthermore, the high-quality image refers to an image that is not taken on rainy days, foggy days, or at night, and has no noise, kernel blur, motion blur, and no JPEG format compression artifacts, and has an illumination higher than a set threshold, a contrast higher than a set threshold, and a picture clarity higher than a set threshold.
[0049] It should be understood that given an image restoration network, the neural network is pre-trained using customized image mask modeling. The pre-training details are as follows: given low-quality images with different degradations, a pixel-level balanced random mask is applied to the degraded image to generate a partially masked degraded image. The neural network is trained by inputting the partially masked degraded image to predict the high-quality image portion corresponding to the masked pixels.
[0050] Using pixel-level (1x1 image block) and balanced (mask rate 50%) random masking, binary masking is performed on the input images with different degradations for data enhancement and subsequent image reconstruction. The neural network is trained using masked degraded images with different degradations to predict the clear image part corresponding to the masked pixels, and high-quality images are used as supervision.
[0051] Furthermore, the S102: calculating the importance of each network layer of the pre-trained image restoration network, and selecting the top k network layers in terms of importance, includes:
[0052] S102-1: for a low-quality image with a random mask, define a discrete mask attribution path from the low-quality image with the random mask to the low-quality image without a mask; in the discrete mask attribution path, the mask rate is continuously reduced;
[0053] S102-2: Convert the discrete mask attribution path into a differentiable and continuous mask attribution path;
[0054] S102-3: Based on the differentiable and continuous mask attribution path, the local normalized accumulated gradient of each network layer in the pre-trained image restoration network is calculated; the local normalized accumulated gradient of each network layer is used as the mask attribution flux;
[0055] S102-4: Take the mean of the absolute values of the masked attribution flux as the importance of each network layer;
[0056] S102-5: Sort the importance from large to small, and select the top k network layers.
[0057] Furthermore, the S102-1: for a low-quality image with a random mask, defining a discrete mask attribution path from the low-quality image with the random mask to the low-quality image without a mask, specifically includes:
[0058] Define a discrete mask attribution path as a non-random path that incrementally adds pixels from the mask image to the full image
[0059]
[0060] Where i represents the index of the pixel, r is the initial mask rate of the input mask image, α∈(r,1] represents the mask rate variable, and α i ∈(1-,1] is a set of constants. i represents the complete input, x′ i Represents a mask image.
[0061] Throughout the entire path, the mask rate of the mask image continues to decrease until it becomes a complete image.
[0062]
[0063]
[0064] in, Represents the image corresponding to the mask attribution path when the mask rate is 1-r; represents the image corresponding to the mask rate of 0 on the mask attribution path; x′ represents the initial mask image, that is, the mask image with a mask rate of r used for pre-training. ; x represents the complete image, which is used for model fine-tuning and inference.
[0065] Furthermore, the S102-2: converting the discrete mask attribution path into a differentiable and continuous mask attribution path specifically includes:
[0066] Use function approximation to transform the discrete mask attribution path into a differentiable and continuous mask path
[0067]
[0068] Among them, δ represents the approximation degree of the approximate function. The larger δ is, the closer the differentiable mask attribution path is to the discrete mask attribution path.
[0069] Furthermore, the S102-3: based on the differentiable and continuous mask attribution path, calculating the local normalized cumulative gradient of each network layer in the pre-trained image restoration network specifically includes:
[0070] Use the accumulated gradient vector output by each network layer As a mask attributed flux;
[0071]
[0072] in, It means that the image restoration network F accepts the input image as Output when It means that the image restoration network F accepts the input image as Partial derivative of the output variable for a certain intermediate node; It means that the image restoration network F accepts the input image as When the intermediate variable is for the input image Partial derivative of the mask rate α.
[0073] It should be understood that after the pre-training is completed, the importance of each network layer in the neural network for the fine-tuning stage is evaluated using the proposed importance evaluation technique based on mask attribution flux. The specific details of the importance evaluation process are as follows: For a masked image, a differentiable continuous integration path with a continuously decreasing mask rate from the image to the complete image is defined, and the local normalized cumulative gradient of each network layer is calculated, that is, the sensitivity of each network layer to the change in mask rate, which is regarded as the network importance for the fine-tuning stage. This differentiable continuous integration path is called the Mask Attribute Path (MAP), and the local normalized cumulative gradient is called the Mask Attribute Conductance (MAC).
[0074] After the above training and importance evaluation process is completed, the importance of each network layer is evaluated and the top k% of network layers are selected for fine-tuning. The fine-tuning stage uses the complete degraded image as input to solve the input difference caused by the incomplete data in the pre-training stage and the inference stage, while retaining the pre-training prior as much as possible. Because no additional parameters are introduced in the training process and the fine-tuning process, the final model maintains the same structure and operation method as the original neural network model, and does not increase any inference overhead.
[0075] The discrete mask attribution path is defined as a non-random path that gradually adds pixels from the mask image to the complete image. Throughout the path, the mask rate of the mask image is continuously reduced until it becomes a complete image; the discrete mask attribution path is transformed into a differentiable and continuous mask path using function approximation. This allows the calculation of the cumulative gradient of any network layer. The average value of the absolute value of the cumulative gradient vector output by each network layer is used as the mask attribution flux. This is used as the importance of each network layer relative to the fine-tuning stage.
[0076] Furthermore, the S103: constructing a second training set, the second training set includes: a plurality of high-quality images, each of which is provided with a corresponding low-quality image without a random mask.
[0077] During the fine-tuning phase, the importance of each network layer is ranked and the most important network layers can be selected for fine-tuning.
[0078] The purpose of this method is to mine the intrinsic information of the image content and establish a unified model to handle multiple image restoration problems. This method designs a new paradigm based on image mask modeling, using image reconstruction to allow the model to learn the intrinsic information of the image rather than a specific degradation pattern. This paradigm enables the model to handle multiple image restoration tasks simultaneously and maintain balanced and superior performance. In addition, this paradigm can be effectively applied to a variety of neural network models, achieving better performance without additional computational costs or parameters.
[0079] The present invention is mainly divided into three stages: image mask pre-training stage, importance evaluation based on mask attribute conduction and model fine-tuning stage. In the pre-training stage, the present invention randomly masks the damaged image at the pixel level and forces the network to predict the clear image corresponding to the masked pixel, so as to extract the inherent image information from the damaged image. After the pre-training is completed, the importance evaluation technology based on mask attribution flux is proposed to evaluate the importance of each network layer in the neural network for the fine-tuning stage. The specific details of the importance evaluation process are as follows: for a masked image, a mask attribution path is defined, and the mask attribution flux of each network layer is calculated, that is, the sensitivity of each network layer to the change of mask rate, which is regarded as the network importance of the network for the fine-tuning stage. After the above training and importance evaluation process is completed, the importance of each network layer is evaluated, and the top k% of the network layers are selected for fine-tuning. The fine-tuning stage uses the complete degraded image as input to solve the input difference caused by the incompleteness of the data in the pre-training stage and the inference stage, while retaining the pre-training prior as much as possible. Because no additional parameters are introduced in the training and fine-tuning processes, the final model maintains the same structure and operation method as the original neural network model, and does not increase any reasoning overhead.
[0080] Figure 2 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the defogging task. Figure 3 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the rain removal task. Figure 4 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the denoising task. Figure 5 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the low-light enhancement task. Figure 6It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods on the denuclearization task. Figure 7 It is a schematic diagram comparing the output results of the implementation method of the present invention and other existing methods in the task of removing JPEG compression artifacts. Figure 8 It is a schematic diagram of the statistical results of the implementation method of the present invention.
[0081] This implementation is evaluated on image restoration tasks (dehazing, deraining, denoising, low-light enhancement, denuclearization, and de-JPEG compression artifacts) and more than 10 datasets, and applied to the neural network models of SwinIR and PromptIR. The effectiveness of the RAM method of this implementation is demonstrated.
[0082] The proposed method in this implementation is compared with eight methods, including Restormer, MPRNet, NAFNet, SwinIR, DL, TAPE, AirNet and PromptIR.
[0083] Embodiment 2
[0084] This embodiment provides an integrated image restoration system based on image mask modeling, including:
[0085] A pre-training module is configured to: input the first training set into the image restoration network, use the low-quality image with a random mask as the input value of the image restoration network, use the corresponding high-quality image as the output value of the image restoration network, train the image restoration network, and obtain a pre-trained image restoration network;
[0086] The importance calculation module is configured to: calculate the importance of each network layer of the pre-trained image restoration network, and select the top k network layers with the highest importance;
[0087] A fine-tuning module is configured to: input the second training set into a pre-trained image restoration network, use low-quality images without random masks as input values of the pre-trained image restoration network, use corresponding high-quality images as output values of the pre-trained image restoration network, and train the pre-trained image restoration network; wherein, in the process of training the pre-trained image restoration network, the network parameters of non-first k network layers are fixed, and only the network parameters of the first k network layers are optimized to obtain the final trained image restoration network;
[0088] The restoration module is configured to: obtain the image to be restored, input the image to be restored into the finally trained image restoration network, and obtain the restored image.
[0089] It should be noted that the above-mentioned pre-training module, importance calculation module, fine-tuning module and repair module correspond to steps S101 to S104 in Embodiment 1, and the examples and application scenarios implemented by the above-mentioned modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned Embodiment 1. It should be noted that the above-mentioned modules as part of the system can be executed in a computer system such as a set of computer executable instructions.
[0090] The description of each embodiment in the above embodiments has different emphases. For parts not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0091] The proposed system can be implemented in other ways. For example, the system embodiment described above is only illustrative, and the division of the modules is only a logical function division. In actual implementation, there may be other division methods, such as multiple modules can be combined or integrated into another system, or some features can be ignored or not executed.
[0092] Embodiment 3
[0093] This embodiment also provides an electronic device, including: one or more processors, one or more memories, and one or more computer programs; wherein the processor is connected to the memory, and the one or more computer programs are stored in the memory. When the electronic device is running, the processor executes the one or more computer programs stored in the memory so that the electronic device executes the method described in the above embodiment one.
[0094] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0095] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0096] In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in a processor or an instruction in the form of software.
[0097] The method in the first embodiment can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it will not be described in detail here.
[0098] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with this embodiment can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0099] Embodiment 4
[0100] This embodiment further provides a computer-readable storage medium for storing computer instructions. When the computer instructions are executed by a processor, the method described in the first embodiment is completed.
[0101] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. An integrated image restoration method based on image mask modeling, characterized in that: include: Inputting the first training set into the image restoration network, using the low-quality image with random mask as the input value of the image restoration network, using the corresponding high-quality image as the output value of the image restoration network, training the image restoration network, and obtaining a pre-trained image restoration network; For the pre-trained image restoration network, calculate the importance of each network layer and select the top k network layers with the highest importance. The second training set is input into the pre-trained image restoration network, the low-quality image without random mask is used as the input value of the pre-trained image restoration network, and the corresponding high-quality image is used as the output value of the pre-trained image restoration network, and the pre-trained image restoration network is trained; wherein, in the process of training the pre-trained image restoration network, the network parameters of the non-first k network layers are fixed, and only the network parameters of the first k network layers are optimized to obtain the final trained image restoration network; The image to be repaired is obtained, and the image to be repaired is input into the finally trained image repair network to obtain the repaired image.
2. The integrated image restoration method based on image mask modeling as claimed in claim 1, characterized in that: For the pre-trained image restoration network, calculate the importance of each network layer and select the top k network layers with the highest importance, including: For a low-quality image with a random mask, a discrete mask attribution path is defined from the low-quality image with the random mask to the low-quality image without the mask; in the discrete mask attribution path, the mask rate is continuously reduced; Convert the discrete mask attribution path into a differentiable and continuous mask attribution path; Based on the differentiable and continuous mask attribution path, the local normalized cumulative gradient of each network layer in the pre-trained image restoration network is calculated; the local normalized cumulative gradient of each network layer is used as the mask attribution flux; Take the mean of the absolute values of the masked attribution flux as the importance of each network layer; Sort the importance from large to small and select the top k network layers.
3. The integrated image restoration method based on image mask modeling as claimed in claim 2, characterized in that: For a low-quality image with a random mask, a discrete mask attribution path from the low-quality image with the random mask to the low-quality image without the mask is defined, including: Define a discrete mask attribution path as a non-random path that incrementally adds pixels from the mask image to the full image Where i represents the index of the pixel, r is the initial mask rate of the input mask image, α∈(r,1] represents the mask rate variable, and α I ∈(1-r,1] is a set of constants; x I represents the complete input, x′ I represents the mask image; Throughout the entire path, the mask rate of the mask image continues to decrease until it becomes a complete image. in, Represents the image corresponding to the mask attribution path when the mask rate is 1-r; represents the image corresponding to the mask rate of 0 on the mask attribution path; x′ represents the initial mask image, that is, the mask image with a mask rate of r used for pre-training; x represents the complete image, which is used for model fine-tuning and inference.
4. The integrated image restoration method based on image mask modeling as claimed in claim 2, characterized in that: The step of converting the discrete mask attribution path into a differentiable and continuous mask attribution path specifically includes: Use function approximation to transform the discrete mask attribution path into a differentiable and continuous mask path Among them, δ represents the approximation degree of the approximate function. The larger δ is, the closer the differentiable mask attribution path is to the discrete mask attribution path.
5. The integrated image restoration method based on image mask modeling as claimed in claim 2, characterized in that: The differentiable and continuous mask attribution path is used to calculate the local normalized cumulative gradient of each network layer in the pre-trained image restoration network, specifically including: Use the accumulated gradient vector output by each network layer As a mask attributed flux; in, It means that the image restoration network F accepts the input image as Output when It means that the image restoration network F accepts the input image as Partial derivative of the output variable for a certain intermediate node; It means that the image restoration network F accepts the input image as When the intermediate variable is for the input image Partial derivative of the mask rate α.
6. The integrated image restoration method based on image mask modeling as claimed in claim 1, characterized in that: The second training set includes: a plurality of high-quality images, each of which is provided with a corresponding low-quality image without a random mask.
7. An integrated image restoration system based on image mask modeling, characterized in that: include: A pre-training module is configured to: input the first training set into the image restoration network, use the low-quality image with a random mask as the input value of the image restoration network, use the corresponding high-quality image as the output value of the image restoration network, train the image restoration network, and obtain a pre-trained image restoration network; The importance calculation module is configured to: calculate the importance of each network layer of the pre-trained image restoration network, and select the top k network layers with the highest importance; A fine-tuning module is configured to: input the second training set into a pre-trained image restoration network, use low-quality images without random masks as input values of the pre-trained image restoration network, use corresponding high-quality images as output values of the pre-trained image restoration network, and train the pre-trained image restoration network; wherein, in the process of training the pre-trained image restoration network, the network parameters of non-first k network layers are fixed, and only the network parameters of the first k network layers are optimized to obtain a final trained image restoration network; The restoration module is configured to: obtain the image to be restored, input the image to be restored into the finally trained image restoration network, and obtain the restored image.
8. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, Wherein, when the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 6 is executed.
9. A storage medium characterized by being non-temporary The computer-readable instructions are stored, wherein when the non-transitory computer-readable instructions are executed by a computer, the instructions of the method according to any one of claims 1 to 6 are executed.
10. A computer program product, characterized in that The invention comprises a computer program, which is used to implement the method according to any one of claims 1 to 6 when running on one or more processors.
Citation Information
Cited By
Image restoration method and device based on potential mask, equipment and medium
CN119295355A
