CN115115527A - Image processing method and device - Google Patents

Image processing method and device Download PDF

Info

Publication number
CN115115527A
CN115115527A CN202110302555.1A CN202110302555A CN115115527A CN 115115527 A CN115115527 A CN 115115527A CN 202110302555 A CN202110302555 A CN 202110302555A CN 115115527 A CN115115527 A CN 115115527A
Authority
CN
China
Prior art keywords
image
neural network
convolutional neural
input
target
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.)
Pending
Application number
CN202110302555.1A
Other languages
Chinese (zh)
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.)
New Singularity International Technical Development Co ltd
Original Assignee
New Singularity International Technical 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 New Singularity International Technical Development Co ltd filed Critical New Singularity International Technical Development Co ltd
Priority to CN202110302555.1A priority Critical patent/CN115115527A/en
Publication of CN115115527A publication Critical patent/CN115115527A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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; CALCULATING OR 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]

Landscapes

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

Abstract

The application discloses an image processing method and a device, the method is used for an image processing model, firstly, a first convolution neural network in the image processing model is used for extracting a reflection component and an illumination component from initial image information, and then a second convolution neural network in the image processing model is used for synthesizing the reflection component and the illumination component into intermediate image information, so that illumination enhancement processing of an initial image is completed; and extracting intermediate image features from the intermediate image information by using a third convolutional neural network in the image processing model, amplifying the intermediate image features by using an up-sampling layer in the image processing model, and finally performing resolution enhancement processing on the amplified intermediate image features by using a fourth convolutional neural network in the image processing model to obtain an illumination and resolution enhanced image. The image processing method provided by the embodiment of the application can improve the image resolution and avoid image color distortion and information loss while improving the image illuminance.

Description

图像处理方法及装置Image processing method and device

技术领域technical field

本申请涉及图像处理技术领域,尤其涉及一种图像处理方法及装置。The present application relates to the technical field of image processing, and in particular, to an image processing method and apparatus.

背景技术Background technique

受限于采集图像时的天气、光照条件以及图像采集设备的性能,使得图像的信息保留情况往往难以满足后续的处理需求。为解决这一问题,通常采用图像增强方法对图像进行增强处理,以突出图像中重要的信息,同时削弱不重要的信息。Limited by the weather, lighting conditions and the performance of the image acquisition device when the image is collected, the information retention of the image is often difficult to meet the subsequent processing requirements. To solve this problem, the image enhancement method is usually used to enhance the image to highlight the important information in the image, while weakening the unimportant information.

在图像处理领域中,对于低照度图像,通常采用光照补偿方法对其进行增强处理,目的是增强图像对比度和暗处细节,从而解决图像光照过低的问题。然而,多数光照补偿方法虽然能够改善图像光照过低的问题,但极易造成图像色彩失真,且会损失图像中部分重要信息。In the field of image processing, for low-illumination images, illumination compensation methods are usually used to enhance them, in order to enhance the image contrast and dark details, so as to solve the problem of too low image illumination. However, although most illumination compensation methods can improve the problem of too low image illumination, it is easy to cause image color distortion and lose some important information in the image.

发明内容SUMMARY OF THE INVENTION

本申请提供一种图像处理方法及装置,以解决现有光照补偿方法极易造成图像色彩失真,且会损失图像中部分重要信息的问题。The present application provides an image processing method and device to solve the problem that the existing illumination compensation method easily causes image color distortion and loses some important information in the image.

第一方面,本申请提供一种图像处理方法,用于图像处理模型,所述方法包括:In a first aspect, the present application provides an image processing method for an image processing model, the method comprising:

利用图像处理模型中的第一卷积神经网络从初始图像信息中提取反射分量和光照分量;Using the first convolutional neural network in the image processing model to extract the reflection component and the illumination component from the initial image information;

利用图像处理模型中的第二卷积神经网络对所述反射分量和光照分量进行合成处理,输出中间图像信息;Use the second convolutional neural network in the image processing model to synthesize the reflection component and the illumination component, and output intermediate image information;

利用图像处理模型中的第三卷积神经网络从所述中间图像信息中提取中间图像特征,并利用图像处理模型中的上采样层对所述中间图像特征进行放大处理;Use the third convolutional neural network in the image processing model to extract intermediate image features from the intermediate image information, and use the upsampling layer in the image processing model to amplify the intermediate image features;

利用图像处理模型中的第四卷积神经网络放大后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。The image processing model uses the enlarged intermediate image features of the fourth convolutional neural network to perform resolution enhancement processing to obtain an image with enhanced illumination and resolution.

第二方面,本申请还提供一种图像处理装置,所述装置包括:In a second aspect, the present application further provides an image processing device, the device comprising:

低照度增强模块,用于从初始图像信息中提取反射分量和光照分量;对所述反射分量和光照分量进行合成处理,输出中间图像信息;A low-illuminance enhancement module, used for extracting a reflection component and an illumination component from the initial image information; synthesizing the reflection component and the illumination component, and outputting intermediate image information;

分辨率增强模块,用于从所述中间图像信息中提取中间图像特征;对所述中间图像特征进行放大处理;对放大处理后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。A resolution enhancement module is used for extracting intermediate image features from the intermediate image information; performing amplification processing on the intermediate image features; performing resolution enhancement processing on the enlarged intermediate image features to obtain illumination and resolution enhanced images .

由以上技术方案可知,本申请实施例提供一种图像处理方法及装置,该方法首先利用第一卷积神经网络从初始图像信息中提取出反射分量和光照分量,然后利用第二卷积神经网络将反射分量和光照分量合成为中间图像信息,从而完成对初始图像的光照度增强处理;再利用第三卷积神经网络从中间图像信息中提取中间图像特征,然后利用上采样层对中间图像特征进行放大处理,最后利用第四卷积神经网络对放大后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。本申请实施例提供的图像处理方法,可以在改善图像光照度的同时,提高图像分辨率、避免图像色彩失真以及信息损失。It can be seen from the above technical solutions that the embodiments of the present application provide an image processing method and device. The method first uses a first convolutional neural network to extract reflection components and illumination components from initial image information, and then uses a second convolutional neural network. The reflection component and the illumination component are synthesized into the intermediate image information to complete the illumination enhancement processing of the initial image; the third convolutional neural network is used to extract the intermediate image features from the intermediate image information, and then the intermediate image features are processed by the upsampling layer. Enlargement processing, and finally, the fourth convolutional neural network is used to perform resolution enhancement processing on the enlarged intermediate image features to obtain illumination and resolution enhanced images. The image processing method provided by the embodiments of the present application can improve the image illuminance while improving the image resolution, avoiding image color distortion and information loss.

附图说明Description of drawings

为了更清楚地说明本申请的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to illustrate the technical solutions of the present application more clearly, the accompanying drawings that need to be used in the embodiments will be briefly introduced below. Other drawings can also be obtained from these drawings.

图1为本申请根据示例性实施例示出的低照度增强模块和分辨率增强模块的结构示意图;1 is a schematic structural diagram of a low-illuminance enhancement module and a resolution enhancement module according to an exemplary embodiment of the present application;

图2为本申请根据示例性示出的一种图像处理方法流程图;FIG. 2 is a flowchart of an image processing method according to an exemplary illustration of the present application;

图3为本申请示例性示出的一种第二卷积神经网络示意图;3 is a schematic diagram of a second convolutional neural network exemplarily shown in the application;

图4为本申请根据示例性示出的低照度初始图像和中间图像示意图;FIG. 4 is a schematic diagram of a low-illumination initial image and an intermediate image according to an exemplary illustration of the present application;

图5为本申请根据示例性示出的中间图像和照度及分辨率增强图像示意图;FIG. 5 is a schematic diagram of an intermediate image and an illuminance and resolution enhanced image according to an exemplary illustration of the present application;

图6为本申请根据示例性实施例示出的一种图像处理方法流程图;6 is a flowchart of an image processing method according to an exemplary embodiment of the present application;

图7为本申请根据示例性实施例示出的一种图像处理装置示意图。FIG. 7 is a schematic diagram of an image processing apparatus according to an exemplary embodiment of the present application.

