WO2020164189A1 - 图像复原方法及装置、电子设备、存储介质 - Google Patents

图像复原方法及装置、电子设备、存储介质 Download PDF

Info

Publication number
WO2020164189A1
WO2020164189A1 PCT/CN2019/083855 CN2019083855W WO2020164189A1 WO 2020164189 A1 WO2020164189 A1 WO 2020164189A1 CN 2019083855 W CN2019083855 W CN 2019083855W WO 2020164189 A1 WO2020164189 A1 WO 2020164189A1
Authority
WO
WIPO (PCT)
Prior art keywords
sub
image
network
images
restoration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2019/083855
Other languages
English (en)
French (fr)
Inventor
余可
王鑫涛
董超
汤晓鸥
吕健勤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sensetime Technology Development Co Ltd
Original Assignee
Beijing Sensetime Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sensetime Technology Development Co Ltd filed Critical Beijing Sensetime Technology Development Co Ltd
Priority to SG11202106269UA priority Critical patent/SG11202106269UA/en
Priority to KR1020217018723A priority patent/KR20210092286A/ko
Priority to JP2021535032A priority patent/JP7143529B2/ja
Publication of WO2020164189A1 publication Critical patent/WO2020164189A1/zh
Priority to US17/341,607 priority patent/US20210295473A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/70Denoising; Smoothing
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • G06N3/082Learning methods modifying the architecture, e.g. adding, deleting or silencing nodes or connections
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/60Image enhancement or restoration using machine learning, e.g. neural networks
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20004Adaptive image processing
    • G06T2207/20012Locally adaptive
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20081Training; Learning
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20084Artificial neural networks [ANN]