具体实施方式Detailed ways

为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。In order to make those skilled in the art better understand the technical solutions in the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described The embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the scope of protection of the present application.

本申请实施例提供一种图像处理方法,该方法首先针对低照度图像构建基于神经网络的图像处理模型,然后使用训练好的图像处理模型,对低照度图像进行处理,目的是改善低照度图像的光照度、提高图像的分辨率、避免色彩失真以及信息损失,输出照度及分辨率增强图像。The embodiment of the present application provides an image processing method. The method first constructs an image processing model based on a neural network for low-light images, and then uses the trained image processing model to process the low-light images, so as to improve the quality of the low-light images. Illumination, improve image resolution, avoid color distortion and information loss, and output illumination and resolution enhancement images.

图1为本申请根据示例性实施例示出的图像处理模型的结构示意图。如图1所示,该图像处理模型包括顺次连接的第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、至少一个上采样层和第四卷积神经网络。其中,第一卷积神经网络用于从输入的初始图像(低照度图像)信息中提取出反射分量和光照分量,第二卷积神经网络用于将第一卷积神经网络输出的反射分量和光照分量合成为中间图像信息。值得注意的是,相比于初始图像信息,中间图像的光照度得到增强。第三卷积神经网络用于从第二卷积神经网络输出的中间图像信息中提取中间图像特征,至少一个上采样层则用于对第三卷积神经网络输出的中间图像特征进行至少一次放大处理,第四卷积神经网络则用于对放大后的中间图像特征进行分辨率增强,最后输出照度及分辨率增强图像。值得注意的是,相比于中间图像信息,最终输出的照度及分辨率增强图像的尺寸得到放大、分辨率得到增强。FIG. 1 is a schematic structural diagram of an image processing model according to an exemplary embodiment of the present application. As shown in FIG. 1 , the image processing model includes a first convolutional neural network, a second convolutional neural network, a third convolutional neural network, at least one upsampling layer, and a fourth convolutional neural network connected in sequence. Among them, the first convolutional neural network is used to extract the reflection component and the illumination component from the input initial image (low-light image) information, and the second convolutional neural network is used to extract the reflection component and the illumination component output by the first convolutional neural network. The illumination components are synthesized into intermediate image information. It is worth noting that the illuminance of the intermediate image is enhanced compared to the initial image information. The third convolutional neural network is used for extracting intermediate image features from the intermediate image information output by the second convolutional neural network, and at least one upsampling layer is used for at least one amplification of the intermediate image features output by the third convolutional neural network The fourth convolutional neural network is used to enhance the resolution of the enlarged intermediate image features, and finally output the luminance and resolution enhanced images. It is worth noting that, compared with the intermediate image information, the size of the final output illumination and resolution-enhanced image is enlarged and the resolution is enhanced.

图2为本申请根据示例性示出的一种图像处理方法流程图,如图2所示,该方法可以包括:FIG. 2 is a flowchart of an image processing method according to an exemplary illustration of the present application. As shown in FIG. 2 , the method may include:

S210,利用图像处理模型中的第一卷积神经网络从初始图像信息中提取反射分量和光照分量。S210, using the first convolutional neural network in the image processing model to extract the reflection component and the illumination component from the initial image information.

本申请实施例中,初始图像信息是初始图像的向量化表示,其中,初始图像作为本申请图像处理方法的处理对象,应当是亮度参数符合预设条件的低照度图像。例如,对于一张大小为a×b、通道数为c的初始图像来说,其对应的初始图像信息可以表示为向量a×b×c。又如,对于一张大小为64×64的RGB图片来说,其对应的初始图像信息可以表示为64×64×3的向量,其中,RGB图片的通道数为3。In the embodiment of the present application, the initial image information is a vectorized representation of the initial image, wherein the initial image, as the processing object of the image processing method of the present application, should be a low-illuminance image whose brightness parameter meets preset conditions. For example, for an initial image whose size is a×b and the number of channels is c, the corresponding initial image information can be represented as a vector a×b×c. For another example, for an RGB picture with a size of 64×64, the corresponding initial image information can be represented as a 64×64×3 vector, wherein the number of channels of the RGB picture is 3.

本申请中,第一卷积神经网络用于将初始图像信息分割成反射分量和光照分量。第一卷积神经网络可以包括n个顺次连接的卷积层,利用第一卷积神经网络从初始图像信息中提取反射分量和光照分量,即是利用该n个对初始图像信息进行n次卷积处理,其中,第1个卷积层的输入为初始图像信息,第i个卷积层的输出结果为第i+1个卷积层的输入,第n个卷积层的输出结果为4个特征图,i为1,2,……,n-1,4为第n个卷积层的通道数。作为可能的实现方式,可以将第1至第3个特征图作为从初始图像信息中提取出的反射分量,将第4个特征图作为从初始图像信息中提取出的光照分量。另外,为了保证输入图像与输出图像的大小一致,将每个卷积层的填充像素大小设置为(卷积核大小-1)的一半。In this application, the first convolutional neural network is used to segment the initial image information into reflection components and illumination components. The first convolutional neural network may include n consecutively connected convolutional layers, and the first convolutional neural network is used to extract the reflection component and the illumination component from the initial image information, that is, using the n convolutional layers to perform n times on the initial image information. Convolution processing, where the input of the first convolutional layer is the initial image information, the output of the i-th convolutional layer is the input of the i+1-th convolutional layer, and the output of the n-th convolutional layer is 4 feature maps, i is 1, 2, ..., n-1, 4 is the number of channels of the nth convolutional layer. As a possible implementation, the first to third feature maps may be used as the reflection component extracted from the initial image information, and the fourth feature map may be used as the illumination component extracted from the initial image information. In addition, to ensure that the input image is the same size as the output image, the padding pixel size of each convolutional layer is set to half of (convolution kernel size - 1).

在一个例子中,初始图像信息为64×64×3的向量,第一卷积神经网络包括3个顺次连接的卷积层(即n=3)。其中,第1个卷积层和第2个卷积层的通道数都为64,第3个卷积层的通道数为4。在这个例子中,第一卷积神经网络的输出结果为4个特征图,前3个特征图为初始图像信息的反射分量,该反射分量具体可以表示为向量64×64×3,第4个特征图为初始图像信息的光照分量,该光照分量具体为向量64×64×1。In one example, the initial image information is a 64×64×3 vector, and the first convolutional neural network includes 3 sequentially connected convolutional layers (ie, n=3). Among them, the number of channels of the first convolutional layer and the second convolutional layer are both 64, and the number of channels of the third convolutional layer is 4. In this example, the output result of the first convolutional neural network is 4 feature maps. The first 3 feature maps are the reflection components of the initial image information. The feature map is the illumination component of the initial image information, and the illumination component is specifically a vector of 64×64×1.

S220,利用图像处理模型中的第二卷积神经网络对所述反射分量和光照分量进行合成处理,输出中间图像信息。S220. Use the second convolutional neural network in the image processing model to perform synthesis processing on the reflection component and the illumination component, and output intermediate image information.

中间图像信息即为中间图像的向量化表示。本申请中,第二卷积神经网络用于将第一卷积神经网络输出的反射分量和光照分量合成为中间图像信息。具体的,该第二卷积神经网络包括基于ResNet结构的多个卷积层,在利用该第二卷积神经网络对反射分量和光照分量进行处理时,以反射分量和光照分量作为第1个卷积层的输入,其余每层的输入均为上一层的输入及输出的加和,每3个卷积层的结果堆叠起来作为下一个卷积层的输入,最后连接3个连续的卷积层。其中,最后连接的3个卷积层中,第1个卷积层降低通道数为堆叠输入的三分之一,另2个卷积层与第1个卷积层形成小瓶颈结果,其通道数分别为1、3。最后一个卷积层的输出结果即为中间图像信息。The intermediate image information is the vectorized representation of the intermediate image. In this application, the second convolutional neural network is used to synthesize the reflection component and the illumination component output by the first convolutional neural network into intermediate image information. Specifically, the second convolutional neural network includes a plurality of convolutional layers based on the ResNet structure, and when using the second convolutional neural network to process the reflection component and the illumination component, the reflection component and the illumination component are used as the first The input of the convolutional layer, the input of each other layer is the sum of the input and output of the previous layer, the results of each 3 convolutional layers are stacked as the input of the next convolutional layer, and finally connected to 3 consecutive volumes Laminate. Among them, among the last 3 convolutional layers connected, the first convolutional layer reduces the number of channels to one-third of the stacked input, and the other two convolutional layers and the first convolutional layer form a small bottleneck result, and its channel The numbers are 1 and 3, respectively. The output of the last convolutional layer is the intermediate image information.

图3为本申请示例性示出的一种第二卷积神经网络示意图,如图3所示,第二卷积神经网络包括基于ResNet结构的6个卷积层,分别为卷积层1-6。在利用该第二卷积神经网络对反射分量和光照分量进行处理时,以反射分量和光照分量作为卷积层1的输入;将卷积层1的输入和输出相加,作为卷积层2的输入;将卷积层2的输入和输出相加,作为卷积层3的输入;将卷积层1的输出、卷积层2的输出以及卷积层3的输出堆叠,作为卷积层4的输入,且卷积层4的通道数为前述堆叠结果通道数的三分之一;将卷积层4的输出作为卷积层5的输入,将卷积层5的输出作为卷积层6的输入,卷积层6输出中间图像信息,其中,卷积层5的通道数为1,卷积层6的通道数为3。FIG. 3 is a schematic diagram of a second convolutional neural network exemplarily shown in the application. As shown in FIG. 3 , the second convolutional neural network includes 6 convolutional layers based on the ResNet structure, which are convolutional layers 1- 6. When using the second convolutional neural network to process the reflection component and the illumination component, the reflection component and the illumination component are used as the input of the convolutional layer 1; the input and output of the convolutional layer 1 are added, as the convolutional layer 2 The input of convolution layer 2 and the output are added as the input of convolution layer 3; the output of convolution layer 1, the output of convolution layer 2 and the output of convolution layer 3 are stacked as the convolution layer 4, and the number of channels of convolutional layer 4 is one third of the number of channels of the previous stacking result; the output of convolutional layer 4 is used as the input of convolutional layer 5, and the output of convolutional layer 5 is used as the convolutional layer. The input of 6, the convolutional layer 6 outputs the intermediate image information, wherein the number of channels of the convolutional layer 5 is 1, and the number of channels of the convolutional layer 6 is 3.

应当理解,本申请对第二卷积神经网络中包含的卷积层数量不予限定。例如,第二卷积神经网络可以包括图3中示出的6个卷积层,也可以包括更多的卷积层,如可以包括9个卷积层,此处不予赘述。It should be understood that the present application does not limit the number of convolutional layers included in the second convolutional neural network. For example, the second convolutional neural network may include the 6 convolutional layers shown in FIG. 3 , or may include more convolutional layers, for example, may include 9 convolutional layers, which will not be repeated here.

图4为本申请根据示例性示出的低照度初始图像和中间图像示意图,由图4可以看出,低照度初始图像A经第一卷积神经网络和第二卷积神经网络的处理后,得到中间图像B,相对于图像A,图像B的照度明显加强。FIG. 4 is a schematic diagram of a low-illumination initial image and an intermediate image according to an exemplary illustration of the present application. It can be seen from FIG. 4 that after the low-illumination initial image A is processed by the first convolutional neural network and the second convolutional neural network, An intermediate image B is obtained. Compared with the image A, the illumination of the image B is significantly enhanced.

S230,利用图像处理模型中的第三卷积神经网络从中间图像信息中提取中间图像特征,并利用上采样层对所述中间图像特征进行放大处理。S230 , using the third convolutional neural network in the image processing model to extract intermediate image features from the intermediate image information, and using an upsampling layer to perform amplification processing on the intermediate image features.

S230,利用图像处理模型中的第四卷积神经网络放大后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。S230 , performing resolution enhancement processing on the intermediate image features amplified by the fourth convolutional neural network in the image processing model to obtain an image with enhanced illumination and resolution.

本申请实施例中,第三卷积神经网络包括若干个卷积层,其中的最后一个卷积层连接一个或者多个上采样层,该最后一个卷积层的通道数为32,其余卷积层的通道数为64。上采样层用于对中间图像特征进行放大处理,上采样层的数量决定对初始图像的放大倍数。例如,当最后一个卷积层连接一个上采样层时,处理后的图像相对于初始图像放大两倍,当最后一个卷积层连接两个连续的上采样层时,处理后的图像相对于初始图像放大四倍。应当理解,本领域技术人员可以根据图像处理目标,确定上采样层的数量,本文不予赘述。In the embodiment of the present application, the third convolutional neural network includes several convolutional layers, the last convolutional layer is connected to one or more upsampling layers, the number of channels of the last convolutional layer is 32, and the remaining convolutional layers are The number of channels for the layer is 64. The upsampling layer is used to enlarge the intermediate image features, and the number of the upsampling layers determines the magnification of the initial image. For example, when the last convolutional layer connects an upsampling layer, the processed image is enlarged twice relative to the original image, and when the last convolutional layer connects two consecutive upsampling layers, the processed image is enlarged relative to the original image The image is magnified four times. It should be understood that those skilled in the art can determine the number of up-sampling layers according to the image processing target, and details are not described herein.

第四卷积神经网络用于对放大后的中间图像进行分辨率增强处理。The fourth convolutional neural network is used to perform resolution enhancement processing on the enlarged intermediate image.

图5为本申请根据示例性示出的中间图像和照度及分辨率增强图像示意图,由图5可以看出,中间图像B经第三卷积神经网络、上采样层及第四卷积神经网络的处理后,得到照度及分辨率增强图像C,相对于图像B,图像C的分辨率得到增强,尺寸扩大,且光照度得到进一步优化。FIG. 5 is a schematic diagram of an intermediate image and an illuminance and resolution-enhanced image according to an exemplary illustration of the present application. It can be seen from FIG. 5 that the intermediate image B is processed by the third convolutional neural network, the upsampling layer and the fourth convolutional neural network. After processing, an image C with enhanced illumination and resolution is obtained. Compared with the image B, the resolution of the image C is enhanced, the size is enlarged, and the illumination is further optimized.

由以上实施例可知,本申请实施例提供一种图像处理方法,该方法首先利用图像处理模型中的第一卷积神经网络从初始图像信息中提取出反射分量和光照分量,然后利用图像处理模型中的第二卷积神经网络将反射分量和光照分量合成为中间图像信息,从而完成对初始图像的光照度增强处理;再利用图像处理模型中的第三卷积神经网络从中间图像信息中提取中间图像特征,然后利用图像处理模型中的上采样层对中间图像特征进行放大处理,最后利用图像处理模型中的第四卷积神经网络对放大后的中间图像特征进行分辨率增强处理,从而完成对中间图像的放大及分辨率增强处理。本申请实施例提供的图像处理方法,可以在改善图像光照度的同时,提高图像分辨率、避免图像色彩失真以及信息损失。It can be seen from the above embodiments that the embodiments of the present application provide an image processing method. The method first uses the first convolutional neural network in the image processing model to extract the reflection component and the illumination component from the initial image information, and then uses the image processing model. The second convolutional neural network in the image processing model combines the reflection component and the illumination component into the intermediate image information, so as to complete the illumination enhancement processing of the initial image; the third convolutional neural network in the image processing model is used to extract the intermediate image information from the intermediate image information. image features, and then use the upsampling layer in the image processing model to amplify the intermediate image features, and finally use the fourth convolutional neural network in the image processing model to perform resolution enhancement processing on the enlarged intermediate image features to complete the image processing. Enlargement and resolution enhancement of intermediate images. The image processing method provided by the embodiments of the present application can improve the image illuminance while improving the image resolution, avoiding image color distortion and information loss.