Definitions

  • the embodiments of the present disclosure relate to the technical field of image restoration, and relate to but not limited to image restoration methods and devices, electronic equipment, and storage media.
  • Image restoration is a process of reconstructing or restoring images with degraded quality through computer processing.
  • image degradation such as camera exposure noise, out-of-focus blur, distortion caused by image compression, etc.; real images
  • the restoration problem is very complicated, because the image degradation process may include various degrees of distortion.
  • the type and degree of distortion are different between different images, and they are not evenly distributed in the same image; for example, exposure noise
  • the dark part of the image is relatively large, and the bright part of the image is relatively small.
  • the content and distortion of the image are different, which leads to some of the image areas can be restored in a simpler way.
  • the background sky texture contained in the image is relatively simple, its brightness is high, and the noise contained is relatively small, so these areas are easy to restore.
  • complex calculations are also performed for some simple areas, resulting in slower image restoration.
  • the embodiments of the present disclosure expect to provide an image restoration method and device, electronic equipment, and storage medium, aiming to increase the speed of image restoration.
  • the embodiment of the present disclosure provides an image restoration method, including:
  • the acquired image is divided into regions to obtain more than one sub-image; each sub-image is input into the multi-path neural network, and the restoration network determined for each sub-image is used to restore each sub-image, and the output is A restored image of each sub-image to obtain a restored image of the image.
  • the inputting each sub-image into a multi-path neural network, and using the restoration network determined for each sub-image to restore each sub-image to obtain a restored image of each sub-image includes: Encoding each sub-image to obtain the feature of each sub-image; inputting the feature of each sub-image into the sub-network of the multi-path neural network, using the path selection network in the sub-network, is Select a restoration network for each sub-image, process each sub-image according to the restoration network of each sub-image, and output the processed feature of each sub-image; decode the processed feature of each sub-image to obtain The restored image of each sub-image.
  • the feature of each sub-image is input into the sub-network of the multi-path neural network, and the path selection network in the sub-network is used to select a restoration network for each sub-image, according to
  • the restoration network of each sub-image processes each sub-image, and outputs the processed characteristics of each sub-image, including: when the number of the sub-networks is N, and the N sub-networks are connected in sequence;
  • the i-th level feature of each sub-image is input into the i-th sub-network, and the i-th path selection network in the i-th sub-network is used to select for each sub-image from the M restoration networks in the i-th sub-network
  • the i-th restoration network according to the i-th restoration network, process the i-th level feature of each sub-image, and output the i+1-th level feature of each sub-image; i is updated to i+1 , Return to the input of the i-th level feature of each sub-image into the i
  • the method further includes: obtaining restored images of the preset number of sub-images, and obtaining restored images of the preset number of sub-images Corresponding reference image; based on the restored image of the preset number of sub-images and the corresponding reference image, according to the loss function between the restored image of the preset sub-image and the corresponding reference image, through the optimizer
  • the network other than the path selection network in the multi-path neural network is trained to update the parameters of the network other than the path selection network in the multi-path neural network; and the restored image based on the preset number of sub-images And the corresponding reference image, according to a preset reward function, the optimizer adopts a reinforcement learning algorithm to train the path selection network to update the parameters in the path selection network.
  • the optimizer for networks other than the path selection network in the multi-path neural network to update the parameters of the network other than the path selection network in the multi-path neural network.
  • the method further includes: based on the restored image of the preset number of sub-images and the corresponding reference image, according to the loss function between the restored image of the preset sub-image and the corresponding reference image, passing the optimizer Training networks other than the path selection network in the multi-path neural network to update the parameters in the multi-path neural network.
  • r i represents the reward function of the i-th sub-network
  • p represents a preset penalty item
  • 1 ⁇ 1 ⁇ (a i ) represents an indicator function
  • d represents the difficulty coefficient
  • the difficulty coefficient d is as follows:
  • L d represents the loss function between the restored image of the preset sub-image and the corresponding reference image
  • L 0 is a threshold
  • the embodiment of the present disclosure provides an image restoration device, the image restoration device includes: a division module configured to divide the acquired image to obtain more than one sub-image; the restoration module is configured to input each sub-image at most In the path neural network, the restoration network determined for each sub-image is used to restore each sub-image, and the restored image of each sub-image is output to obtain the restored image of the image.
  • the restoration module includes: an encoding sub-module configured to encode each sub-image to obtain the characteristics of each sub-image; and a complex atom module configured to convert each sub-image
  • the features of is input into the sub-network of the multi-path neural network, the path selection network in the sub-network is used to select a restoration network for each sub-image, and the restoration network of each sub-image is used for each
  • the sub-images are processed to output the processed features of each sub-image; the decoding sub-module is configured to decode the processed features of each sub-image to obtain the restored image of each sub-image.
  • the complex atom module is specifically configured to: when the number of sub-networks is N and the N sub-networks are connected in sequence; input the i-th level feature of each sub-image to the i-th sub-network In the network, the i-th path selection network in the i-th sub-network is adopted, and the i-th restoration network is selected for each sub-image from the M restoration networks in the i-th sub-network; according to the i-th restoration network
  • the network processes the i-th level features of each sub-image, and outputs the i+1-th level features of each sub-image; i is updated to i+1, and returns to the i-th level of each sub-image
  • the feature is input into the i-th sub-network, the i-th path selection network in the i-th sub-network is adopted, and the i-th restoration network is selected for each sub-image from the M restoration networks in the i-th sub-network; Output the N-
  • the device when the number of restored images from which the sub-images are obtained is greater than or equal to the preset number, the device further includes: an acquisition module configured to obtain the restored images of the preset number of sub-images, and obtain and preset A reference image corresponding to the restored image of a number of sub-images; the first training module is configured to: based on the restored image of the preset number of sub-images and the corresponding reference image, according to the preset restored image of the sub-image and For the loss function between the corresponding reference images, the network other than the path selection network in the multi-path neural network is trained by the optimizer to update the parameters of the network other than the path selection network in the multi-path neural network And, based on the restored image of the preset number of sub-images and the corresponding reference image, according to the preset reward function, the optimizer adopts a reinforcement learning algorithm to train the path selection network to update The path selects parameters in the network.
  • the device further includes: a second training module configured to: obtain restored images of a preset number of sub-images, and obtain reference images corresponding to the restored images of the preset number of sub-images After that, according to the obtained loss function between the restored image of the preset number of sub-images and the corresponding reference image, the network other than the path selection network in the multi-path neural network is trained by the optimizer to update all Before the parameters of the network other than the path selection network in the multi-path neural network, the restored image based on the preset number of sub-images and the corresponding reference image, and the restored image based on the preset sub-image and the corresponding reference image For the loss function between images, the network other than the path selection network in the multi-path neural network is trained by an optimizer to update the parameters of the network other than the path selection network in the multi-path neural network.
  • a second training module configured to: obtain restored images of a preset number of sub-images, and obtain reference images corresponding to the restored images of the preset number of sub
  • the reward function is as follows:
  • r i represents the reward function of the i-th sub-network
  • p represents a preset penalty item
  • 1 ⁇ 1 ⁇ (a i ) represents an indicator function
  • d represents the difficulty coefficient
  • the difficulty coefficient d is as follows:
  • L d represents the loss function between the restored image of the preset sub-image and the corresponding reference image
  • L 0 is a threshold
  • the embodiments of the present disclosure provide an electronic device, the electronic device includes: a processor, a memory, and a communication bus; wherein the communication bus is configured to realize connection and communication between the processor and the memory;
  • the processor is configured to execute the image restoration program stored in the memory to implement the image restoration method described above.
  • the present disclosure provides a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the above-mentioned image restoration method .
  • the image restoration device divides the acquired image into regions to obtain more than one sub-image, and input each sub-image to the multi-path
  • the restoration network determined for each sub-image is used to restore each sub-image
  • the restored image of each sub-image is output to obtain the restored image of the image; that is, in the technical solution of the embodiment of the present disclosure , First divide the acquired image to obtain more than one sub-image, and then input each sub-image into the multi-path neural network, and use the restoration network determined for each sub-image to restore each sub-image.
  • the corresponding restoration network is determined for each sub-image, so that the restoration network used by each sub-image is not all the same, but different restoration networks are used for different sub-images. Then, for different sub-images, different restoration networks are used. The image is restored using different restoration networks. Some sub-images can be restored in a simple way, and some sub-images can be restored in a complex way. In this way, the use of this region-customized image restoration method reduces The complexity of image restoration improves the speed of image restoration.
  • FIG. 1 is a schematic flowchart of an image restoration method provided by an embodiment of the disclosure
  • FIG. 2 is a schematic flowchart of another image restoration method provided by an embodiment of the disclosure.
  • FIG. 3 is a schematic structural diagram of an optional multi-path neural network provided by an embodiment of the disclosure.
  • FIG. 4 is a schematic structural diagram of an optional dynamic module provided by an embodiment of the disclosure.
  • FIG. 5 is a schematic structural diagram of another optional dynamic module provided by an embodiment of the disclosure.
  • FIG. 6 is a schematic structural diagram of an image restoration device provided by an embodiment of the disclosure.
  • FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the disclosure.
  • FIG. 1 is a schematic flowchart of an image restoration method provided by an embodiment of the disclosure. As shown in FIG. 1, the above image restoration method may include:
  • S101 Perform area division on the acquired image to obtain more than one sub-image
  • the image degradation process may include various degrees of distortion, and the types and degrees of distortion are different. There are differences between the images of each image, so if a deep neural network is used to perform the same processing on all areas of each image, it will affect the speed of image restoration.
  • the image is first divided into regions to obtain more than one sub-image.
  • the resolution of the image is 63*63, and the image is divided to obtain several regions.
  • Each region is the above-mentioned sub-image.
  • the horizontal coordinate of each sub-image is The direction and longitudinal coordinates overlap the adjacent image by 10 pixels.
  • S102 Input each sub-image into the multi-path neural network, use the restoration network determined for each sub-image to restore each sub-image, and output the restored image of each sub-image to obtain the restored image of the image.
  • each sub-image can be input into the multi-path neural network in turn.
  • the restoration network is determined for each sub-image, so as to adopt the The restoration network determined by the image restores each sub-image, so that the restored image of each sub-image is output from the multi-path neural network.
  • the restored images of all the sub-images are combined to obtain the restored image of the image.
  • FIG. 2 is a schematic flowchart of another image restoration method provided by an embodiment of the disclosure, such as As shown in Figure 2, S102 may include:
  • S201 Encode each sub-image to obtain the feature of each sub-image
  • S202 Input the characteristics of each sub-image into the sub-network of the multi-path neural network, adopt the path selection network in the sub-network, select a restoration network for each sub-image, and process each sub-image according to the restoration network of each sub-image, Output the processed features of each sub-image;
  • S203 Decode the processed features of each sub-image to obtain a restored image of each sub-image.
  • the multi-path neural network contains three processing parts.
  • the first processing part realizes the encoding of each sub-image, which can be realized by an encoder.
  • the sub-image is a color image area, which can be expressed as 63*63
  • the *3 tensor is encoded by the encoder, and the feature of the sub-image is obtained by output, which can be expressed as a 63*63*64 tensor.
  • the sub-image is encoded first to obtain the characteristics of the sub-image.
  • the second processing part is to input the features of the sub-image into the sub-network of the multi-path neural network, where the sub-network can correspond to a dynamic block (Dynamic block), where the number of dynamic blocks can be N, and N can be It is a positive integer greater than or equal to 1, that is, the sub-network can be one dynamic module, or two or more dynamic modules; here, the embodiment of the present disclosure does not specifically limit it.
  • a dynamic block Dynamic block
  • N can be It is a positive integer greater than or equal to 1, that is, the sub-network can be one dynamic module, or two or more dynamic modules; here, the embodiment of the present disclosure does not specifically limit it.
  • Each dynamic module contains a path selector (equivalent to the path selection network mentioned above), which is used to determine the restoration network for each sub-image, so that each image can be processed by different restoration networks in different dynamic modules , So as to achieve the purpose of selecting different processing methods for different sub-images, and the processed feature obtained is a tensor of 63*63*64.
  • the third processing part is to realize the decoding of each sub-image. Then, after obtaining the processed characteristics of each sub-image, decode the processed sub-image.
  • it can be realized by a decoder, for example, for the above
  • the processed features are decoded to obtain the restored image of the sub-image, which can be expressed as a tensor of 63*63*3.
  • S202 may include:
  • the i-th level features of each sub-image are input into the i-th sub-network, and the i-th path selection network in the i-th sub-network is used. From the M restoration networks in the i-th sub-network, the first is selected for each sub-image i restoration networks;
  • the i-th restoration network process the i-th level features of each sub-image, and output the i+1-th level features of each sub-image;
  • Update i to i+1 return to input the i-th level features of each sub-image into the i-th sub-network, and use the i-th path selection network in the i-th sub-network to recover from the M in the i-th sub-network In the network, select the i-th restoration network for each sub-image;
  • the Nth level feature of each sub-image is determined as the processed feature of each sub-image
  • the i-th level feature of each sub-image is the feature of each sub-image
  • N is a positive integer not less than 1
  • M is a positive integer not less than 2
  • i is a positive integer greater than or equal to 1 and less than or equal to N.
  • the multi-path neural network includes N dynamic modules, and the N dynamic modules are connected in sequence, the characteristics of the obtained sub-images are input to the first dynamic module, and each The dynamic module includes a path selector, a shared path and M dynamic paths.
  • the first dynamic module When the first dynamic module receives the features of the sub-image, it uses the received features of the sub-image as the first-level feature of the sub-image, and the first path selector starts from M dynamic paths based on the first-level feature of the sub-image. Determine the first restoration network for the sub-image, so that the shared path and the dynamic path selected from the M dynamic paths form the first restoration network; then, according to the first-level restoration network, the first-level features of the sub-image Process to get the second-level feature of the sub-image, update i to 2, input the second-level feature of the sub-image into the second dynamic module, and follow the same processing method as the first dynamic module to get the sub-image The third level features of, and so on, until the Nth level features of the sub-images are obtained, and the processed features of each sub-image are obtained.
  • the size of the feature of the sub-image and the number of restoration networks are variable.
  • N and M when the distortion problem to be solved is more complicated, N and M can be appropriately increased, and vice versa.
  • the structure of the aforementioned shared path and the 2-M dynamic path is not limited to a residual block (residual block), and may also be other structures such as a dense block (dense block).
  • network structure of the path selector in each of the above-mentioned dynamic modules may be the same or different.
  • the embodiment of the present disclosure does not specifically limit it.
  • the input of the above path selector is a 63*63*64 tensor, and the output is the number a i of the selected path.
  • the structure of the path selector is C convolutional layers from input to output.
  • a fully connected layer (output dimension 32), a Long-Short Term Memory (LSTM, Long-Short Term Memory) module (state number 32), and a fully connected layer (output dimension M).
  • the activation function of the last layer is Softmax or ReLU, and the sequence number of the largest element in the activated M-dimensional vector is the selected dynamic path number.
  • the number of C can be adjusted according to the difficulty of the restoration task.
  • the output dimension of the first fully connected layer and the number of states of the LSTM module are not limited to 32, but can be 16, 64, etc.
  • the method further includes:
  • the optimizer Based on the restored image of the preset number of sub-images and the corresponding reference image, according to the loss function between the restored image of the preset sub-image and the corresponding reference image, the optimizer selects the path in the multi-path neural network Networks other than the network are trained to update the parameters of the multi-path neural network other than the path selection network;
  • the optimizer adopts a reinforcement learning algorithm to train the path selection network to update the parameters in the path selection network.
  • the reference images are pre-stored. Taking the preset number of 32 as an example, when the restored images of 32 sub-images are obtained, the restored images of the 32 sub-images and the corresponding reference images are used as samples, based on the sample data , According to the loss function between the restored image of the sub-image and the corresponding reference image, use the optimizer to train the network except the path selection network in the multi-path neural network to update the multi-path neural network except the path selection network The parameters of the network.
  • the restored images of these 32 sub-images and the corresponding reference images are used as samples.
  • a reinforcement learning algorithm is used here.
  • a reward function is preset, and the reinforcement The optimization goal of the learning algorithm is to maximize the expectation of the sum of all reward functions; in this way, based on the sample data, according to the preset reward function, the optimizer uses the reinforcement learning algorithm to train the path selection network, so as to update the path selection network The purpose of the parameters.
  • the loss function before the restored image of the sub-image and the corresponding reference image is preset, and the loss function may be an L2 loss function or a VGG loss function.
  • the embodiment of the present disclosure does not specifically limit it.
  • the restored image of the preset number of sub-images is obtained, and the preset number of sub-images is obtained.
  • the optimizer is used to analyze the multi-path neural network except for the path selection network.
  • the optimizer Based on the restored image of the preset number of sub-images and the corresponding reference image, according to the loss function between the restored image of the preset sub-image and the corresponding reference image, the optimizer selects the path in the multi-path neural network Networks other than the network are trained to update the parameters in the network other than the path selection network in the multi-path neural network.
  • r i represents the reward function of the i-th sub-network
  • p represents a preset penalty item
  • 1 ⁇ 1 ⁇ (a i ) represents an indicator function
  • d represents the difficulty coefficient
  • the above penalty term is a set value.
  • the value of the penalty term is related to the distortion degree of the sub-image and represents the complexity of the network.
  • the above-mentioned reward function is a reward function based on the difficulty coefficient of the sub-image.
  • the above-mentioned difficulty coefficient may be a constant 1, or a value related to the loss function.
  • the embodiment of the present disclosure does not specifically limit it.
  • the aforementioned difficulty factor d is as shown in formula (2):
  • L d represents the loss function between the restored image of the preset sub-image and the corresponding reference image
  • L 0 is a threshold
  • the aforementioned loss function may be a mean square error L2 loss function, or a Visual Geometry Group (VGG, Visual Geometry Group) loss function, which is not specifically limited in the embodiment of the present disclosure.
  • VCG Visual Geometry Group
  • the form of the loss function used in the difficulty coefficient and the form of the loss function used in network training may be the same or different, and the embodiment of the present disclosure does not specifically limit it.
  • L2 represents the restoration effect.
  • the difficulty coefficient d represents the difficulty of restoring an image area.
  • Fig. 3 is a schematic structural diagram of an optional multi-path neural network provided by an embodiment of the disclosure; referring to Fig. 3, an image is obtained, and the image is divided into regions to obtain a number of sub-images x, and sub-image x (using 63*63*3 tensor representation) is input to the encoder in the multi-path neural network.
  • the encoder is a convolutional layer Conv.
  • the sub-image x is encoded through the convolutional layer to obtain the characteristics of the sub-image x (using 63*63*64 tensor representation).
  • each dynamic module include a shared path A path selector f PF and M dynamic paths
  • the path selector obtains a 1 by processing x 1.
  • a 1 can be selected A dynamic path is determined from M dynamic paths by using a 1 as x 1 , so that the shared path and the dynamic path determined by a 1 form a restoration network, and x 1 is processed to obtain the first-level feature x 2 of the sub-image , And then input x 2 into the second-level dynamic module. The processing is the same as x 1 to obtain x 3 until x n is obtained as the sub-image processed feature.
  • the decoder is a convolutional layer Conv
  • x n is decoded through the conv layer Conv to obtain the restored sub-image (represented by a 63*63*64 tensor, As shown in the image below output in Figure 3).
  • the input of the path selector Pathfinder is a tensor of 63*63*64, and the output is the number a i of the selected path.
  • the structure of the path selector is C convolutions from input to output.
  • Layers Conv 1 to Conv C
  • FC output dimension 32
  • LSTM Long-Short Term Memory
  • FC output dimension M
  • the activation function of the last layer is Softmax or ReLU
  • the sequence number of the largest element in the activated M-dimensional vector is the selected dynamic path number.
  • the preset number is 32, after obtaining the restored image of 32 sub-images, first obtain the reference image corresponding to these 32 sub-images from the reference image GT (indicated by y), thereby obtaining the training sample, and then, according to the preset
  • the loss function L2loss between the restored image of the sub-image and the reference image is trained by the optimizer Adam on the network except the path selector in Figure 3 to update the parameters of the network except the path selector, so as to achieve the optimized network The purpose of the parameter.
  • the optimizer Adam uses reinforcement learning algorithm to train the path selector in Figure 3 to update the parameters of the path selector, so as to achieve The purpose of optimizing network parameters.
  • the algorithm used by the above optimizer may be Stochastic Gradient Descent (SGD), the above reinforcement learning algorithm may be REINFORCE, or other algorithms such as actor-critic; here, the embodiment of the present disclosure does not make specifics about this limited.
  • SGD Stochastic Gradient Descent
  • REINFORCE REINFORCE
  • FIG 4 is a schematic structural diagram of an optional dynamic module provided by an embodiment of the disclosure; as shown in Figure 4, the dynamic module Dynamic Block includes a shared path, and the shared path consists of two convolutional layers (two Conv( 3, 64, 1)), a path selector Pathfinder and two dynamic paths, one dynamic path has the same input and output, that is, the dynamic path does not process the features of the sub-image, and the other dynamic path has two Convolutional layers (two Conv(3,64,1)), the result of the path selector is composed of shared paths and dynamic paths; among them, the path selector is composed of two convolutional layers (Conv(5,4,4) ) And Conv(5, 24, 4)), a fully connected layer Fc(32), an LSTM(32) and an Fc(32).
  • the shared path consists of two convolutional layers (two Conv( 3, 64, 1)), a path selector Pathfinder and two dynamic paths, one dynamic path has the same input and output, that is, the dynamic path does not process the features of the sub-image
  • FIG 5 is a schematic structural diagram of another optional dynamic module provided by an embodiment of the present disclosure; as shown in Figure 5, the dynamic module Dynamic Block includes a shared path, and the shared path consists of two convolutional layers (Conv(3 , 24, 1) and Conv (3, 32, 1)), a path selector Pathfinder and 4 dynamic paths, the input and output of one dynamic path are the same, that is, the dynamic path has different characteristics of the sub-image For processing, there is also a dynamic path composed of two convolutional layers (two Conv(3,32,1)).
  • the result of the path selector is composed of a shared path and a dynamic path; among them, the path selector consists of 4 volumes Multilayer (one Conv(3,8,2), two Conv(3,16,2) and one Conv(3,24,2)), one fully connected layer Fc(32), one LSTM(32) and An Fc(32) composition.
  • the embodiments of the present disclosure can achieve the same image restoration effect. Under the circumstances, the speed increase is as much as 4 times.
  • the specific speed increase ratio is related to the restoration task. The more complex the restoration task, the more significant the speed increase. Under the premise of the same calculation amount, a better restoration effect is achieved, and the restoration effect can be peaked.
  • Signal to noise ratio Peak Signal to Noise Ratio
  • SSIM structural similarity Index
  • the image restoration device divides the acquired image into regions to obtain more than one sub-image, and inputs each sub-image into a multi-path neural network, using the determined image for each sub-image
  • the restoration network restores each sub-image, and outputs the restored image of each sub-image to obtain the restored image of the image; that is, in the technical solution of the embodiment of the present disclosure, the acquired image is first divided into regions to obtain Then, input each sub-image into the multi-path neural network, and use the restoration network determined for each sub-image to restore each sub-image. It can be seen that the corresponding sub-image is determined in the multi-path neural network. Restoration network.
  • the restoration network used by each sub-image is not all the same, but different restoration networks are used for different sub-images. Then, different restoration networks can be used for different sub-images for restoration. Sub-images can be restored in a simple way, and some sub-images can be restored in a complex way. Thus, the use of this region-customized image restoration method reduces the complexity of image restoration, thereby improving the efficiency of image restoration speed.
  • FIG. 6 is a schematic structural diagram of an image restoration device provided by an embodiment of the disclosure. As shown in Figure 6, the image restoration device includes:
  • the dividing module 61 is configured to divide the acquired image into regions to obtain more than one sub-image
  • the restoration module 62 is configured to input each sub-image into the multi-path neural network, use the restoration network determined for each sub-image to restore each sub-image, and output the restored image of each sub-image to obtain the restored image of the image.
  • the restoration module 62 includes:
  • the encoding sub-module is configured to encode each sub-image to obtain the characteristics of each sub-image
  • the complex atom module is configured to input the characteristics of each sub-image into the sub-network of the multi-path neural network, and use the path selection network in the sub-network to select the restoration network for each sub-image, and according to the restoration network of each sub-image, for each sub-image
  • the image is processed, and the processed features of each sub-image are output;
  • the decoding sub-module is configured to decode the processed features of each sub-image to obtain a restored image of each sub-image.
  • the polyatomic module the specific configuration is:
  • the i-th level features of each sub-image are input into the i-th sub-network, and the i-th path selection network in the i-th sub-network is used. From the M restoration networks in the i-th sub-network, the first is selected for each sub-image i restoration networks;
  • the i-th restoration network process the i-th level features of each sub-image, and output the i+1-th level features of each sub-image;
  • Update i to i+1 return to input the i-th level features of each sub-image into the i-th sub-network, and use the i-th path selection network in the i-th sub-network to recover from the M in the i-th sub-network In the network, select the i-th restoration network for each sub-image;
  • the Nth level feature of each sub-image is determined as the processed feature of each sub-image
  • the i-th level feature of each sub-image is the feature of each sub-image
  • N is a positive integer not less than 1
  • M is a positive integer not less than 2
  • i is a positive integer greater than or equal to 1 and less than or equal to N.
  • the device when the number of restored images from which the sub-images are obtained is greater than or equal to a preset number, the device further includes:
  • An obtaining module configured to obtain restored images of a preset number of sub-images, and obtain reference images corresponding to the restored images of the preset number of sub-images;
  • the first training module is configured as:
  • the optimizer Based on the restored image of the preset number of sub-images and the corresponding reference image, according to the loss function between the restored image of the preset sub-image and the corresponding reference image, the optimizer selects the path in the multi-path neural network Networks other than the network are trained to update the parameters of the multi-path neural network other than the path selection network;
  • the optimizer adopts a reinforcement learning algorithm to train the path selection network to update the parameters in the path selection network.
  • the device further includes:
  • the second training module is configured as:
  • the optimizer Before the loss function of the multi-path neural network other than the path selection network is trained by the optimizer to update the parameters of the network other than the path selection network in the multi-path neural network, based on the preset number of sub-images
  • the restored image and the corresponding reference image train the network other than the path selection network in the multi-path neural network through the optimizer to Update the parameters of the multi-path neural network other than the path selection network.
  • r i represents the reward function of the i-th sub-network
  • p represents a preset penalty item
  • 1 ⁇ 1 ⁇ (a i ) represents an indicator function
  • d represents the difficulty coefficient
  • L d represents the loss function between the restored image of the preset sub-image and the corresponding reference image
  • L 0 is a threshold
  • FIG. 7 is a schematic structural diagram of an electronic device provided by an embodiment of the disclosure. As shown in FIG. 7, the electronic device includes: a processor 71, a memory 72, and a communication bus 73; among them,
  • the communication bus 73 is configured to implement connection and communication between the processor 71 and the memory 72;
  • the processor 71 is configured to execute the image restoration program stored in the memory 72 to implement the above-mentioned image restoration method.
  • the embodiments of the present disclosure also provide a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the above Image restoration method.
  • the computer-readable storage medium may be a volatile memory (volatile memory), such as random-access memory (Random-Access Memory, RAM); or a non-volatile memory (non-volatile memory), such as read-only memory (Read Only Memory). -Only Memory, ROM, flash memory, Hard Disk Drive (HDD) or Solid-State Drive (SSD); it can also be a respective device including one or any combination of the above-mentioned memories, Such as mobile phones, computers, tablet devices, personal digital assistants, etc.
  • the embodiments of the present disclosure can be provided as methods, systems, or computer program products. Therefore, the present disclosure may adopt the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, optical storage, etc.) containing computer-usable program codes.
  • a computer-usable storage media including but not limited to disk storage, optical storage, etc.
  • These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable signal processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
  • the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
  • These computer program instructions can also be loaded on a computer or other programmable signal processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
  • the instructions provide steps for implementing functions specified in a flow or multiple flows in the flowchart and/or a block or multiple blocks in the block diagram.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Molecular Biology (AREA)
  • Artificial Intelligence (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Image Analysis (AREA)
  • Image Processing (AREA)
  • Facsimile Image Signal Circuits (AREA)

Abstract

本公开实施例公开了一种图像复原方法,该方法包括:对获取到的图像进行区域划分,得到一个以上子图像,将每个子图像输入至多路径神经网络中,采用为每个子图像确定出的复原网络对每个子图像进行复原,输出得到每个子图像的复原图像,以得到图像的复原图像。通过实施上述方案,提高了图像复原的速度。

Description

图像复原方法及装置、电子设备、存储介质
相关申请的交叉引用
本申请基于申请号为201910117782.X、申请日为2019年2月15日的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以全文引入的方式引入本申请。
技术领域
本公开实施例涉及图像复原技术领域,涉及但不限于图像复原方法及装置、电子设备、存储介质。
背景技术
图像复原是通过计算机处理,对质量下降的图像加以重建或恢复的处理过程;图像降质的原因有很多,如相机的曝光噪声、失焦模糊,图像压缩造成的失真等等;现实中的图像复原问题十分复杂,因为图像降质过程可能包含多种程度不一的失真,失真的类型和程度在不同的图像之间存在差异,甚至在同一张图像中也不是均匀分布的;比如曝光噪声在图像中阴暗的部分比较大,在图像中明亮的部分则相对较小。
通常,在图像复原中,是对每一张图像的所有区域进行同一种处理;为了能够恢复包含不同内容及失真情况的图像,这种处理方式通常较为复杂,比如一个很深的神经网络,这样复杂的算法在运行时速度较慢,难以满足实际应用的需求。
在实际上,在不同的图像区域,图像的内容和失真情况有所不同,这就导致了其中一些图像区域可以通过更为简单的方式进行复原。比如,图像中包含的背景天空纹理较为简单,其亮度较高,包含的噪声也就相对较小,因而这些区域是很容易进行恢复的。然而,针对图像内容和失真情况的非均匀分布,会对于一些简单的区域也进行了复杂的计算,导致图像复原的速度较慢。
发明内容
本公开实施例期望提供一种图像复原方法及装置、电子设备、存储介质,旨在提高图像复原的速度。
本公开实施例的技术方案是这样实现的:
本公开实施例提供了一种图像复原方法,包括:
对获取到的图像进行区域划分,得到一个以上子图像;将每个子图像输入至多路径神经网络中,采用为所述每个子图像确定出的复原网络对所述每个子图像进行复原,输出得到每个子图像的复原图像,以得到所述图像的复原图像。
在上述方案中,所述将每个子图像输入至多路径神经网络中,采用为所述每个子图像确定出的复原网络对所述每个子图像进行复原,得到每个子图像的复原图像,包括:对所述每个子图像进行编码,得到所述每个子图像的特征;将所述每个子图像的特征输 入至所述多路径神经网络的子网络中,采用所述子网络中的路径选择网络,为所述每个子图像选择复原网络,根据所述每个子图像的复原网络,对所述每个子图像进行处理,输出得到每个子图像处理后的特征;对每个子图像处理后的特征进行解码,得到所述每个子图像的复原图像。
在上述方案中,所述将所述每个子图像的特征输入至所述多路径神经网络的子网络中,采用所述子网络中的路径选择网络,为所述每个子图像选择复原网络,根据所述每个子图像的复原网络,对所述每个子图像进行处理,输出得到每个子图像处理后的特征,包括:当所述子网络的个数为N,且N个子网络依次相连时;将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;根据所述第i个复原网络,对所述每个子图像的第i级特征进行处理,输出得到所述每个子图像的第i+1级特征;i更新为i+1,返回至所述将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;直至输出得到每个子图像的第N级特征,将所述每个子图像的第N级特征确定为所述每个子图像处理后的特征;当i=1时,所述每个子图像的第i级特征为所述每个子图像的特征;其中,N为不小于1的正整数,M为不小于2的正整数,i为大于等于1小于等于N的正整数。
在上述方案中,当得到子图像的复原图像的数目大于等于预设数目时,所述方法还包括:获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像;基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数;且,基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的奖励函数,通过所述优化器采用强化学习算法,对所述路径选择网络进行训练,以更新所述路径选择网络中的参数。
在上述方案中,在获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像之后,在根据得到的预设数目的子图像的复原图像与对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数之前,所述方法还包括:基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中的参数。
在上述方案中,所述奖励函数如下所示:
Figure PCTCN2019083855-appb-000001
其中,r i代表第i级子网络的奖励函数,p表示一个预设的惩罚项,1 {1}(a i)表示一个指示函数,d表示难度系数;当a i=1时,指示函数的值为1,当a i≠1时,指示函数的值为0。
在上述方案中,所述难度系数d如下所示:
Figure PCTCN2019083855-appb-000002
其中,L d表示所述预设的子图像的复原图像与相对应的参考图像之间的损失函数,L 0为一个阈值。
本公开实施例提供了一种图像复原装置,所述图像复原装置包括:划分模块,配置为对获取到的图像进行区域划分,得到一个以上子图像;复原模块,配置为将每个子图像输入至多路径神经网络中,采用为所述每个子图像确定出的复原网络对所述每个子图像进行复原,输出得到每个子图像的复原图像,以得到所述图像的复原图像。
在上述图像复原装置中,所述复原模块,包括:编码子模块,配置为对所述每个子图像进行编码,得到所述每个子图像的特征;复原子模块,配置为将所述每个子图像的特征输入至所述多路径神经网络的子网络中,采用所述子网络中的路径选择网络,为所述每个子图像选择复原网络,根据所述每个子图像的复原网络,对所述每个子图像进行处理,输出得到每个子图像处理后的特征;解码子模块,配置为对每个子图像处理后的特征进行解码,得到所述每个子图像的复原图像。
在上述图像复原装置中,所述复原子模块,具体配置为:当所述子网络的个数为N,且N个子网络依次相连时;将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;根据所述第i个复原网络,对所述每个子图像的第i级特征进行处理,输出得到所述每个子图像的第i+1级特征;i更新为i+1,返回至所述将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;直至输出得到每个子图像的第N级特征,将所述每个子图像的第N级特征确定为所述每个子图像处理后的特征;当i=1时,所述每个子图像的第i级特征为所述每个子图像的特征;其中,N为不小于1的正整数,M为不小于2的正整数,i为大于等于1小于等于N的正整数。
在上述图像复原装置中,当得到子图像的复原图像的数目大于等于预设数目时,所述装置还包括:获取模块,配置为获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像;第一训练模块,配置为:基于所述预设数 目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数;且,基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的奖励函数,通过所述优化器采用强化学习算法,对所述路径选择网络进行训练,以更新所述路径选择网络中的参数。
在上述图像复原装置中,所述装置还包括:第二训练模块,配置为:在获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像之后,在根据得到的预设数目的子图像的复原图像与对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数之前,基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数。
在上述图像复原装置中,所述奖励函数如下所示:
Figure PCTCN2019083855-appb-000003
其中,r i代表第i级子网络的奖励函数,p表示一个预设的惩罚项,1 {1}(a i)表示一个指示函数,d表示难度系数;当a i=1时,指示函数的值为1,当a i≠1时,指示函数的值为0。
在上述图像复原装置中,所述难度系数d如下所示:
Figure PCTCN2019083855-appb-000004
其中,L d表示所述预设的子图像的复原图像与相对应的参考图像之间的损失函数,L 0为一个阈值。
本公开实施例提供了一种电子设备,所述电子设备包括:处理器、存储器和通信总线;其中,所述通信总线,配置为实现所述处理器和所述存储器之间的连接通信;所述处理器,配置为执行所述存储器中存储的图像复原程序,以实现上述图像复原方法。
本公开提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可以被一个或者多个处理器执行,以实现上述图像复原方法。
由此可见,在本公开实施例提供的一种图像复原方法及装置、电子设备、存储介质,图像复原装置对获取到的图像进行区域划分,得到一个以上子图像,将每个子图像输入至多路径神经网络中,采用为每个子图像确定出的复原网络对每个子图像进行复原,输 出得到每个子图像的复原图像,以得到图像的复原图像;也就是说,在本公开实施例的技术方案中,先对获取到的图像进行区域划分,得到一个以上子图像,然后,将每个子图像输入至多路径神经网络中,采用为每个子图像确定出的复原网络对每个子图像进行复原,可见,在多路径神经网络中为每个子图像确定对应的复原网络,这样,使得每个子图像所采用的复原网络不是全部相同的,而是针对不同的子图像采用不同的复原网络,那么,对不同的子图像采用不同的复原网络进行复原,可以对一些子图像可以采用简单的方式进行复原,可以对一些子图像可以采用复杂的方式进行复原,如此,采用这种区域定制的图像复原方法,减小了图像复原的复杂度,从而提高了图像复原的速度。
附图说明
图1为本公开实施例提供的一种图像复原方法的流程示意图;
图2为本公开实施例提供的另一种图像复原方法的流程示意图;
图3为本公开实施例提供的一种可选的多路径神经网络的结构示意图;
图4为本公开实施例提供的一种可选的动态模块的结构示意图;
图5为本公开实施例提供的另一种可选的动态模块的结构示意图;
图6为本公开实施例提供的一种图像复原装置的结构示意图;
图7为本公开实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对发明的具体技术方案做进一步详细描述。以下实施例用于说明本公开,但不用来限制本公开的范围。
本公开一实施例提供了一种图像复原方法。图1为本公开实施例提供的一种图像复原方法的流程示意图,如图1所示,上述图像复原方法可以包括:
S101:对获取到的图像进行区域划分,得到一个以上子图像;
目前,由于相机的曝光噪声、失焦模糊和图像压缩等造成图像失真,需要对图像进行复原,然而,由于图像的降质过程可能包含多种程度不一的失真,失真的类型和程度在不同的图像之间存在差异,那么,若是对每一张图像的所有区域用一个很深的神经网络进行相同处理,会影响图像复原的速度。
为了提高图像复原的速度,首先,在获取到图像之后,先对图像进行区域划分,得到一个以上子图像。
在实际应用中,若获取到一个图像,该图像的分辨率为63*63,对该图像进行划分,得到若干个区域,每个区域为上述子图像,其中,每个子图像的在横向坐标的方向和纵向坐标的方向上与相邻的图像重叠10个像素,经过多路径神经网络复原之后,在将这些复原后的子图像拼合成一个完整的图像,将重叠区域平均处理,从而可以得到复原后的图像。
S102:将每个子图像输入至多路径神经网络中,采用为每个子图像确定出的复原网 络对每个子图像进行复原,输出得到每个子图像的复原图像,以得到图像的复原图像。
在得到一个以上子图像之后,为了实现对每个子图像的复原,可以依次将每个子图像输入至多路径神经网络中,在多路径神经网络中,为每个子图像确定复原网络,从而采用为每个子图像确定出的复原网络对每个子图像进行复原,使得从多路径神经网络中输出得到每个子图像的复原图像,最后,将所有的子图像的复原图像进行拼合,得到图像的复原图像。
为了通过将每个子图像输入至多路径神经网络中得到每个子图像的复原图像,在一种可选的实施例中,图2为本公开实施例提供的另一种图像复原方法的流程示意图,如图2所示,S102可以包括:
S201:对每个子图像进行编码,得到每个子图像的特征;
S202:将每个子图像的特征输入至多路径神经网络的子网络中,采用子网络中的路径选择网络,为每个子图像选择复原网络,根据每个子图像的复原网络,对每个子图像进行处理,输出得到每个子图像处理后的特征;
S203:对每个子图像处理后的特征进行解码,得到每个子图像的复原图像。
具体来说,多路径神经网络包含三个处理部分,第一个处理部分实现对每个子图像的编码,可以通过编码器来实现,例如,子图像为一个彩色图像区域,可以表示为63*63*3的张量,经过编码器的编码,输出得到该子图像的特征,可以表示为一个63*63*64的张量。
这样,在多路径神经网络中,先对子图像进行编码得到该子图像的特征。
第二个处理部分,将子图像的特征输入至多路径神经网络的子网络中,其中,该子网络对应可以为动态模块(Dynamic block),其中,动态模块的个数可以为N个,N可以为大于等于1的正整数,也就是说,该子网络可以为1个动态模块,也可以为2个或2个以上的动态模块;这里,本公开实施例不作具体限定。
在每个动态模块中,包含一个路径选择器(相当于上述路径选择网络),用于为每个子图像确定复原网络,从而使得每个图像在不同的动态模块中可以采用不同的复原网络进行处理,从而实现对不同的子图像选择不同的处理方式的目的,得到的处理后的特征为一个63*63*64的张量。
第三个处理部分,实现对每个子图像的解码,那么,在得到每个子图像处理后的特征之后,对每个子图像处理后的进行解码,这里,可以通过解码器来实现,例如,对上述处理后的特征进行解码,得到子图像的复原后的图像,可以表示为63*63*3的张量。
其中,为了实现在多路径神经网络中子网络对子图像的特征的处理,在一种可选的实施例中,S202可以包括:
当子网络的个数为N,且N个子网络依次相连时;
将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为每个子图像选择第i个复原网络;
根据第i个复原网络,对每个子图像的第i级特征进行处理,输出得到每个子图像 的第i+1级特征;
i更新为i+1,返回至将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为每个子图像选择第i个复原网络;
直至输出得到每个子图像的第N级特征,将每个子图像的第N级特征确定为每个子图像处理后的特征;
当i=1时,每个子图像的第i级特征为每个子图像的特征;
其中,N为不小于1的正整数,M为不小于2的正整数,i为大于等于1小于等于N的正整数。
以子网络为动态模块为例来说,当多路径神经网络中包括N个动态模块,且N个动态模块依次相连,将得到的子图像的特征输入至第1个动态模块中,在每个动态模块中包括一个路径选择器、一个共享路径和M个动态路径。
当第1个动态模块接收到子图像的特征,将接收到的子图像的特征作为子图像的第1级特征,第1个路径选择器根据子图像的第1级特征,从M个动态路径中为子图像确定第1个复原网络,从而将共享路径和M个动态路径中所选中的动态路径组成第1个复原网络;然后,根据第1级复原网络,对子图像的第1级特征进行处理,得到子图像的第2级特征,将i更新为2,将子图像的第2级特征输入至第2个动态模块中,按照与第1个动态模块相同的处理方法,得到子图像的第3级特征,以此类推,直至得到子图像的第N级特征,从而得到每个子图像处理后的特征。
其中,在多路径神经网络中,子图像的特征的大小和复原网络的个数都是可变的,在实际应用中,子图像的特征的大小可以为63*63*64的张量,也可以是32*32*16的张量,96*96*48的张量等等;动态模块的数量N和动态路径的数量M是可变的,例如,N=6,M=2;N=5,M=4;这里,本公开实施例不作具体限定。
这里,需要说明的是,上述在N和M参数的选择中,当要解决的失真问题较为复杂时,可以适当增加N和M,反之则可以减小N和M。
上述共享路径和第2-M个动态路径的结构不局限于残差模块(residual block),也可以是密集模块(dense block)等其它的结构。
需要说明的是,上述每个动态模块中的路径选择器的网络结构可以是相同的,也可以是不同的,这里,本公开实施例不作具体限定。
在实际应用中,上述路径选择器,输入的为63*63*64的张量,输出为所选择的路径的编号a i,路径选择器的结构从输入到输出分别是C个卷积层,一个全连接层(输出维度32),一个长短期记忆(LSTM,Long-Short Term Memory)模块(状态数32),一个全连接层(输出维度M)。其中最后一层的激活函数是Softmax或者ReLU,激活后的M维向量中最大元素的序号即为选择的动态路径编号。
其中,C的数目可以根据复原任务的难度调整,第一个全连接层的输出维度和LSTM模块的状态数不局限于32,可以是16,64等等。
为了实现对多路径神经网络中的参数的更新,在一种可选的实施例中,当得到子图像的复原图像的数目大于等于预设数目时,该方法还包括:
获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像;
基于预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对多路径神经网络中除路径选择网络以外的网络进行训练,以更新多路径神经网络中除路径选择网络以外的网络的参数;
且,基于预设数目的子图像的复原图像和相对应的参考图像,根据预设的奖励函数,通过优化器采用强化学习算法,对路径选择网络进行训练,以更新路径选择网络中的参数。
具体来说,预先存储有参考图像,以预设数目为32为例,当得到32个子图像的复原图像之后,将这32个子图像的复原图像和相对应的参考图像为样本,基于该样本数据,根据子图像的复原图像与相对应的参考图像之间的损失函数,用优化器对多路径神经网络中除了路径选择网络以外的网络进行训练,以更新多路径神经网络中除了路径选择网络以外的网络的参数。
与此同时,还是以将这32个子图像的复原图像和相对应的参考图像为样本,为了训练路径选择网络,这里采用强化学习算法,为了采用强化学习算法,预先设置有奖励函数,并且该强化学习算法的优化目标为最大化所有奖励函数之和的期望;这样,基于该样本数据,根据预设的奖励函数,通过优化器采用强化学习算法对路径选择网络进行训练,从而达到更新路径选择网络的参数的目的。
也就是说,采用不同的处理方式,同时对多路径神经网络除了路径选择网络以外的网络,以及对路径选择网络进行训练,达到更新网络的参数的目的。
其中,预先设置有子图像的复原图像与相对应的参考图像之前的损失函数,该损失函数可以为L2损失函数,也可以为VGG损失函数,这里,本公开实施例不作具体限定。
为了更好地更新多路径神经网络中除了路径选择网络以外的网络的参数,在一种可选的实施例中,在获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像之后,在根据得到的预设数目的子图像的复原图像与对应的参考图像之间的损失函数,通过优化器对多路径神经网络中除路径选择网络以外的网络进行训练,以更新多路径神经网络中除路径选择网络以外的网络的参数之前,该方法还包括:
基于预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对多路径神经网络中除路径选择网络以外的网络进行训练,以更新多路径神经网络中除路径选择网络以外的网络中的参数。
也就是说,在采用不同的处理方式,同时对多路径神经网络除了路径选择网络以外的网络,以及对路径选择网络进行训练之前,基于样本,可以先对多路径神经网络中除 了路径选择网络以外的网络进行训练,然后,在采用不同的处理方式,同时对多路径神经网络除了路径选择网络以外的网络,以及对路径选择网络进行训练,如此,可以更好的优化多路径神经网络除了路径选择网络以外的网络,以及对路径选择网络中的参数。
在一种可选的实施例中,上述奖励函数如公式(1)所示:
Figure PCTCN2019083855-appb-000005
其中,r i代表第i级子网络的奖励函数,p表示一个预设的惩罚项,1 {1}(a i)表示一个指示函数,d表示难度系数;
当a i=1时,指示函数的值为1,当a i≠1时,指示函数的值为0。
其中,上述惩罚项为一个设定的值,该惩罚项的值的大小与子图像的失真程度有关,代表了网络复杂度的大小,当a i=1即简单的连接路径被选择时,因为该路径没有引入额外的计算开销所以惩罚项为0。若a i≠1,即一条复杂路径被选择时,奖励函数会有惩罚项(减少p)。
上述奖励函数是基于子图像的难度系数的奖励函数,上述难度系数可以为常数1,也可以为一个与损失函数有关的值,这里,本公开实施例不作具体限定。
这里,当难度系数为一个与损失函数有关的值时,在一种可选的实施例中,上述难度系数d如公式(2)所示:
Figure PCTCN2019083855-appb-000006
其中,L d表示预设的子图像的复原图像与相对应的参考图像之间的损失函数,L 0为一个阈值。
上述损失函数可以为均方误差L2损失函数,也可以为视觉几何组(VGG,Visual Geometry Group)损失函数,这里,本公开实施例不作具体限定。
这里,需要说明的是,难度系数中所用到的损失函数的形式与网络训练中晕倒的损失函数的形式可以相同,也可以不同,本公开实施例不作具体限定。
例如,当难度系数为自变量为子图像的复原图像与相对应的参考图像之间的距离L2时,L2代表了复原效果,复原结果越好,这一项的值越大,则奖励函数也就越大。难度系数d代表了一个图像区域的复原难度,当难度较大时,d的值越大,鼓励网络对这些区域进行更精细的复原;当难度较小时,d的值越小,不鼓励网络对这些区域进行过于精细的复原。
下面举实例来对上述一个或多个实施例中所述的图像复原方法进行说明。
图3为本公开实施例提供的一种可选的多路径神经网络的结构示意图;参考图3所示,获取到图像,将图像进行区域划分,得到若干个子图像x,将子图像x(用63*63*3 的张量表示)输入至多路径神经网络中的编码器中,编码器为一个卷积层Conv,通过该卷积层对子图像x进行编码,得到子图像x的特征(用63*63*64的张量表示)。
然后,将子图像x的特征输入至包括有N个动态模块(Dynamic Block 1…Dynamic Block i…Dynamic Block N)中的第1个动态模块中,由图3可以看出,每个动态模块中包含一个共享路径
Figure PCTCN2019083855-appb-000007
一个路径选择器f PF和M个动态路径
Figure PCTCN2019083855-appb-000008
针对第1个动态模块来说,接收到子图像的第1级特征x 1,路径选择器通过对x 1进行处理得到a 1,在本实例中,a 1可以选择
Figure PCTCN2019083855-appb-000009
通过a 1为x 1从M个动态路径中确定出一个动态路径,从而将共享路径与a 1确定出的动态路径组成复原网络,对x 1进行处理,得到子图像的第1级特征x 2,然后,将x 2输入至第2级动态模块中,与x 1的处理相同,得到x 3,直至得到x n,作为子图像处理后的特征。
最后,将x n输入至解码器中,解码器为一个卷积层Conv,通过卷积层Conv对x n进行解码,得到子图像复原后的图像(用63*63*64的张量表示,如图3中的output下面的图像所示)。
其中,路径选择器Pathfinder输入的为63*63*64的张量,输出为所选择的路径的编号a i,如图3所示,路径选择器的结构从输入到输出分别是C个卷积层(Conv 1到Conv C),一个全连接层FC(输出维度32),一个长短期记忆(LSTM,Long-Short Term Memory)模块(状态数32),一个全连接层FC(输出维度M)。其中,最后一层的激活函数是Softmax或者ReLU,激活后的M维向量中最大元素的序号即为选择的动态路径编号。
若预设数目为32,当得到32个子图像的复原图像之后,先从参考图像GT(用y表示)中获取与这32个子图像相对应的参考图像,从而得到训练样本,然后,根据预设的子图像的复原图像与参考图像之间的损失函数L2loss,通过优化器Adam对图3中除了路径选择器以外的网络进行训练,以更新除了路径选择器以外的网络的参数,从而达到优化网络参数的目的。
同时,基于上述训练样本,根据预先设置后的与难度系数有关的奖励函数Reward,还是通过优化器Adam采用强化学习算法对图3中路径选择器进行训练,以更新路径选择器的参数,从而达到优化网络参数的目的。
其中,上述优化器采用的算法可以为随机梯度下降(SGD,Stochastic gradient descent),上述强化学习算法可以为REINFORCE,还可以为actor-critic等等其他算法;这里,本公开实施例对此不作具体限定。
需要说明的是,图3中的实线箭头代表向前Forward,短虚线箭头代表向后Backward,长虚线箭头代表向前Path Selection。
图4为本公开实施例提供的一种可选的动态模块的结构示意图;如图4所示,动态模块Dynamic Block中包括一个共享路径,该共享路径由两个卷积层(两个Conv(3,64,1))组成,一个路径选择器Pathfinder和两个动态路径,一个动态路径的输入和输出相同,即,该条动态路径对子图像的特征不做处理,另一条动态路径有两个卷积层(两 个Conv(3,64,1))组成,路径选择器的结果由共享路径和动态路径合成;其中,路径选择器由两个卷积层(Conv(5,4,4)和Conv(5,24,4))、一个全连接层Fc(32)、一个LSTM(32)和一个Fc(32)。
图5为本公开实施例提供的另一种可选的动态模块的结构示意图;如图5所示,动态模块Dynamic Block中包括一个共享路径,该共享路径由两个卷积层(Conv(3,24,1)和Conv(3,32,1))组成,一个路径选择器Pathfinder和4个动态路径,1个动态路径的输入和输出相同,即,该条动态路径对子图像的特征不做处理,还有一条动态路径有两个卷积层(两个Conv(3,32,1))组成,路径选择器的结果由共享路径和动态路径合成;其中,路径选择器由4个卷积层(一个Conv(3,8,2)、两个Conv(3,16,2)和一个Conv(3,24,2))、一个全连接层Fc(32)、一个LSTM(32)和一个Fc(32)组成。
通过上述实例,能够恢复含有单一或多种失真的降质图像,失真包括但不局限于高斯噪声,高斯模糊,JPEG压缩的一种或多种;本公开实施例可以在达到相同图像复原效果的情况下实现多达4倍的速度提升,具体的速度提升比例与复原任务相关,越复杂的复原任务提速越显著,在相同计算量的前提下,达到了更好的复原效果,复原效果可用峰值信噪比(PSNR,Peak Signal to Noise Ratio)和结构相似性(SSIM,Structural Similarity Index)来衡量。
另外,可以快速提高手机照片的图像质量,包括去除或减弱曝光噪声,失焦模糊,压缩失真等等。一张手机照片中的内容是很多样的,可能有大片平滑的天空区域,或是虚化的背景,这些区域都是比较好处理的,通过本公开实施例,可以较为快速地复原这些区域,把计算量着重放在图片的主体区域中,从而实现又好又快的图像复原。
在本公开实施例提供的一种图像复原方法,图像复原装置对获取到的图像进行区域划分,得到一个以上子图像,将每个子图像输入至多路径神经网络中,采用为每个子图像确定出的复原网络对每个子图像进行复原,输出得到每个子图像的复原图像,以得到图像的复原图像;也就是说,在本公开实施例的技术方案中,先对获取到的图像进行区域划分,得到一个以上子图像,然后,将每个子图像输入至多路径神经网络中,采用为每个子图像确定出的复原网络对每个子图像进行复原,可见,在多路径神经网络中为每个子图像确定对应的复原网络,这样,使得每个子图像所采用的复原网络不是全部相同的,而是针对不同的子图像采用不同的复原网络,那么,对不同的子图像采用不同的复原网络进行复原,可以对一些子图像可以采用简单的方式进行复原,可以对一些子图像可以采用复杂的方式进行复原,如此,采用这种区域定制的图像复原方法,减小了图像复原的复杂度,从而提高了图像复原的速度。
图6为本公开实施例提供的一种图像复原装置的结构示意图。如图6所示,该图像复原装置包括:
划分模块61,配置为对获取到的图像进行区域划分,得到一个以上子图像;
复原模块62,配置为将每个子图像输入至多路径神经网络中,采用为每个子图像确 定出的复原网络对每个子图像进行复原,输出得到每个子图像的复原图像,以得到图像的复原图像。
可选的,复原模块62,包括:
编码子模块,配置为对每个子图像进行编码,得到每个子图像的特征;
复原子模块,配置为将每个子图像的特征输入至多路径神经网络的子网络中,采用子网络中的路径选择网络,为每个子图像选择复原网络,根据每个子图像的复原网络,对每个子图像进行处理,输出得到每个子图像处理后的特征;
解码子模块,配置为对每个子图像处理后的特征进行解码,得到每个子图像的复原图像。
可选的,复原子模块,具体配置为:
当子网络的个数为N,且N个子网络依次相连时;
将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为每个子图像选择第i个复原网络;
根据第i个复原网络,对每个子图像的第i级特征进行处理,输出得到每个子图像的第i+1级特征;
i更新为i+1,返回至将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为每个子图像选择第i个复原网络;
直至输出得到每个子图像的第N级特征,将每个子图像的第N级特征确定为每个子图像处理后的特征;
当i=1时,每个子图像的第i级特征为每个子图像的特征;
其中,N为不小于1的正整数,M为不小于2的正整数,i为大于等于1小于等于N的正整数。
可选的,当得到子图像的复原图像的数目大于等于预设数目时,该装置还包括:
获取模块,配置为获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像;
第一训练模块,配置为:
基于预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对多路径神经网络中除路径选择网络以外的网络进行训练,以更新多路径神经网络中除路径选择网络以外的网络的参数;
且,基于预设数目的子图像的复原图像和相对应的参考图像,根据预设的奖励函数,通过优化器采用强化学习算法,对路径选择网络进行训练,以更新路径选择网络中的参数。
可选的,该装置还包括:
第二训练模块,配置为:
在获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相 对应的参考图像之后,在根据得到的预设数目的子图像的复原图像与对应的参考图像之间的损失函数,通过优化器对多路径神经网络中除路径选择网络以外的网络进行训练,以更新多路径神经网络中除路径选择网络以外的网络的参数之前,基于预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对多路径神经网络中除路径选择网络以外的网络进行训练,以更新多路径神经网络中除路径选择网络以外的网络的参数。
可选的,上述奖励函数如公式(1)所示:
Figure PCTCN2019083855-appb-000010
其中,r i代表第i级子网络的奖励函数,p表示一个预设的惩罚项,1 {1}(a i)表示一个指示函数,d表示难度系数;
当a i=1时,指示函数的值为1,当a i≠1时,指示函数的值为0。
可选的,上述难度系数d如公式(2)所示:
Figure PCTCN2019083855-appb-000011
其中,L d表示预设的子图像的复原图像与相对应的参考图像之间的损失函数,L 0为一个阈值。
图7为本公开实施例提供的一种电子设备的结构示意图,如图7所示,该电子设备包括:处理器71、存储器72和通信总线73;其中,
所述通信总线73,配置为实现所述处理器71和所述存储器72之间的连接通信;
所述处理器71,配置为执行所述存储器72中存储的图像复原程序,以实现上述图像复原方法。
本公开实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可以被一个或者多个处理器执行,以实现上述图像复原方法。计算机可读存储介质可以是是易失性存储器(volatile memory),例如随机存取存储器(Random-Access Memory,RAM);或者非易失性存储器(non-volatile memory),例如只读存储器(Read-Only Memory,ROM),快闪存储器(flash memory),硬盘(Hard Disk Drive,HDD)或固态硬盘(Solid-State Drive,SSD);也可以是包括上述存储器之一或任意组合的各自设备,如移动电话、计算机、平板设备、个人数字助理等。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形 式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程信号处理设备的处理器以产生一个机器,使得通过计算机或其他可编程信号处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程信号处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程信号处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本公开的较佳实施例而已,并非用于限定本公开的保护范围。

Claims (16)

  1. 一种图像复原方法,其中,包括:
    对获取到的图像进行区域划分,得到一个以上子图像;
    将每个子图像输入至多路径神经网络中,采用为所述每个子图像确定出的复原网络对所述每个子图像进行复原,输出得到每个子图像的复原图像,以得到所述图像的复原图像。
  2. 根据权利要求1所述的方法,其中,所述将每个子图像输入至多路径神经网络中,采用为所述每个子图像确定出的复原网络对所述每个子图像进行复原,得到每个子图像的复原图像,包括:
    对所述每个子图像进行编码,得到所述每个子图像的特征;
    将所述每个子图像的特征输入至所述多路径神经网络的子网络中,采用所述子网络中的路径选择网络,为所述每个子图像选择复原网络,根据所述每个子图像的复原网络,对所述每个子图像进行处理,输出得到每个子图像处理后的特征;
    对每个子图像处理后的特征进行解码,得到所述每个子图像的复原图像。
  3. 根据权利要求2所述的方法,其中,所述将所述每个子图像的特征输入至所述多路径神经网络的子网络中,采用所述子网络中的路径选择网络,为所述每个子图像选择复原网络,根据所述每个子图像的复原网络,对所述每个子图像进行处理,输出得到每个子图像处理后的特征,包括:
    当所述子网络的个数为N,且N个子网络依次相连时;
    将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;
    根据所述第i个复原网络,对所述每个子图像的第i级特征进行处理,输出得到所述每个子图像的第i+1级特征;
    i更新为i+1,返回至所述将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;
    直至输出得到每个子图像的第N级特征,将所述每个子图像的第N级特征确定为所述每个子图像处理后的特征;
    当i=1时,所述每个子图像的第i级特征为所述每个子图像的特征;
    其中,N为不小于1的正整数,M为不小于2的正整数,i为大于等于1小于等于N的正整数。
  4. 根据权利要求1所述的方法,其中,当得到子图像的复原图像的数目大于等于预设数目时,所述方法还包括:
    获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像;
    基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数;
    且,基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的奖励函数,通过所述优化器采用强化学习算法,对所述路径选择网络进行训练,以更新所述路径选择网络中的参数。
  5. 根据权利要求4所述的方法,其中,在获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像之后,在根据得到的预设数目的子图像的复原图像与对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数之前,所述方法还包括:
    基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中的参数。
  6. 根据权利要求4所述的方法,其中,所述奖励函数如下所示:
    Figure PCTCN2019083855-appb-100001
    其中,r i代表第i级子网络的奖励函数,p表示一个预设的惩罚项,1 {1}(a i)表示一个指示函数,d表示难度系数;
    当a i=1时,指示函数的值为1,当a i≠1时,指示函数的值为0。
  7. 根据权利要求6所述的方法,其中,所述难度系数d如下所示:
    Figure PCTCN2019083855-appb-100002
    其中,L d表示所述预设的子图像的复原图像与相对应的参考图像之间的损失函数,L 0为一个阈值。
  8. 一种图像复原装置,其中,包括:
    划分模块,配置为对获取到的图像进行区域划分,得到一个以上子图像;
    复原模块,配置为将每个子图像输入至多路径神经网络中,采用为所述每个子图像确定出的复原网络对所述每个子图像进行复原,输出得到每个子图像的复原图像,以得到所述图像的复原图像。
  9. 根据权利要求8所述的装置,其中,所述复原模块,包括:
    编码子模块,配置为对所述每个子图像进行编码,得到所述每个子图像的特征;
    复原子模块,配置为将所述每个子图像的特征输入至所述多路径神经网络的子网络中,采用所述子网络中的路径选择网络,为所述每个子图像选择复原网络,根据所述每个子图像的复原网络,对所述每个子图像进行处理,输出得到每个子图像处理后的特征;
    解码子模块,配置为对每个子图像处理后的特征进行解码,得到所述每个子图像的复原图像。
  10. 根据权利要求9所述的装置,其中,所述复原子模块,具体配置为:
    当所述子网络的个数为N,且N个子网络依次相连时;
    将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;
    根据所述第i个复原网络,对所述每个子图像的第i级特征进行处理,输出得到所述每个子图像的第i+1级特征;
    i更新为i+1,返回至所述将每个子图像的第i级特征输入至第i个子网络中,采用第i个子网络中的第i个路径选择网络,从第i个子网络中的M个复原网络中,为所述每个子图像选择第i个复原网络;
    直至输出得到每个子图像的第N级特征,将所述每个子图像的第N级特征确定为所述每个子图像处理后的特征;
    当i=1时,所述每个子图像的第i级特征为所述每个子图像的特征;
    其中,N为不小于1的正整数,M为不小于2的正整数,i为大于等于1小于等于N的正整数。
  11. 根据权利要求8所述的装置,其中,当得到子图像的复原图像的数目大于等于预设数目时,所述装置还包括:
    获取模块,配置为获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相对应的参考图像;
    第一训练模块,配置为:
    基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数;
    且,基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的奖励函数,通过所述优化器采用强化学习算法,对所述路径选择网络进行训练,以更新所述路径选择网络中的参数。
  12. 根据权利要求11所述的装置,其中,所述装置还包括:
    第二训练模块,配置为:
    在获取预设数目的子图像的复原图像,以及获取与预设数目的子图像的复原图像相 对应的参考图像之后,在根据得到的预设数目的子图像的复原图像与对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数之前,基于所述预设数目的子图像的复原图像和相对应的参考图像,根据预设的子图像的复原图像与相对应的参考图像之间的损失函数,通过优化器对所述多路径神经网络中除路径选择网络以外的网络进行训练,以更新所述多路径神经网络中除路径选择网络以外的网络的参数。
  13. 根据权利要求11所述的装置,其中,所述奖励函数如下所示:
    Figure PCTCN2019083855-appb-100003
    其中,r i代表第i级子网络的奖励函数,p表示一个预设的惩罚项,1 {1}(a i)表示一个指示函数,d表示难度系数;
    当a i=1时,指示函数的值为1,当a i≠1时,指示函数的值为0。
  14. 根据权利要求13所述的装置,其中,所述难度系数d如下所示:
    Figure PCTCN2019083855-appb-100004
    其中,L d表示所述预设的子图像的复原图像与相对应的参考图像之间的损失函数,L 0为一个阈值。
  15. 一种电子设备,其中,所述电子设备包括:处理器、存储器和通信总线;其中,
    所述通信总线,配置为实现所述处理器和所述存储器之间的连接通信;
    所述处理器,配置为执行所述存储器中存储的图像复原程序,以实现权利要求1-7任一项所述的图像复原方法。
  16. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可以被一个或者多个处理器执行,以实现权利要求1-7任一项所述的图像复原方法。
PCT/CN2019/083855 2019-02-15 2019-04-23 图像复原方法及装置、电子设备、存储介质 Ceased WO2020164189A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
SG11202106269UA SG11202106269UA (en) 2019-02-15 2019-04-23 Image restoration method and apparatus, electronic device, and storage medium
KR1020217018723A KR20210092286A (ko) 2019-02-15 2019-04-23 이미지 복원 방법 및 장치, 전자 기기, 저장 매체
JP2021535032A JP7143529B2 (ja) 2019-02-15 2019-04-23 画像復元方法及びその装置、電子機器並びに記憶媒体
US17/341,607 US20210295473A1 (en) 2019-02-15 2021-06-08 Method for image restoration, electronic device, and storage medium

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910117782.X 2019-02-15
CN201910117782.XA CN109886891B (zh) 2019-02-15 2019-02-15 一种图像复原方法及装置、电子设备、存储介质

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/341,607 Continuation US20210295473A1 (en) 2019-02-15 2021-06-08 Method for image restoration, electronic device, and storage medium

Publications (1)

Publication Number Publication Date
WO2020164189A1 true WO2020164189A1 (zh) 2020-08-20

Family

ID=66928293

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/083855 Ceased WO2020164189A1 (zh) 2019-02-15 2019-04-23 图像复原方法及装置、电子设备、存储介质

Country Status (7)

Country Link
US (1) US20210295473A1 (zh)
JP (1) JP7143529B2 (zh)
KR (1) KR20210092286A (zh)
CN (1) CN109886891B (zh)
SG (1) SG11202106269UA (zh)
TW (1) TWI770432B (zh)
WO (1) WO2020164189A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115049556A (zh) * 2022-06-27 2022-09-13 安徽大学 一种基于StyleGAN的人脸图像修复方法
CN115760616A (zh) * 2022-11-16 2023-03-07 中国农业银行股份有限公司 一种人体点云修复方法、装置、电子设备及存储介质
JP2024532068A (ja) * 2021-09-15 2024-09-05 キヤノン株式会社 データを符号化および復号する方法およびシステム

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111968040B (zh) * 2020-07-02 2024-07-26 北京大学深圳研究生院 图像的复原方法、系统及计算机可读存储介质
CN111986103A (zh) * 2020-07-20 2020-11-24 北京市商汤科技开发有限公司 图像处理方法、装置、电子设备和计算机存储介质
CN112200226B (zh) * 2020-09-27 2021-11-05 北京达佳互联信息技术有限公司 基于强化学习的图像处理方法、图像处理方法及相关装置
CN112767260B (zh) * 2020-12-30 2024-11-26 上海联影智能医疗科技有限公司 图像质量提升方法、装置、计算机设备和存储介质
KR102817011B1 (ko) 2021-01-13 2025-06-09 삼성전자주식회사 이미지를 업스케일하는 전자 장치 및 이의 제어 방법
CN112862681B (zh) * 2021-01-29 2023-04-14 中国科学院深圳先进技术研究院 一种超分辨率方法、装置、终端设备及存储介质
CN113409215B (zh) * 2021-06-23 2023-01-17 青岛海信医疗设备股份有限公司 重建设备及医学影像多平面重建方法
CN117561537A (zh) 2021-10-07 2024-02-13 三星电子株式会社 显示设备及其操作方法
CN114399429B (zh) * 2021-12-30 2026-01-09 无锡安科迪智能技术有限公司 图像拼接方法、装置、电子设备和存储介质
CN114820341B (zh) * 2022-03-17 2025-09-23 西北工业大学 一种基于增强Transformer的图像盲去噪方法及系统
CN116630181B (zh) * 2023-04-28 2026-01-30 京东方科技集团股份有限公司 一种图像修复方法、装置及电子设备
CN120032149B (zh) * 2025-04-15 2025-07-11 杭州海康威视数字技术股份有限公司 一种基于图像检测自然语言描述目标的方法及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5146159B2 (ja) * 2008-07-01 2013-02-20 株式会社ニコン 画像復元方法、画像復元プログラム、および画像復元装置
CN103605972A (zh) * 2013-12-10 2014-02-26 康江科技(北京)有限责任公司 一种基于分块深度神经网络的非限制环境人脸验证方法
CN107563974A (zh) * 2017-08-15 2018-01-09 深圳云天励飞技术有限公司 图像去噪方法、装置、电子设备及存储介质
CN109087273A (zh) * 2018-07-20 2018-12-25 哈尔滨工业大学(深圳) 基于增强的神经网络的图像复原方法、存储介质及系统

Family Cites Families (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO1993003443A1 (fr) * 1991-08-05 1993-02-18 Kawasaki Steel Corporation Processeur de signaux et sa methode d'apprentissage
JPH08263649A (ja) * 1995-02-21 1996-10-11 Xerox Corp ニューラルベースの空間画像強化システム
US20050129306A1 (en) * 2003-12-12 2005-06-16 Xianglin Wang Method and apparatus for image deinterlacing using neural networks
US9396523B2 (en) * 2013-07-24 2016-07-19 Microsoft Technology Licensing, Llc Image restoration cascade
CN104200443A (zh) * 2014-09-22 2014-12-10 中华人民共和国四川出入境检验检疫局 结合alpha通道和图像分割的局部运动模糊复原算法
EP3156943A1 (en) * 2015-10-16 2017-04-19 Thomson Licensing Method and device for clustering patches of a degraded version of an image
US10540590B2 (en) * 2016-12-29 2020-01-21 Zhejiang Gongshang University Method for generating spatial-temporally consistent depth map sequences based on convolution neural networks
CN106971187B (zh) * 2017-04-12 2019-07-09 华中科技大学 一种基于车辆特征点的车辆部件检测方法和系统
CN107273904A (zh) * 2017-05-31 2017-10-20 上海联影医疗科技有限公司 图像处理方法及系统
US10657446B2 (en) * 2017-06-02 2020-05-19 Mitsubishi Electric Research Laboratories, Inc. Sparsity enforcing neural network
CN107392865B (zh) * 2017-07-01 2020-08-07 广州深域信息科技有限公司 一种人脸图像的复原方法
CN107463881A (zh) * 2017-07-07 2017-12-12 中山大学 一种基于深度增强学习的人物图像搜索方法
JP6772112B2 (ja) * 2017-07-31 2020-10-21 株式会社日立製作所 医用撮像装置及び医用画像処理方法
CN107784647B (zh) * 2017-09-29 2021-03-09 华侨大学 基于多任务深度卷积网络的肝脏及其肿瘤分割方法及系统
CN107832807B (zh) * 2017-12-07 2020-08-07 上海联影医疗科技有限公司 一种图像处理方法和系统
CN108364262A (zh) * 2018-01-11 2018-08-03 深圳大学 一种模糊图像的复原方法、装置、设备及存储介质
CN108921220A (zh) * 2018-06-29 2018-11-30 国信优易数据有限公司 图像复原模型训练方法、装置及图像复原方法和装置
CN108932536B (zh) * 2018-07-18 2021-11-09 电子科技大学 基于深度神经网络的人脸姿态重建方法

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5146159B2 (ja) * 2008-07-01 2013-02-20 株式会社ニコン 画像復元方法、画像復元プログラム、および画像復元装置
CN103605972A (zh) * 2013-12-10 2014-02-26 康江科技(北京)有限责任公司 一种基于分块深度神经网络的非限制环境人脸验证方法
CN107563974A (zh) * 2017-08-15 2018-01-09 深圳云天励飞技术有限公司 图像去噪方法、装置、电子设备及存储介质
CN109087273A (zh) * 2018-07-20 2018-12-25 哈尔滨工业大学(深圳) 基于增强的神经网络的图像复原方法、存储介质及系统

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2024532068A (ja) * 2021-09-15 2024-09-05 キヤノン株式会社 データを符号化および復号する方法およびシステム
JP7765597B2 (ja) 2021-09-15 2025-11-06 キヤノン株式会社 データを符号化および復号する方法およびシステム
CN115049556A (zh) * 2022-06-27 2022-09-13 安徽大学 一种基于StyleGAN的人脸图像修复方法
CN115760616A (zh) * 2022-11-16 2023-03-07 中国农业银行股份有限公司 一种人体点云修复方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
TWI770432B (zh) 2022-07-11
CN109886891A (zh) 2019-06-14
SG11202106269UA (en) 2021-07-29
JP2022514566A (ja) 2022-02-14
TW202032497A (zh) 2020-09-01
US20210295473A1 (en) 2021-09-23
JP7143529B2 (ja) 2022-09-28
CN109886891B (zh) 2022-01-11
KR20210092286A (ko) 2021-07-23

Similar Documents

Publication Publication Date Title
TWI770432B (zh) 圖像復原方法、電子設備、儲存介質
Jo et al. Practical single-image super-resolution using look-up table
US11526995B2 (en) Robust use of semantic segmentation for depth and disparity estimation
CA3137297C (en) Adaptive convolutions in neural networks
CN103167218B (zh) 一种基于非局部性的超分辨率重建方法和设备
Li et al. Unidirectional video denoising by mimicking backward recurrent modules with look-ahead forward ones
CN112446461B (zh) 一种神经网络模型训练方法及装置
CN110310242B (zh) 一种图像去模糊方法及装置、存储介质
CN112418279B (zh) 图像融合方法、装置、电子设备及可读存储介质
WO2024072250A1 (en) Neural network training method and apparatus, image processing method and apparatus
WO2021057926A1 (zh) 一种神经网络模型训练方法及装置
CN116843559A (zh) 一种基于图像处理与深度学习的水下图像增强方法
CN114581493B (zh) 双向光流估计方法和装置
JP2024511920A (ja) 圧縮情報に基づくビデオの超解像
KR102590926B1 (ko) 왜곡 이미지의 이미지 복원 방법 및 장치
JP2024125014A (ja) 情報処理装置、情報処理方法、及びプログラム
CN116052233A (zh) 一种神经网络优化方法、装置、计算设备及存储介质
CN110120009A (zh) 基于显著物体检测和深度估计算法的背景虚化实现方法
CN115908592A (zh) 特征图的处理方法和相关设备
HK40003434B (zh) 一种图像复原方法及装置、电子设备、存储介质
Zheng et al. SEEC: segmentation-assisted multi-entropy models for learned lossless image compression
US12363249B2 (en) Method and system for generation of a plurality of portrait effects in an electronic device
CN108200442B (zh) 一种基于神经网络的hevc帧内编码单元划分方法
JP7634034B2 (ja) 情報処理装置、情報処理方法、及びプログラム
Nasrat et al. SERDNet: adaptive residual dense learning with dual-path fusion and squeeze-and-excitation for robust image denoising: AF Nasrat et al.

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19914958

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2021535032

Country of ref document: JP

Kind code of ref document: A

Ref document number: 20217018723

Country of ref document: KR

Kind code of ref document: A

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19914958

Country of ref document: EP

Kind code of ref document: A1