图6为本申请根据示例性实施例示出的一种图像处理方法流程图,其具体示出了对图1所示图像处理模型的训练流程,即对第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、上采样层以及第四卷积神经网络的训练过程。如图6所示,该方法可以包括:FIG. 6 is a flowchart of an image processing method according to an exemplary embodiment of the present application, which specifically shows the training process of the image processing model shown in FIG. 1 , that is, the first convolutional neural network, the second convolutional The training process of the neural network, the third convolutional neural network, the upsampling layer, and the fourth convolutional neural network. As shown in Figure 6, the method may include:

S610,获取训练数据集,所述训练数据集包括若干组相对应的输入图像、中间目标图像和目标图像。S610: Acquire a training data set, where the training data set includes several sets of corresponding input images, intermediate target images, and target images.

其中,中间目标图像与输入图像的尺寸相同,且中间目标图像光照度高于输入图像;目标图像与中间目标图像的光照度相同,且目标图像的尺寸大于中间目标图像。Wherein, the size of the intermediate target image is the same as that of the input image, and the luminance of the intermediate target image is higher than that of the input image; the luminance of the target image is the same as that of the intermediate target image, and the size of the target image is larger than that of the intermediate target image.

在S610的一种可能的实现方式中,首先获取若干组原始图像,每组原始图像包括相对应的低照度图像和正常光照图像。该相对应的低照度图像和正常关照图像是指在同一拍摄场景、不同光照环境下所分别采集得到的图像,且两张图像的尺寸相同。例如,保持图像采集设备位置及各项参数不变,在低光照条件下采集得到低照度图像,在正常光照条件下采集得到正常光照图像。然后根据各组原始图像生成与每组原始图像分别对应的训练数据,其中,每组训练数据中的输入图像为对应低照度图像缩小k倍的图像,中间目标图像为对应正常光照图像缩小k倍后的图像,目标图像为对应的正常光照图像,k为正数。应当理解,此处涉及的尺寸缩小k倍是指图像的宽和高同时缩小k倍。In a possible implementation manner of S610, several groups of original images are obtained first, and each group of original images includes corresponding low-illumination images and normal-illumination images. The corresponding low-illumination image and normal care image refer to images respectively collected in the same shooting scene and under different lighting environments, and the sizes of the two images are the same. For example, keeping the position and various parameters of the image acquisition device unchanged, a low-illumination image is acquired under low-light conditions, and a normal-illumination image is acquired under normal illumination conditions. Then, according to each group of original images, training data corresponding to each group of original images is generated, wherein the input image in each group of training data is an image reduced by k times corresponding to the low-light image, and the intermediate target image is the corresponding normal light image reduced by k times After the image, the target image is the corresponding normal illumination image, and k is a positive number. It should be understood that the size reduction referred to here by k times means that the width and height of the image are simultaneously reduced by k times.

在一个例子中,某组原始图像包括第一低照度图像和第一正常光照图像,与该组原始图像对应的训练数据包括第一输入图像、第一中间目标图像和第一目标图像。根据S110可知,第一输入图像为第一低照度图像缩小k倍的图像,第一中间目标图像为第一正常光照图像缩小k倍后的图像,第一目标图像为第一正常光照图像。In one example, a certain group of original images includes a first low-illuminance image and a first normal illumination image, and the training data corresponding to the group of original images includes a first input image, a first intermediate target image, and a first target image. According to S110, the first input image is an image reduced by k times of the first low illumination image, the first intermediate target image is an image reduced by k times of the first normal illumination image, and the first target image is the first normal illumination image.

需要说明的是,本领域技术人员可以根据需求设计k的具体数值。例如,当需要利用第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、上采样层和第四卷积神经网络将待处理的初始图像放大4倍时,那么每组训练数据中的输入图像为对应低照度图像缩小4倍的图像,中间目标图像为对应正常光照图像缩小4倍后的图像。It should be noted that those skilled in the art can design a specific value of k according to requirements. For example, when the initial image to be processed needs to be enlarged by 4 times using the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer and the fourth convolutional neural network, then each group The input image in the training data is an image reduced by 4 times corresponding to the low illumination image, and the intermediate target image is an image corresponding to the normal illumination image reduced by 4 times.

S620,利用所述训练数据集对第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、上采样层和第四卷积神经网络进行联合训练。S620. Perform joint training on the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer, and the fourth convolutional neural network by using the training data set.

训练时,将每组训练数据的输入图像输入到所述第一卷积神经网络中,将所述图像处理模型中上一个神经网络的输出,输入到相邻的下一个神经网络中。具体的,,以每组训练数据中的输入图像作为第一卷积神经网络的输入,以第一卷积神经网络输出的输入反射分量和输入光照分量作为第二卷积神经网络的输入,以第二卷积神经网络输出的中间训练图像作为第三卷积神经网络的输入,以第三卷积神经网络的输出作为上采样层的输入,以上采样层的输出作为第四卷积神经网络的输入。During training, the input images of each set of training data are input into the first convolutional neural network, and the output of the previous neural network in the image processing model is input into the adjacent next neural network. Specifically, the input image in each set of training data is used as the input of the first convolutional neural network, the input reflection component and the input illumination component output by the first convolutional neural network are used as the input of the second convolutional neural network, and the The intermediate training image output by the second convolutional neural network is used as the input of the third convolutional neural network, the output of the third convolutional neural network is used as the input of the up-sampling layer, and the output of the above-sampling layer is used as the output of the fourth convolutional neural network. enter.

其中,在将输入图像输入到第一卷积神经网络的同时,将对应的中间目标图像输入到辅助卷积神经网络中,以利用辅助卷积神经网络从该中间目标图像中提取出目标反射分量和目标光照分量,该辅助卷积神经网络与第一卷积神经网络的结构相同,且其参数与第一卷积神经网络的参数同步优化,从而使得辅助卷积神经网络的参数与第一卷积神经网络的参数始终保持相同。Wherein, while inputting the input image into the first convolutional neural network, the corresponding intermediate target image is input into the auxiliary convolutional neural network, so as to use the auxiliary convolutional neural network to extract the target reflection component from the intermediate target image and the target illumination component, the auxiliary convolutional neural network has the same structure as the first convolutional neural network, and its parameters are optimized synchronously with the parameters of the first convolutional neural network, so that the parameters of the auxiliary convolutional neural network are the same as those of the first convolutional neural network. The parameters of the product neural network always remain the same.

每一轮训练结束后,根据预设损失函数计算训练损失,该训练损失包括第一卷积神经网络处产生的第一局部损失、第二卷积神经网络处产生的第二局部损失,以及,第三卷积神经网络、上采样层和第四卷积神经网络处产生的第三局部损失。从而,根据训练损失优化第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、上采样层及第四卷积神经网络的参数,直到满足预设的验证条件。After each round of training, the training loss is calculated according to the preset loss function, and the training loss includes the first local loss generated at the first convolutional neural network, the second local loss generated at the second convolutional neural network, and, The third local loss produced at the third convolutional neural network, the upsampling layer, and the fourth convolutional neural network. Thus, the parameters of the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer and the fourth convolutional neural network are optimized according to the training loss until the preset verification conditions are met.

在一种可能的实现方式中,预设损失函数为MSE函数,在本实现方式中,可以按照下式计算训练损失:In a possible implementation, the preset loss function is the MSE function. In this implementation, the training loss can be calculated according to the following formula:

Figure BDA0002986844760000061
Figure BDA0002986844760000061

其中,N为本轮训练中训练数据的组数;Among them, N is the number of groups of training data in this round of training;

Figure BDA0002986844760000062
表示第i组训练数据在第一卷积神经网络中产生的局部损失,即第一局部损失;
Figure BDA0002986844760000062
Represents the local loss generated by the i-th group of training data in the first convolutional neural network, that is, the first local loss;

Figure BDA0002986844760000063
表示第i组训练数据在第二卷积神经网络中产生的局部损失,即第二局部损失;
Figure BDA0002986844760000063
Represents the local loss generated by the i-th group of training data in the second convolutional neural network, that is, the second local loss;

Figure BDA0002986844760000064
表示第i组训练数据在第三卷积神经网络、上采样层和第四卷积神经网络中产生的局部损失,即第三局部损失;
Figure BDA0002986844760000064
represents the local loss generated by the i-th group of training data in the third convolutional neural network, the upsampling layer and the fourth convolutional neural network, that is, the third local loss;

ω1、ω2、ω3分别为各局部损失对应的权重。ω 1 , ω 2 , and ω 3 are the weights corresponding to each local loss, respectively.

本申请中,所述第一卷积神经网络的输出为从所述输入图像中提取出的输入反射分量和输入光照分量。将根据输入反射分量和输入光照分量还原出的图像称为第一还原图像,将根据目标反射分量和目标光照分量还原得到的图像称为第二还原图像,其中:In this application, the output of the first convolutional neural network is the input reflection component and the input illumination component extracted from the input image. The image restored according to the input reflection component and the input illumination component is called the first restored image, and the image restored according to the target reflection component and the target illumination component is called the second restored image, wherein:

第一还原图像=输入反射分量×输入光照分量;The first restored image=input reflection component×input illumination component;

第二还原图像=目标反射分量×目标光照分量。Second restored image=target reflection component×target illumination component.

本申请中,第一局部损失

Figure BDA0002986844760000065
可以包括:第一还原图像相对于相应的输入图像的损失;第二还原图像相对于相应的中间目标图像的损失;以及,输入反射向量相对于对应目标反射向量的损失。这样,可以通过不断训练,使得第一卷积神经网络输出的输入反射分量不断接近对应目标反射分量,同时,使得第一卷积神经网络输出的输入反射分量和输入光照分量可以尽量还原出对应的输入图像,以及目标反射分量与目标光照分量可以尽量还原出对应的中间目标图像。In this application, the first partial loss
Figure BDA0002986844760000065
It may include: a loss of the first restored image relative to the corresponding input image; a loss of the second restored image relative to the corresponding intermediate target image; and a loss of the input reflection vector relative to the corresponding target reflection vector. In this way, through continuous training, the input reflection component output by the first convolutional neural network can be continuously approached to the corresponding target reflection component, and at the same time, the input reflection component and the input illumination component output by the first convolutional neural network can be restored to the corresponding The input image, as well as the target reflection component and the target illumination component can restore the corresponding intermediate target image as much as possible.

另外,第二局部损失是根据第二卷积神经网络的输出和对应中间目标图像计算得到的,第三局部损失是根据第四卷积神经网络的输出和对应目标图像计算得到的。In addition, the second local loss is calculated from the output of the second convolutional neural network and the corresponding intermediate target image, and the third local loss is calculated from the output of the fourth convolutional neural network and the corresponding target image.

本申请实施例中,可以根据第一卷积神经网络、第二卷积神经网络、第三卷积神经网络以及第四卷积神经网络的梯度预设各局部损失对应的权重ω1、ω2、ω3,一般,神经网络的梯度越小,对应的权重越小。In this embodiment of the present application, the weights ω 1 and ω 2 corresponding to the local losses may be preset according to the gradients of the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, and the fourth convolutional neural network. , ω 3 , generally, the smaller the gradient of the neural network, the smaller the corresponding weight.

在一种实现方式中,ω1小于ω2和ω3In one implementation, ω 1 is less than ω 2 and ω 3 .

训练过程中,当某次迭代结果优于前一次迭代结果时,将该次迭代所使用的参数保存为当前最优参数。训练过程同步输出训练集对应的损失和验证集对应的损失,当在验证集上的损失符合预设的验证条件时,停止训练。During the training process, when the result of an iteration is better than the result of the previous iteration, the parameters used in this iteration are saved as the current optimal parameters. The training process synchronously outputs the loss corresponding to the training set and the loss corresponding to the validation set, and stops training when the loss on the validation set meets the preset validation conditions.

由上述S610-S620可知,本申请提供的图像处理方法,针对低照度图像构建基于神经网络的图像处理模型,该图像处理模型包括顺次连接的第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、至少一个上采样层和第四卷积神经网络,通过对第一卷积神经网络、第二卷积神经网络、第三卷积神经网络、上采样层和第四卷积神经网络进行联合训练,可以使得该图像处理模型具有改善低照度图像光照度的能力和提高中间图像分辨率的能力,并可以避免色彩失真以及信息损失。It can be seen from the above S610-S620 that the image processing method provided by the present application constructs an image processing model based on a neural network for low-illumination images, and the image processing model includes a first convolutional neural network and a second convolutional neural network connected in sequence. , a third convolutional neural network, at least one upsampling layer and a fourth The joint training of convolutional neural networks can make the image processing model have the ability to improve the illumination of low-light images and the ability to improve the resolution of intermediate images, and can avoid color distortion and information loss.

根据上述实施例提供的图像处理方法,本申请实施例还提供一种图像处理装置,如图7所示,该装置可以包括:According to the image processing method provided by the above embodiment, the embodiment of the present application further provides an image processing apparatus. As shown in FIG. 7 , the apparatus may include:

低照度增强模块710,用于从初始图像信息中提取反射分量和光照分量;对所述反射分量和光照分量进行合成处理,输出中间图像信息。分辨率增强模块720,用于从所述中间图像信息中提取中间图像特征;对所述中间图像特征进行放大处理及分辨率增强处理,得到照度及分辨率增强图像。The low-illuminance enhancement module 710 is configured to extract the reflection component and the illumination component from the initial image information; perform synthesis processing on the reflection component and the illumination component, and output intermediate image information. The resolution enhancement module 720 is used for extracting intermediate image features from the intermediate image information; performing amplification processing and resolution enhancement processing on the intermediate image features to obtain an image with enhanced illumination and resolution.

在一些实施例中,低照度增强模块710包括第一增强单元和第二增强单元,第一增强单元用于从初始图像信息中提取反射分量和光照分量;第二增强单元用于对所述反射分量和光照分量进行合成处理,输出中间图像信息。分辨率增强模块720包括第三增强单元和第四增强单元,第三增强单元用于从所述中间图像信息中提取中间图像特征,并对所述中间图像特征进行放大处理;第四增强单元用于对放大处理后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。In some embodiments, the low-illuminance enhancement module 710 includes a first enhancement unit and a second enhancement unit, the first enhancement unit is used for extracting the reflection component and the illumination component from the initial image information; the second enhancement unit is used for the reflection component The component and the illumination component are synthesized, and the intermediate image information is output. The resolution enhancement module 720 includes a third enhancement unit and a fourth enhancement unit, and the third enhancement unit is used for extracting intermediate image features from the intermediate image information, and performing enlarging processing on the intermediate image features; the fourth enhancement unit uses Performing resolution enhancement processing on the enlarged intermediate image features to obtain illumination and resolution enhancement images.

在一些实施例中,第一增强单元具体为包括多个卷积层的卷积神经网络,第二增强单元具体为包括多个卷积层的卷积神经网络,第三增强单元具体为包括多个卷积层的卷积神经网络和至少一个上采样层,第四增强单元具体为包括多个卷积层的卷积神经网络。In some embodiments, the first enhancement unit is specifically a convolutional neural network including a plurality of convolutional layers, the second enhancement unit is specifically a convolutional neural network including a plurality of convolutional layers, and the third enhancement unit is specifically a convolutional neural network including a plurality of convolutional layers. A convolutional neural network of two convolutional layers and at least one upsampling layer, and the fourth enhancement unit is specifically a convolutional neural network including a plurality of convolutional layers.

在一些实施例中,第一增强单元包括n个卷积层,第一增强单元具体用于:利用所述n个卷积层对所述初始图像信息进行n次卷积处理,其中,第i个卷积层的输出结果为第i+1个卷积层的输入,第n个卷积层的输出结果为4个特征图,i为1,2,……,n-1;将第1至第3个特征图作为所述反射分量,将第4个特征图作为所述光照分量。In some embodiments, the first enhancement unit includes n convolution layers, and the first enhancement unit is specifically configured to: perform n convolution processing on the initial image information by using the n convolution layers, wherein the ith The output result of each convolutional layer is the input of the i+1th convolutional layer, and the output result of the nth convolutional layer is 4 feature maps, i is 1, 2, ..., n-1; The third feature map is used as the reflection component, and the fourth feature map is used as the illumination component.

在一些实施例中,所述装置还包括训练模块,所述训练模块包括数据准备单元,用于获取训练数据集,所述训练数据集包括若干组相对应的输入图像、中间目标图像和目标图像,其中,所述中间目标图像与输入图像的尺寸相同,且所述中间目标图像光照度高于输入图像,以及所述目标图像与中间目标图像的光照度相同,且所述目标图像的尺寸大于中间目标图像;训练单元,用于利用所述训练数据集对所述第一增强单元、所述第二增强单元、所述第三增强单元和所述第四增强单元进行联合训练。In some embodiments, the apparatus further includes a training module, the training module includes a data preparation unit for acquiring a training data set, the training data set including several sets of corresponding input images, intermediate target images and target images , wherein the intermediate target image has the same size as the input image, and the intermediate target image has a higher illuminance than the input image, and the target image and the intermediate target image have the same illuminance, and the target image is larger in size than the intermediate target an image; a training unit for jointly training the first enhancement unit, the second enhancement unit, the third enhancement unit and the fourth enhancement unit by using the training data set.

在一些实施例中,数据准备单元具体用于:获取若干组原始图像,每组所述原始图像包括相对应的低照度图像和正常光照图像;生成与各组原始图像分别对应的训练数据,每组训练数据中的所述输入图像为对应低照度图像缩小k倍的图像,所述中间目标图像为对应正常光照图像缩小k倍后的图像,所述目标图像为对应的所述正常光照图像,k为正数。In some embodiments, the data preparation unit is specifically configured to: acquire several groups of original images, each group of which includes corresponding low-light images and normal-light images; generate training data corresponding to each group of original images, each The input image in the set of training data is an image corresponding to a low-illumination image reduced by k times, the intermediate target image is an image corresponding to a normal illumination image reduced by k times, and the target image is the corresponding normal illumination image, k is a positive number.

在一些实施例中,训练单元具体用于:将每组训练数据的输入图像输入到所述第一卷积神经网络中,将所述图像处理模型中上一个神经网络的输出,输入到相邻的下一个神经网络中;根据预设损失函数计算训练损失,所述训练损失包括,根据所述第一卷积神经网络的输出及从对应中间目标图像提取出的目标反射分量和目标光照分量计算的第一局部损失、根据所述第二卷积神经网络的输出和对应中间目标图像计算的第二局部损失,以及,根据所述第四卷积神经网络的输出和对应目标图像计算的第三局部损失;根据所述训练损失优化所述第一卷积神经网络、所述第二卷积神经网络、所述第三卷积神经网络、所述上采样层及所述第四卷积神经网络的参数,直到满足预设的验证条件。在一些实施例中,训练单元还用于:将所述对应中间目标图像输入到辅助卷积神经网络,以利用所述辅助卷积神经网络从所述第一中间目标图像中提取出目标反射分量和目标光照分量,其中,所述辅助卷积神经网络与所述第一增强单元的结构相同;以及,在根据所述训练损失优化所述第一增强单元的参数时,同步优化所述辅助卷积神经网络的参数,以使所述辅助卷积神经网络与所述第一增强单元的参数相同。In some embodiments, the training unit is specifically configured to: input the input image of each set of training data into the first convolutional neural network, and input the output of the previous neural network in the image processing model to the adjacent in the next neural network of the The first local loss of the local loss; optimizing the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer, and the fourth convolutional neural network according to the training loss parameters until the preset verification conditions are met. In some embodiments, the training unit is further configured to: input the corresponding intermediate target image into an auxiliary convolutional neural network, so as to extract a target reflection component from the first intermediate target image by using the auxiliary convolutional neural network and the target illumination component, wherein the auxiliary convolutional neural network has the same structure as the first enhancement unit; and, when optimizing the parameters of the first enhancement unit according to the training loss, the auxiliary volume is optimized synchronously parameters of the convolutional neural network so that the auxiliary convolutional neural network has the same parameters as the first enhancement unit.

在一些实施例中,所述第一卷积神经网络的输出为从所述输入图像中提取出的输入反射分量和输入光照分量;第一增强单元对应的局部损失包括:第一还原图像相对于对应输入图像的损失,所述第一还原图像根据所述输入反射分量和所述输入光照分量还原得到;第二还原图像相对于对应中间目标图像的损失,所述第二还原图像根据所述目标反射分量和所述目标光照分量还原得到;以及,所述输入反射向量相对于所述目标反射向量的损失。In some embodiments, the output of the first convolutional neural network is the input reflection component and the input illumination component extracted from the input image; the local loss corresponding to the first enhancement unit includes: the first restored image is relatively Corresponding to the loss of the input image, the first restored image is restored according to the input reflection component and the input illumination component; the second restored image is relative to the loss of the corresponding intermediate target image, and the second restored image is obtained according to the target. The reflection component and the target illumination component are restored; and, the loss of the input reflection vector relative to the target reflection vector.

在一些实施例中,按照下式计算所述训练损失:In some embodiments, the training loss is calculated as:

Figure BDA0002986844760000081
Figure BDA0002986844760000081

其中,N为训练数据的组数;Among them, N is the number of groups of training data;

Figure BDA0002986844760000082
表示第i组训练数据在第一增强单元中产生的局部损失;
Figure BDA0002986844760000082
represents the local loss generated by the i-th group of training data in the first enhancement unit;

Figure BDA0002986844760000083
表示第i组训练数据在第二增强单元中产生的局部损失;
Figure BDA0002986844760000083
represents the local loss generated by the i-th group of training data in the second augmentation unit;

Figure BDA0002986844760000084
表示第i组训练数据在第三增强单元和第四增强单元中产生的局部损失;
Figure BDA0002986844760000084
Represents the local loss generated by the i-th group of training data in the third enhancement unit and the fourth enhancement unit;

ω1、ω2、ω3分别为各局部损失对应的权重。ω 1 , ω 2 , and ω 3 are the weights corresponding to each local loss, respectively.

在一些实施例中,所述ω1小于所述ω2和ω3In some embodiments, the ω 1 is smaller than the ω 2 and ω 3 .

具体实现中,本发明还提供一种计算机存储介质,其中,该计算机存储介质可存储有程序,该程序执行时可包括本发明提供的图像处理方法的各实施例中的部分或全部步骤。所述的存储介质可为磁碟、光盘、只读存储记忆体(英文:read-only memory,简称:ROM)或随机存储记忆体(英文:random access memory,简称:RAM)等。In a specific implementation, the present invention also provides a computer storage medium, wherein the computer storage medium can store a program, and when the program is executed, it can include some or all of the steps in each embodiment of the image processing method provided by the present invention. The storage medium may be a magnetic disk, an optical disk, a read-only memory (English: read-only memory, ROM for short) or a random access memory (English: random access memory, RAM for short).

本领域的技术人员可以清楚地了解到本发明实施例中的技术可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明实施例中的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。Those skilled in the art can clearly understand that the technology in the embodiments of the present invention can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be embodied in the form of software products in essence or the parts that make contributions to the prior art, and the computer software products may be stored in a storage medium, such as ROM/RAM , magnetic disk, optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in various embodiments or some parts of the embodiments of the present invention.

本说明书中各个实施例之间相同相似的部分互相参见即可。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例中的说明即可。It is sufficient to refer to each other for the same and similar parts among the various embodiments in this specification. In particular, as for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for related parts, please refer to the descriptions in the method embodiments.

以上所述的本发明实施方式并不构成对本发明保护范围的限定。The embodiments of the present invention described above do not limit the protection scope of the present invention.

Claims (10)

1.一种图像处理方法,其特征在于,用于图像处理模型,所述方法包括:1. an image processing method, is characterized in that, for image processing model, described method comprises: 利用图像处理模型中的第一卷积神经网络从初始图像信息中提取反射分量和光照分量;Using the first convolutional neural network in the image processing model to extract the reflection component and the illumination component from the initial image information; 利用图像处理模型中的第二卷积神经网络对所述反射分量和光照分量进行合成处理,输出中间图像信息;Use the second convolutional neural network in the image processing model to synthesize the reflection component and the illumination component, and output intermediate image information; 利用图像处理模型中的第三卷积神经网络从所述中间图像信息中提取中间图像特征,并利用图像处理模型中的上采样层对所述中间图像特征进行放大处理;Use the third convolutional neural network in the image processing model to extract intermediate image features from the intermediate image information, and use the upsampling layer in the image processing model to amplify the intermediate image features; 利用图像处理模型中的第四卷积神经网络放大后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。The image processing model uses the enlarged intermediate image features of the fourth convolutional neural network to perform resolution enhancement processing to obtain an image with enhanced illumination and resolution. 2.根据权利要求1所述的方法,其特征在于,所述第一卷积神经网络包括n个卷积层,利用第一卷积神经网络从初始图像信息中提取反射分量和光照分量,包括:2. The method according to claim 1, wherein the first convolutional neural network comprises n convolutional layers, and the first convolutional neural network is used to extract the reflection component and the illumination component from the initial image information, including : 利用所述n个卷积层对所述初始图像信息进行n次卷积处理,其中,第i个卷积层的输出结果为第i+1个卷积层的输入,第n个卷积层的输出结果为4个特征图,i为1,2,……,n-1;Use the n convolutional layers to perform n convolution processing on the initial image information, wherein the output of the i-th convolutional layer is the input of the i+1-th convolutional layer, and the n-th convolutional layer The output result is 4 feature maps, i is 1, 2, ..., n-1; 将第1至第3个特征图作为所述反射分量,将第4个特征图作为所述光照分量。The first to third feature maps are used as the reflection component, and the fourth feature map is used as the illumination component. 3.根据权利要求1所述的方法,其特征在于,所述图像处理模型是按照下述步骤训练得到的:3. The method according to claim 1, wherein the image processing model is obtained by training according to the following steps: 获取训练数据集,所述训练数据集包括若干组相对应的输入图像、中间目标图像和目标图像,其中,所述中间目标图像与输入图像的尺寸相同,且所述中间目标图像光照度高于输入图像,以及所述目标图像与中间目标图像的光照度相同,且所述目标图像的尺寸大于中间目标图像;Acquire a training data set, the training data set includes several sets of corresponding input images, intermediate target images and target images, wherein the intermediate target image is the same size as the input image, and the intermediate target image has a higher luminance than the input image image, and the target image and the intermediate target image have the same illuminance, and the size of the target image is larger than the intermediate target image; 利用所述训练数据集对所述图像处理模型中的所述第一卷积神经网络、所述第二卷积神经网络、所述第三卷积神经网络、所述上采样层和所述第四卷积神经网络进行联合训练。The first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer and the third convolutional neural network in the image processing model are analyzed using the training data set. Four convolutional neural networks are jointly trained. 4.根据权利要求3所述的方法,其特征在于,所述获取训练数据集,包括:4. The method according to claim 3, wherein the acquiring a training data set comprises: 获取若干组原始图像,每组所述原始图像包括相对应的低照度图像和正常光照图像;Acquiring several groups of original images, each group of the original images includes corresponding low-light images and normal-light images; 生成与各组原始图像分别对应的训练数据,每组训练数据中的输入图像为对应低照度图像缩小k倍的图像,每组训练数据中的中间目标图像为对应正常光照图像缩小k倍后的图像,每组训练数据中的目标图像为对应的所述正常光照图像,k为正数。Generate training data corresponding to each group of original images. The input image in each group of training data is an image reduced by k times for the corresponding low-light image, and the intermediate target image in each group of training data is the corresponding normal light image. Reduced by k times image, the target image in each set of training data is the corresponding normal illumination image, and k is a positive number. 5.根据权利要求3所述的方法,其特征在于,所述第一卷积神经网络、所述第二卷积神经网络、所述第三卷积神经网络、所述上采样层和所述第四卷积神经网络顺次连接,利用所述训练数据集对所述图像处理模型中的所述第一卷积神经网络、所述第二卷积神经网络、所述第三卷积神经网络、所述上采样层和所述第四卷积神经网络进行联合训练,包括:5. The method of claim 3, wherein the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer and the The fourth convolutional neural network is connected in sequence, and the first convolutional neural network, the second convolutional neural network, and the third convolutional neural network in the image processing model are analyzed by using the training data set. , the upsampling layer and the fourth convolutional neural network are jointly trained, including: 将每组训练数据的输入图像输入到所述第一卷积神经网络中,将所述图像处理模型中上一个神经网络的输出,输入到相邻的下一个神经网络中;The input image of each group of training data is input into the first convolutional neural network, and the output of the previous neural network in the image processing model is input into the adjacent next neural network; 根据预设损失函数计算训练损失,所述训练损失包括,根据所述第一卷积神经网络的输出及从对应中间目标图像提取出的目标反射分量和目标光照分量计算的第一局部损失、根据所述第二卷积神经网络的输出和对应中间目标图像计算的第二局部损失,以及,根据所述第四卷积神经网络的输出和对应目标图像计算的第三局部损失;The training loss is calculated according to the preset loss function, and the training loss includes: the first local loss calculated according to the output of the first convolutional neural network and the target reflection component and the target illumination component extracted from the corresponding intermediate target image; the output of the second convolutional neural network and the second local loss calculated corresponding to the intermediate target image, and the third local loss calculated according to the output of the fourth convolutional neural network and the corresponding target image; 根据所述训练损失优化所述第一卷积神经网络、所述第二卷积神经网络、所述第三卷积神经网络、所述上采样层及所述第四卷积神经网络的参数,直到满足预设的验证条件。Parameters of the first convolutional neural network, the second convolutional neural network, the third convolutional neural network, the upsampling layer and the fourth convolutional neural network are optimized according to the training loss, until the preset verification conditions are met. 6.根据权利要求5所述的方法,其特征在于,在将一组训练数据的输入图像输入到第一卷积神经网络的同时,所述方法还包括:6. The method according to claim 5, characterized in that, while inputting a set of input images of training data into the first convolutional neural network, the method further comprises: 将该组训练数据中的中间目标图像输入到辅助卷积神经网络,以利用所述辅助卷积神经网络从所述中间目标图像中提取出目标反射分量和目标光照分量,其中,所述辅助卷积神经网络与所述第一卷积神经网络的结构相同;The intermediate target image in the set of training data is input to the auxiliary convolutional neural network, so as to extract the target reflection component and the target illumination component from the intermediate target image using the auxiliary convolutional neural network, wherein the auxiliary volume The structure of the convolutional neural network is the same as that of the first convolutional neural network; 以及,在根据所述训练损失优化所述第一卷积神经网络的参数时,同步优化所述辅助卷积神经网络的参数,以使所述辅助卷积神经网络与所述第一卷积神经网络的参数相同。and, when optimizing the parameters of the first convolutional neural network according to the training loss, simultaneously optimizing the parameters of the auxiliary convolutional neural network, so that the auxiliary convolutional neural network and the first convolutional neural network The parameters of the network are the same. 7.根据权利要求5所述的方法,其特征在于,所述第一卷积神经网络的输出为从所述输入图像中提取出的输入反射分量和输入光照分量;根据所述第一卷积神经网络的输出及从对应中间目标图像提取出的目标反射分量和目标光照分量计算第一局部损失,包括:7. The method according to claim 5, wherein the output of the first convolutional neural network is the input reflection component and the input illumination component extracted from the input image; The output of the neural network and the target reflection component and target illumination component extracted from the corresponding intermediate target image calculate the first local loss, including: 根据所述输入反射分量和所述输入光照分量还原得到第一还原图像,并计算所述第一还原图像相对于对应输入图像的损失;Restoring the first restored image according to the input reflection component and the input illumination component, and calculating the loss of the first restored image relative to the corresponding input image; 根据所述所述目标反射分量和所述目标光照分量还原得到第二还原图像,并计算所述第二还原图像相对于对应中间目标图像的损失;Obtain a second restored image according to the target reflection component and the target illumination component, and calculate the loss of the second restored image relative to the corresponding intermediate target image; 以及,计算所述输入反射向量相对于所述目标反射向量的损失。and, calculating the loss of the input reflection vector relative to the target reflection vector. 8.根据权利要求5所述的方法,其特征在于,按照下式计算所述训练损失:8. The method according to claim 5, wherein the training loss is calculated according to the following formula:
Figure FDA0002986844750000021
Figure FDA0002986844750000021
其中,N为训练数据的组数;Among them, N is the number of groups of training data;
Figure FDA0002986844750000022
表示第i组训练数据在第一卷积神经网络中产生的第一局部损失;
Figure FDA0002986844750000022
represents the first local loss generated in the first convolutional neural network by the i-th set of training data;
Figure FDA0002986844750000023
表示第i组训练数据在第二卷积神经网络中产生的第二局部损失;
Figure FDA0002986844750000023
represents the second local loss generated by the i-th group of training data in the second convolutional neural network;
Figure FDA0002986844750000024
表示第i组训练数据在第三卷积神经网络、所述上采样层及所述第四卷积神经网络中产生的第三局部损失;
Figure FDA0002986844750000024
represents the third local loss generated in the third convolutional neural network, the upsampling layer and the fourth convolutional neural network for the i-th group of training data;
ω1、ω2、ω3分别为各局部损失对应的权重。ω 1 , ω 2 , and ω 3 are the weights corresponding to each local loss, respectively.
9.根据权利要求8所述的方法,其特征在于,所述ω1小于所述ω2和ω39. The method of claim 8, wherein the ω 1 is smaller than the ω 2 and ω 3 . 10.一种图像处理装置,其特征在于,所述装置包括:10. An image processing device, wherein the device comprises: 低照度增强模块,用于从初始图像信息中提取反射分量和光照分量;对所述反射分量和光照分量进行合成处理,输出中间图像信息;A low-illuminance enhancement module, used for extracting a reflection component and an illumination component from the initial image information; synthesizing the reflection component and the illumination component, and outputting intermediate image information; 分辨率增强模块,用于从所述中间图像信息中提取中间图像特征;对所述中间图像特征进行放大处理;对放大处理后的中间图像特征进行分辨率增强处理,得到照度及分辨率增强图像。A resolution enhancement module is used for extracting intermediate image features from the intermediate image information; performing amplification processing on the intermediate image features; performing resolution enhancement processing on the enlarged intermediate image features to obtain illumination and resolution enhanced images .
CN202110302555.1A 2021-03-22 2021-03-22 Image processing method and device Pending CN115115527A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110302555.1A CN115115527A (en) 2021-03-22 2021-03-22 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110302555.1A CN115115527A (en) 2021-03-22 2021-03-22 Image processing method and device

Publications (1)

Publication Number Publication Date
CN115115527A true CN115115527A (en) 2022-09-27

Family

ID=83323239

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110302555.1A Pending CN115115527A (en) 2021-03-22 2021-03-22 Image processing method and device

Country Status (1)

Country Link
CN (1) CN115115527A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118429654A (en) * 2024-04-01 2024-08-02 煤炭科学研究总院有限公司 A self-supervised network construction method for feature extraction of complex illumination images

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127684A (en) * 2016-06-22 2016-11-16 中国科学院自动化研究所 Image super-resolution Enhancement Method based on forward-backward recutrnce convolutional neural networks
CN108648160A (en) * 2018-05-14 2018-10-12 中国农业大学 A kind of underwater sea cucumber image defogging Enhancement Method and system
CN108681989A (en) * 2018-03-30 2018-10-19 国信优易数据有限公司 A kind of image data Enhancement Method and device
CN110675336A (en) * 2019-08-29 2020-01-10 苏州千视通视觉科技股份有限公司 Low-illumination image enhancement method and device
CN111079764A (en) * 2019-12-06 2020-04-28 深圳久凌软件技术有限公司 Low-illumination license plate image recognition method and device based on deep learning
WO2020173320A1 (en) * 2019-02-28 2020-09-03 腾讯科技(深圳)有限公司 Image enhancement method and apparatus, and storage medium
CN111784582A (en) * 2020-07-08 2020-10-16 桂林电子科技大学 A low-light image super-resolution reconstruction method based on DEC_SE
CN111915526A (en) * 2020-08-05 2020-11-10 湖北工业大学 Photographing method based on brightness attention mechanism low-illumination image enhancement algorithm

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106127684A (en) * 2016-06-22 2016-11-16 中国科学院自动化研究所 Image super-resolution Enhancement Method based on forward-backward recutrnce convolutional neural networks
CN108681989A (en) * 2018-03-30 2018-10-19 国信优易数据有限公司 A kind of image data Enhancement Method and device
CN108648160A (en) * 2018-05-14 2018-10-12 中国农业大学 A kind of underwater sea cucumber image defogging Enhancement Method and system
WO2020173320A1 (en) * 2019-02-28 2020-09-03 腾讯科技(深圳)有限公司 Image enhancement method and apparatus, and storage medium
CN110675336A (en) * 2019-08-29 2020-01-10 苏州千视通视觉科技股份有限公司 Low-illumination image enhancement method and device
CN111079764A (en) * 2019-12-06 2020-04-28 深圳久凌软件技术有限公司 Low-illumination license plate image recognition method and device based on deep learning
CN111784582A (en) * 2020-07-08 2020-10-16 桂林电子科技大学 A low-light image super-resolution reconstruction method based on DEC_SE
CN111915526A (en) * 2020-08-05 2020-11-10 湖北工业大学 Photographing method based on brightness attention mechanism low-illumination image enhancement algorithm

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
方路平;翁佩强;周国民;: "基于深度学习的低光彩码图像增强", 浙江工业大学学报, no. 04, 21 July 2020 (2020-07-21) *
黄鐄;陶海军;王海峰;: "条件生成对抗网络的低照度图像增强方法", 中国图象图形学报, no. 12, 16 December 2019 (2019-12-16) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118429654A (en) * 2024-04-01 2024-08-02 煤炭科学研究总院有限公司 A self-supervised network construction method for feature extraction of complex illumination images
CN118429654B (en) * 2024-04-01 2025-04-04 煤炭科学研究总院有限公司 A self-supervised network construction method for feature extraction of complex illumination images

Similar Documents

Publication Publication Date Title
CN112288658B (en) Underwater image enhancement method based on multi-residual joint learning
US11610082B2 (en) Method and apparatus for training neural network model used for image processing, and storage medium
CN113454680B (en) Image Processor
CN105120130B (en) A kind of image raising frequency system, its training method and image raising frequency method
CN108376387B (en) Image deblurring method based on aggregation expansion convolution network
US10861133B1 (en) Super-resolution video reconstruction method, device, apparatus and computer-readable storage medium
CN109712165B (en) A Convolutional Neural Network Based Segmentation Method for Similar Foreground Image Sets
CN112801904B (en) Hybrid degraded image enhancement method based on convolutional neural network
US11900567B2 (en) Image processing method and apparatus, computer device, and storage medium
US11216910B2 (en) Image processing system, image processing method and display device
CN109711401B (en) Text detection method in natural scene image based on Faster Rcnn
CN113781308A (en) Image super-resolution reconstruction method, device, storage medium and electronic device
CN107122826A (en) Processing method and system and storage medium for convolutional neural networks
CN112102177A (en) Image deblurring method based on compression and excitation mechanism neural network
KR20210036715A (en) Neural processing apparatus and method for processing pooling of neural network thereof
CN108765291A (en) Super resolution ratio reconstruction method based on dense neural network and two-parameter loss function
CN110163803A (en) A kind of image super-resolution rebuilding method and system based on convolutional neural networks
CN113129240B (en) Motion blur removing method for industrial packaging characters
CN111986092A (en) Image super-resolution reconstruction method and system based on dual networks
CN111724312A (en) Method and terminal for processing image
KR102797187B1 (en) Demosaicing method and demosaicing device based on deep learning
CN114565511A (en) Lightweight image registration method, system and device based on global homography estimation
CN115170392A (en) Single-image super-resolution algorithm based on attention mechanism
CN115115527A (en) Image processing method and device
CN106296614B (en) Image processing apparatus and image processing method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination