CN118037580A - Image denoising method, system, storage medium and electronic device - Google Patents
Image denoising method, system, storage medium and electronic device Download PDFInfo
- Publication number
- CN118037580A CN118037580A CN202410239261.2A CN202410239261A CN118037580A CN 118037580 A CN118037580 A CN 118037580A CN 202410239261 A CN202410239261 A CN 202410239261A CN 118037580 A CN118037580 A CN 118037580A
- Authority
- CN
- China
- Prior art keywords
- image
- data set
- layer data
- denoising
- image denoising
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/0464—Convolutional networks [CNN, ConvNet]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02T—CLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
- Y02T10/00—Road transport of goods or passengers
- Y02T10/10—Internal combustion engine [ICE] based vehicles
- Y02T10/40—Engine management systems
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
Description
技术领域Technical Field
本发明涉及图像处理技术领域,特别涉及一种图像去噪方法、系统、存储介质及电子设备。The present invention relates to the field of image processing technology, and in particular to an image denoising method, system, storage medium and electronic equipment.
背景技术Background technique
噪声是普遍存在的,尤其是在与我们日常生活密切相关的图像中,如医学图像、水下图像、传感图像、合成孔径雷达图像和红外图像。图像噪声是指图像数据中存在的不必要或冗余的干扰信息,对图像质量有很大的负面影响,并阻碍信息的传输。因此,消除噪声对计算机和人类都至关重要。去噪的目的就是从噪声图像中分离出噪声,从而获得干净的图像。Noise is ubiquitous, especially in images that are closely related to our daily lives, such as medical images, underwater images, sensor images, synthetic aperture radar images, and infrared images. Image noise refers to unnecessary or redundant interference information in image data, which has a great negative impact on image quality and hinders the transmission of information. Therefore, eliminating noise is crucial for both computers and humans. The purpose of denoising is to separate noise from noisy images to obtain a clean image.
长期以来,恢复噪声图像一直是研究的重点。随着AlexNet在2012年的ImageNet竞赛中获胜,人们发现了深度学习的潜力,这让去噪这一枯竭的领域重新焕发生机。Zhang等人提出了一种去噪卷积神经网络(DnCNN),它使用卷积层、批量归一化层(BN)、整流线性单元层(ReLU)和残差学习的堆叠,既简单又取得了一定的效果。FFDNet将噪声地平线图作为网络输入的一部分,将高斯噪声泛化为更复杂的真实噪声。CBDNet主要关注FFDNet中的噪声地平线图部分,通过5层全卷积网络(FCN)自适应地获取噪声地平线图,从而实现一定程度的盲去噪。DANet提出了一种双注意网络,可以自适应地继承局部特征和全局依赖关系。NBNet利用子空间投影重构高维特征图,抑制了噪声的产生,实现了传统子空间方法与CNN的结合。NHNet是一种非局部分层网络,具有双路径结构,即初始分辨率路径和高分辨率路径,两条路径之间有额外的交叉连接和通道注意层,在上采样过程中采用了非局部机制。KBNet提出了一种可学习的基于内核的注意力模块(KBA),该模块对空间信息进行建模,还设计了一个多轴特征融合(MFF)模块用于图像复原。Restoring noisy images has long been a research focus. With AlexNet's victory in the ImageNet competition in 2012, people discovered the potential of deep learning, which revitalized the exhausted field of denoising. Zhang et al. proposed a denoising convolutional neural network (DnCNN), which uses a stack of convolutional layers, batch normalization layers (BN), rectified linear unit layers (ReLU), and residual learning, which is simple and has achieved certain results. FFDNet uses the noise horizon map as part of the network input to generalize Gaussian noise to more complex real noise. CBDNet focuses on the noise horizon map part in FFDNet, and adaptively obtains the noise horizon map through a 5-layer fully convolutional network (FCN), thereby achieving a certain degree of blind denoising. DANet proposed a dual attention network that can adaptively inherit local features and global dependencies. NBNet uses subspace projection to reconstruct high-dimensional feature maps, suppresses the generation of noise, and realizes the combination of traditional subspace methods and CNN. NHNet is a non-local hierarchical network with a dual-path structure, namely the initial resolution path and the high-resolution path, with additional cross-connections and channel attention layers between the two paths, and a non-local mechanism is adopted in the upsampling process. KBNet proposes a learnable kernel-based attention module (KBA) that models spatial information and also designs a multi-axis feature fusion (MFF) module for image restoration.
近年来,深度学习已成为一个热门研究领域。卷积神经网络(CNN)在机器人、自动驾驶系统、图像识别、面部表情分析、手写数字识别、自然语言处理等各种应用中都表现出了卓越的性能。此外,CNN并不局限于一般的图像去噪,它在盲去噪和真实噪声图像中也取得了很好的效果。In recent years, deep learning has become a hot research field. Convolutional neural networks (CNNs) have shown excellent performance in various applications such as robotics, autonomous driving systems, image recognition, facial expression analysis, handwritten digit recognition, natural language processing, etc. In addition, CNN is not limited to general image denoising, it has also achieved good results in blind denoising and real noisy images.
现有技术也存在各种缺点,比如有些方法模型太大、网络复杂、参数过多。有些方法去噪效果不佳,细节恢复不足。有些方法严重依赖卷积层,需要大量训练数据,导致训练时间过长以及去噪过程缓慢等问题。但事实上去噪是一项低级的图像任务,不需要如此复杂的网络和庞大的参数。因此,有必要设计一种简单高效的去噪网络,尽量以低成本获得高回报。Existing technologies also have various shortcomings. For example, some methods have too large models, complex networks, and too many parameters. Some methods have poor denoising effects and insufficient detail recovery. Some methods rely heavily on convolutional layers and require a large amount of training data, resulting in long training times and slow denoising processes. But in fact, denoising is a low-level image task that does not require such a complex network and huge parameters. Therefore, it is necessary to design a simple and efficient denoising network to achieve high returns at low cost.
发明内容Summary of the invention
针对现有技术的不足,本发明的目的在于提供一种图像去噪方法,旨在解决现有技术中去噪方法模型太大、参数太多、训练时间过长以及去噪过程缓慢等问题的技术问题。In view of the shortcomings of the prior art, the purpose of the present invention is to provide an image denoising method, aiming to solve the technical problems of the prior art denoising method such as too large model, too many parameters, too long training time and slow denoising process.
为了实现上述目的,本发明是通过如下技术方案来实现的:In order to achieve the above object, the present invention is implemented by the following technical solutions:
一种图像去噪方法,包括如下步骤:An image denoising method comprises the following steps:
S10,获取待处理图像,利用导向滤波得到所述待处理图像的基础层数据集和细节层数据集,其中所述基础层数据集和所述细节层数据集均包括若干个原始图像对,每个所述原始图像对均包括一对原始图像和噪声图像;S10, acquiring an image to be processed, and obtaining a base layer data set and a detail layer data set of the image to be processed by using guided filtering, wherein the base layer data set and the detail layer data set each include a plurality of original image pairs, and each of the original image pairs includes a pair of an original image and a noise image;
S20,基于四元数卷积神经网络,构建图像去噪模型,其中所述四元数卷积神经网络包括第一子网络和第二子网络,所述第一子网络用于处理所述基础层数据集,所述第二子网络用于处理所述细节层数据集;S20, constructing an image denoising model based on a quaternion convolutional neural network, wherein the quaternion convolutional neural network includes a first subnetwork and a second subnetwork, the first subnetwork is used to process the base layer data set, and the second subnetwork is used to process the detail layer data set;
S30,对所述基础层数据集和所述细节层数据集中的所有图像进行张量转换和标准化处理,以得到预处理后的图像;S30, performing tensor conversion and standardization processing on all images in the base layer data set and the detail layer data set to obtain preprocessed images;
S40,设置损失函数和优化算法,将所述预处理后的图像输入所述图像去噪模型,以对所述图像去噪模型进行训练,进而得到图像去噪优化模型;S40, setting a loss function and an optimization algorithm, inputting the preprocessed image into the image denoising model to train the image denoising model, and then obtaining an image denoising optimization model;
所述步骤S40包括:The step S40 comprises:
计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差;Calculating the error between an output image processed by the image denoising model and an initial image corresponding to the output image;
根据所述误差的大小调节所述损失函数和所述优化算法中的参数,以优化所述图像去噪模型,进而得到图像去噪优化模型。The loss function and the parameters in the optimization algorithm are adjusted according to the size of the error to optimize the image denoising model, thereby obtaining an image denoising optimization model.
进一步的,所述步骤S10的具体步骤包括:Furthermore, the specific steps of step S10 include:
对待处理图像进行裁剪以得到若干个斑块,其中裁剪分为两轮,两轮裁剪在所述待处理图像上的作用位置相同,进行第一轮裁剪时的斑块加入高斯噪声,以获得噪声图像,进行第二轮裁剪时的斑块保持原样,以获得原始图像;The image to be processed is cropped to obtain a plurality of patches, wherein the cropping is divided into two rounds, and the two rounds of cropping have the same effect on the image to be processed, Gaussian noise is added to the patches in the first round of cropping to obtain a noise image, and the patches in the second round of cropping remain the same to obtain an original image;
利用导向滤波得到所述斑块的基础层和细节层;Using guided filtering to obtain a base layer and a detail layer of the patch;
将所有所述斑块的基础层整合为基础层数据集,将所有所述斑块的细节层整合为细节层数据集。The base layers of all the patches are integrated into a base layer data set, and the detail layers of all the patches are integrated into a detail layer data set.
进一步的,在所述步骤S20中,所述第一子网络和所述第二子网络的深度均有若干层,且所述第一子网络和所述第二子网络的第一层和最后一层均采用普通实值卷积、中间层均采用四元数卷积。Furthermore, in step S20, the depth of the first subnetwork and the second subnetwork both have several layers, and the first layer and the last layer of the first subnetwork and the second subnetwork both use ordinary real-valued convolution, and the intermediate layers both use quaternion convolution.
进一步的,在所述步骤S40中,所述损失函数采用均方误差和结构相似度作为组合损失函数,所述优化算法采用AdamW算法,且在对所述图像去噪模型训练过程中,采用余弦退火算法调节学习率;Furthermore, in the step S40, the loss function uses mean square error and structural similarity as a combined loss function, the optimization algorithm uses the AdamW algorithm, and in the process of training the image denoising model, the cosine annealing algorithm is used to adjust the learning rate;
所述均方误差损失函数为:The mean square error loss function is:
其中,yi表示所述原始图像的值,表示所述噪声图像的值,n表示所述原始图像对的数量;Wherein, yi represents the value of the original image, represents the value of the noise image, and n represents the number of the original image pairs;
所述结构相似度损失函数为:The structural similarity loss function is:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数。Where μx is the mean of x , μy is the mean of y, σx2 is the variance of x, σy2 is the variance of y, σxy is the covariance of x and y, and c1 and c2 are constants.
进一步的,在所述计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差的步骤之前还包括:Furthermore, before the step of calculating the error between the output image processed by the image denoising model and the initial image corresponding to the output image, the method further includes:
通过所述四元数卷积神经网络提取所述预处理后的图像的特征并进行前向传播。The features of the preprocessed image are extracted through the quaternion convolutional neural network and forward propagated.
进一步的,在所述计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差的步骤之后还包括:Furthermore, after the step of calculating the error between the output image processed by the image denoising model and the initial image corresponding to the output image, the step further includes:
根据所述误差确定所述损失函数的值,并根据所述损失函数的值判断所述四元数卷积神经网络是否收敛,若未收敛,则判定为需要继续训练所述图像去噪模型。The value of the loss function is determined according to the error, and whether the quaternion convolutional neural network has converged is judged according to the value of the loss function. If not, it is determined that it is necessary to continue training the image denoising model.
进一步的,在所述根据所述误差的大小调节所述损失函数和所述优化算法中的参数,以优化所述图像去噪模型的步骤之后还包括:Furthermore, after the step of adjusting the loss function and the parameters in the optimization algorithm according to the size of the error to optimize the image denoising model, the method further includes:
根据经所述图像去噪模型处理后的去噪图像、及所述去噪图像对应的最初图像,对训练后的所述图像去噪优化模型进行测试评估;Testing and evaluating the trained image denoising optimization model according to the denoised image processed by the image denoising model and the original image corresponding to the denoised image;
其中所述测试评估的指标包括:The test evaluation indicators include:
峰值信噪比:用于衡量所述去噪图像和所述最初图像间的差异,公式如下:Peak signal-to-noise ratio: used to measure the difference between the denoised image and the original image, the formula is as follows:
其中,(2n-1)2表示图像像素点的最大值;MSE表示所述最初图像和所述去噪图像之间的均方误差,n表示所述原始图像对的数量;Wherein, (2 n -1) 2 represents the maximum value of the image pixels; MSE represents the mean square error between the original image and the denoised image; and n represents the number of the original image pairs;
结构相似度:用于度量所述去噪图像和所述最初图像间的相似性,公式如下:Structural similarity: used to measure the similarity between the denoised image and the original image, the formula is as follows:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数;Where μ x is the mean of x, μ y is the mean of y, σ x 2 is the variance of x, σ y 2 is the variance of y, σ xy is the covariance of x and y, and c 1 and c 2 are constants;
可学习感知图像块相似度,用于计算所述去噪图像和所述最初图像的特征差异,公式如下:The learnable perceived image block similarity is used to calculate the feature difference between the denoised image and the original image, and the formula is as follows:
其中,d是x0和x之间的距离,分别代表真实值和预测值,H,W分别为所述去噪图像和所述最初图像的高和宽,l表示所述四元数卷积神经网络层数,wl表示所述四元数卷积神经网络第l层的权重。where d is the distance between x0 and x, Represent the true value and the predicted value respectively, H, W are the height and width of the denoised image and the original image respectively, l represents the number of layers of the quaternion convolutional neural network, and w l represents the weight of the lth layer of the quaternion convolutional neural network.
本发明还提供一种图像去噪系统,包括:The present invention also provides an image denoising system, comprising:
获取模块:用于获取待处理图像,利用导向滤波得到所述待处理图像的基础层数据集和细节层数据集,其中所述基础层数据集和所述细节层数据集均包括若干个原始图像对,每个所述原始图像对均包括一对原始图像和噪声图像;An acquisition module is used to acquire an image to be processed, and obtain a base layer data set and a detail layer data set of the image to be processed by using guided filtering, wherein the base layer data set and the detail layer data set each include a plurality of original image pairs, and each of the original image pairs includes a pair of an original image and a noise image;
所述获取模块具体用于:The acquisition module is specifically used for:
对待处理图像进行裁剪以得到若干个斑块,其中裁剪分为两轮,两轮裁剪在所述待处理图像上的作用位置相同,进行第一轮裁剪时的斑块加入高斯噪声,以获得噪声图像,进行第二轮裁剪时的斑块保持原样,以获得原始图像;The image to be processed is cropped to obtain a plurality of patches, wherein the cropping is divided into two rounds, and the two rounds of cropping have the same effect on the image to be processed, Gaussian noise is added to the patches in the first round of cropping to obtain a noise image, and the patches in the second round of cropping remain the same to obtain an original image;
利用导向滤波得到所述斑块的基础层和细节层;Using guided filtering to obtain a base layer and a detail layer of the patch;
将所有所述斑块的基础层整合为基础层数据集,将所有所述斑块的细节层整合为细节层数据集。The base layers of all the patches are integrated into a base layer dataset, and the detail layers of all the patches are integrated into a detail layer dataset.
构建模块:用于基于四元数卷积神经网络,构建图像去噪模型,其中所述四元数卷积神经网络包括第一子网络和第二子网络,所述第一子网络用于处理所述基础层数据集,所述第二子网络用于处理所述细节层数据集;A construction module: used to construct an image denoising model based on a quaternion convolutional neural network, wherein the quaternion convolutional neural network includes a first subnetwork and a second subnetwork, the first subnetwork is used to process the base layer data set, and the second subnetwork is used to process the detail layer data set;
在所述构建模块中,所述第一子网络和所述第二子网络的深度均有若干层,且所述第一子网络和所述第二子网络的第一层和最后一层均采用普通实值卷积、中间层均采用四元数卷积;In the construction module, the depth of the first sub-network and the second sub-network are both several layers, and the first layer and the last layer of the first sub-network and the second sub-network both use ordinary real-valued convolution, and the intermediate layers both use quaternion convolution;
预处理模块:用于对所述基础层数据集和所述细节层数据集中的所有图像进行张量转换和标准化处理,以得到预处理后的图像;Preprocessing module: used for performing tensor conversion and standardization processing on all images in the base layer data set and the detail layer data set to obtain preprocessed images;
训练模块:用于设置损失函数和优化算法,将所述预处理后的图像输入所述图像去噪模型,以对所述图像去噪模型进行训练,进而得到图像去噪优化模型;Training module: used to set the loss function and optimization algorithm, input the preprocessed image into the image denoising model to train the image denoising model, and then obtain the image denoising optimization model;
所述训练模块包括:The training module includes:
传播单元:用于通过所述四元数卷积神经网络提取所述预处理后的图像的特征并进行前向传播;Propagation unit: used for extracting the features of the preprocessed image through the quaternion convolutional neural network and performing forward propagation;
计算单元:用于计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差;A calculation unit: used for calculating the error between the output image processed by the image denoising model and the initial image corresponding to the output image;
判断单元:用于根据所述误差确定所述损失函数的值,并根据所述损失函数的值判断所述四元数卷积神经网络是否收敛,若未收敛,则判定为需要继续训练所述图像去噪模型;A judgment unit: used to determine the value of the loss function according to the error, and judge whether the quaternion convolutional neural network has converged according to the value of the loss function, and if not, it is determined that it is necessary to continue training the image denoising model;
优化单元:用于根据所述误差的大小调节所述损失函数和所述优化算法中的参数,以优化所述图像去噪模型,进而得到图像去噪优化模型;Optimization unit: used for adjusting the loss function and the parameters in the optimization algorithm according to the size of the error, so as to optimize the image denoising model, and then obtain the image denoising optimization model;
在所述训练模块中,所述损失函数采用均方误差和结构相似度作为组合损失函数,所述优化算法采用AdamW算法,且在对所述图像去噪模型训练过程中,采用余弦退火算法调节学习率;In the training module, the loss function uses mean square error and structural similarity as a combined loss function, the optimization algorithm uses the AdamW algorithm, and in the process of training the image denoising model, the cosine annealing algorithm is used to adjust the learning rate;
所述均方误差损失函数为:The mean square error loss function is:
其中,yi表示所述原始图像的值,表示所述噪声图像的值,n表示所述原始图像对的数量;Wherein, yi represents the value of the original image, represents the value of the noise image, and n represents the number of the original image pairs;
所述结构相似度损失函数为:The structural similarity loss function is:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数;Where μ x is the mean of x, μ y is the mean of y, σ x 2 is the variance of x, σ y 2 is the variance of y, σ xy is the covariance of x and y, and c 1 and c 2 are constants;
评估模块:用于根据经所述图像去噪模型处理后的去噪图像、及所述去噪图像对应的最初图像,对训练后的所述图像去噪优化模型进行测试评估;Evaluation module: used for testing and evaluating the trained image denoising optimization model according to the denoised image processed by the image denoising model and the original image corresponding to the denoised image;
其中所述测试评估的指标包括:The test evaluation indicators include:
峰值信噪比:用于衡量所述去噪图像和所述最初图像间的差异,公式如下:Peak signal-to-noise ratio: used to measure the difference between the denoised image and the original image, the formula is as follows:
其中,(2n-1)2表示图像像素点的最大值;MSE表示所述最初图像和所述去噪图像之间的均方误差,n表示所述原始图像对的数量;Wherein, (2 n -1) 2 represents the maximum value of the image pixels; MSE represents the mean square error between the original image and the denoised image; and n represents the number of the original image pairs;
结构相似度:用于度量所述去噪图像和所述最初图像间的相似性,公式如下:Structural similarity: used to measure the similarity between the denoised image and the original image, the formula is as follows:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数;Where μ x is the mean of x, μ y is the mean of y, σ x 2 is the variance of x, σ y 2 is the variance of y, σ xy is the covariance of x and y, and c 1 and c 2 are constants;
可学习感知图像块相似度,用于计算所述去噪图像和所述最初图像的特征差异,公式如下:The learnable perceived image block similarity is used to calculate the feature difference between the denoised image and the original image, and the formula is as follows:
其中,d是x0和x之间的距离,分别代表真实值和预测值,H,W分别为所述去噪图像和所述最初图像的高和宽,l表示所述四元数卷积神经网络层数,wl表示所述四元数卷积神经网络第l层的权重。where d is the distance between x0 and x, Represent the true value and the predicted value respectively, H, W are the height and width of the denoised image and the original image respectively, l represents the number of layers of the quaternion convolutional neural network, and w l represents the weight of the lth layer of the quaternion convolutional neural network.
本发明还提供一种存储介质,其上存储有计算机程序,其特征在于,该计算机程序被处理器执行时实现如上所述的图像去噪方法。The present invention also provides a storage medium on which a computer program is stored, wherein the computer program implements the image denoising method as described above when executed by a processor.
本发明还提供一种电子设备,包括存储器、处理器以及存储在所述存储器上并可在所述处理器上运行的计算机程序,其特征在于,所述处理器执行所述计算机程序时实现如上所述的图像去噪方法。The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the image denoising method as described above when executing the computer program.
与现有技术相比,本发明的有益效果在于:Compared with the prior art, the present invention has the following beneficial effects:
1)本发明提供一个轻量级彩色图像去噪网络,网络结构简单,参数较少,训练时间短,去噪过程快,所需的训练数据也较少;1) The present invention provides a lightweight color image denoising network with a simple network structure, fewer parameters, short training time, fast denoising process, and less required training data;
2)采用四元卷积神经网络作为图像去噪模型的骨干,能并行处理四个通道,进而融合各通道的信息,同时也减少了网络中的参数数量,在不牺牲特征信息的情况下节省了计算时间,此外,还引入了导向滤波技术,导向滤波可以获得图像更稀疏的表示,有利于网络的训练和收敛;2) The quaternary convolutional neural network is used as the backbone of the image denoising model, which can process four channels in parallel and then fuse the information of each channel. It also reduces the number of parameters in the network and saves computing time without sacrificing feature information. In addition, the guided filtering technology is introduced. The guided filtering can obtain a sparser representation of the image, which is conducive to the training and convergence of the network.
3)本发明在去除彩色图像的高斯噪声方面表现出了先进的性能,与其他现有的图像去噪模型相比,本发明设计简单,但却能以极低的成本在评估指标和图像复原细节方面取得优异的结果。3) The present invention demonstrates advanced performance in removing Gaussian noise from color images. Compared with other existing image denoising models, the present invention is simple in design but can achieve excellent results in evaluation indicators and image restoration details at a very low cost.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明第一实施例中图像去噪方法的流程图;FIG1 is a flow chart of an image denoising method according to a first embodiment of the present invention;
图2为本发明中的神经网络训练总体流程图;FIG2 is a general flow chart of neural network training in the present invention;
图3为本发明中的神经网络结构设计图;FIG3 is a design diagram of a neural network structure in the present invention;
图4为本发明第二实施例中图像去噪系统的结构框图;FIG4 is a structural block diagram of an image denoising system in a second embodiment of the present invention;
图5为本发明第三实施例中计算机设备的结构框图;5 is a block diagram of a computer device in a third embodiment of the present invention;
如下具体实施方式将结合上述附图进一步说明本发明。The following specific implementation manner will further illustrate the present invention in conjunction with the above-mentioned drawings.
具体实施方式Detailed ways
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的若干实施例。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施例。相反地,提供这些实施例的目的是使对本发明的公开内容更加透彻全面。In order to facilitate understanding of the present invention, the present invention will be described more fully below with reference to the relevant drawings. Several embodiments of the present invention are given in the drawings. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
需要说明的是,当元件被称为“固设于”另一个元件,它可以直接在另一个元件上或者也可以存在居中的元件。当一个元件被认为是“连接”另一个元件,它可以是直接连接到另一个元件或者可能同时存在居中元件。本文所使用的术语“垂直的”、“水平的”、“左”、“右”以及类似的表述只是为了说明的目的。It should be noted that when an element is referred to as being "fixed to" another element, it may be directly on the other element or there may be a central element. When an element is considered to be "connected to" another element, it may be directly connected to the other element or there may be a central element at the same time. The terms "vertical", "horizontal", "left", "right" and similar expressions used herein are for illustrative purposes only.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。本文所使用的术语“及/或”包括一个或多个相关的所列项目的任意的和所有的组合。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art of the present invention. The terms used herein in the specification of the present invention are only for the purpose of describing specific embodiments and are not intended to limit the present invention. The term "and/or" used herein includes any and all combinations of one or more related listed items.
请参阅图1至图2,所示为本发明第一实施例中的一种图像去噪方法,包括如下步骤:Please refer to FIG. 1 and FIG. 2 , which show an image denoising method in a first embodiment of the present invention, comprising the following steps:
S10,获取待处理图像,利用导向滤波得到所述待处理图像的基础层数据集和细节层数据集,其中所述基础层数据集和所述细节层数据集均包括若干个原始图像对,每个所述原始图像对均包括一对原始图像和噪声图像;S10, acquiring an image to be processed, and obtaining a base layer data set and a detail layer data set of the image to be processed by using guided filtering, wherein the base layer data set and the detail layer data set each include a plurality of original image pairs, and each of the original image pairs includes a pair of an original image and a noise image;
S20,基于四元数卷积神经网络,构建图像去噪模型,其中所述四元数卷积神经网络包括第一子网络和第二子网络,所述第一子网络用于处理所述基础层数据集,所述第二子网络用于处理所述细节层数据集;S20, constructing an image denoising model based on a quaternion convolutional neural network, wherein the quaternion convolutional neural network includes a first subnetwork and a second subnetwork, the first subnetwork is used to process the base layer data set, and the second subnetwork is used to process the detail layer data set;
S30,对所述基础层数据集和所述细节层数据集中的所有图像进行张量转换和标准化处理,以得到预处理后的图像;S30, performing tensor conversion and standardization processing on all images in the base layer data set and the detail layer data set to obtain preprocessed images;
S40,设置损失函数和优化算法,将所述预处理后的图像输入所述图像去噪模型,以对所述图像去噪模型进行训练,进而得到图像去噪优化模型;S40, setting a loss function and an optimization algorithm, inputting the preprocessed image into the image denoising model to train the image denoising model, and then obtaining an image denoising optimization model;
所述步骤S40包括:The step S40 comprises:
计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差;Calculating the error between an output image processed by the image denoising model and an initial image corresponding to the output image;
根据所述误差的大小调节所述损失函数和所述优化算法中的参数,以优化所述图像去噪模型,进而得到图像去噪优化模型。The loss function and the parameters in the optimization algorithm are adjusted according to the size of the error to optimize the image denoising model, thereby obtaining an image denoising optimization model.
可以理解的,本发明提供一个轻量级彩色图像去噪网络,网络结构简单,参数较少,训练时间短,去噪过程快,所需的训练数据也较少;It can be understood that the present invention provides a lightweight color image denoising network with a simple network structure, fewer parameters, short training time, fast denoising process, and less required training data;
采用四元卷积神经网络作为图像去噪模型的骨干,能并行处理四个通道,进而融合各通道的信息,同时也减少了网络中的参数数量,在不牺牲特征信息的情况下节省了计算时间,此外,还引入了导向滤波技术,导向滤波可以获得图像更稀疏的表示,有利于网络的训练和收敛;The quaternary convolutional neural network is used as the backbone of the image denoising model, which can process four channels in parallel and then fuse the information of each channel. It also reduces the number of parameters in the network and saves computing time without sacrificing feature information. In addition, the guided filtering technology is introduced. The guided filtering can obtain a sparser representation of the image, which is conducive to the training and convergence of the network.
本发明在去除彩色图像的高斯噪声方面表现出了先进的性能,与其他现有的图像去噪模型相比,本发明设计简单,但却能以极低的成本在评估指标和图像复原细节方面取得优异的结果。The present invention demonstrates advanced performance in removing Gaussian noise from color images. Compared with other existing image denoising models, the present invention is simple in design but can achieve excellent results in evaluation indicators and image restoration details at a very low cost.
具体的,所述步骤S10的具体步骤包括:Specifically, the specific steps of step S10 include:
对待处理图像进行裁剪以得到若干个斑块,其中裁剪分为两轮,两轮裁剪在所述待处理图像上的作用位置相同,进行第一轮裁剪时的斑块加入高斯噪声,以获得噪声图像,进行第二轮裁剪时的斑块保持原样,以获得原始图像;The image to be processed is cropped to obtain a plurality of patches, wherein the cropping is divided into two rounds, and the two rounds of cropping have the same effect on the image to be processed, Gaussian noise is added to the patches in the first round of cropping to obtain a noise image, and the patches in the second round of cropping remain the same to obtain an original image;
利用导向滤波得到所述斑块的基础层和细节层;Using guided filtering to obtain a base layer and a detail layer of the patch;
将所有所述斑块的基础层整合为基础层数据集,将所有所述斑块的细节层整合为细节层数据集。The base layers of all the patches are integrated into a base layer dataset, and the detail layers of all the patches are integrated into a detail layer dataset.
可以理解的,本发明中用到的是BSD-100数据集,BSD-100是伯克利分割数据集(BSD-300)的测试集,常用于图像去噪和超分辨率重建任务,它由100张不同的彩色图像组成,有480×320和320×480两种大小,包括动物、人类、建筑、食物等,从中选择了80幅图像作为训练图像,另外20幅图像作为测试图像。从每幅图像中随机裁剪64×64的斑块两次,两次裁剪的位置相同,同时,利用导向滤波得到斑块的基础层和细节层,第一次裁剪加入了高斯噪声,为噪声图像,第二次裁剪作为标签处理,为原始图像,噪声的平均值为0,标准偏差为[10、20、30、40],共四个噪声等级;It can be understood that the BSD-100 dataset is used in the present invention. BSD-100 is the test set of the Berkeley Segmentation Dataset (BSD-300), which is commonly used for image denoising and super-resolution reconstruction tasks. It consists of 100 different color images with two sizes of 480×320 and 320×480, including animals, humans, buildings, food, etc. 80 images are selected as training images and the other 20 images are selected as test images. A 64×64 patch is randomly cropped twice from each image, and the positions of the two crops are the same. At the same time, the base layer and detail layer of the patch are obtained by guided filtering. Gaussian noise is added to the first crop, which is a noise image. The second crop is processed as a label, which is the original image. The mean value of the noise is 0, and the standard deviation is [10, 20, 30, 40], with a total of four noise levels;
示例性的,本实施例中,每幅图像中随机裁剪10次,共得到1000对斑块。其中800对斑块作为训练集,剩下200对为测试集,所以最后得到基础层数据集和细节层数据集,所述基础层数据集和所述细节层数据集又对应四个噪声等级。Exemplarily, in this embodiment, each image is randomly cropped 10 times, and a total of 1000 pairs of patches are obtained, of which 800 pairs of patches are used as training sets, and the remaining 200 pairs are used as test sets, so finally a base layer data set and a detail layer data set are obtained, and the base layer data set and the detail layer data set correspond to four noise levels.
进一步的,在所述步骤S20中,所述第一子网络和所述第二子网络的深度均有若干层,且所述第一子网络和所述第二子网络的第一层和最后一层均采用普通实值卷积、中间层均采用四元数卷积。Furthermore, in step S20, the depth of the first subnetwork and the second subnetwork both have several layers, and the first layer and the last layer of the first subnetwork and the second subnetwork both use ordinary real-valued convolution, and the intermediate layers both use quaternion convolution.
示例性的,本实施例中,所述第一子网络和所述第二子网络均使用简单的卷积层和激活函数,没有使用批量归一化和池化层,所述第一子网络和所述第二子网络的深度均为四层,其中第一层和最后一层采用的是普通实值卷积,中间两层采用的是四元数卷积,对于第一子网络,四层的卷积核大小均为3×3;对于第二子网络,第一层和最后一层的卷积核大小为5×5,中间两层的卷积核大小为7×7。Exemplarily, in this embodiment, the first subnetwork and the second subnetwork both use simple convolutional layers and activation functions, and do not use batch normalization and pooling layers. The depth of the first subnetwork and the second subnetwork are both four layers, of which the first and last layers use ordinary real-valued convolutions, and the middle two layers use quaternion convolutions. For the first subnetwork, the convolution kernel sizes of the four layers are all 3×3; for the second subnetwork, the convolution kernel sizes of the first and last layers are 5×5, and the convolution kernel sizes of the two middle layers are 7×7.
进一步的,在所述步骤S40中,所述损失函数采用均方误差和结构相似度作为组合损失函数,所述优化算法采用AdamW算法,且在对所述图像去噪模型训练过程中,采用余弦退火算法调节学习率;Furthermore, in the step S40, the loss function uses mean square error and structural similarity as a combined loss function, the optimization algorithm uses the AdamW algorithm, and in the process of training the image denoising model, the cosine annealing algorithm is used to adjust the learning rate;
所述均方误差损失函数为:The mean square error loss function is:
其中,yi表示所述原始图像的值,表示所述噪声图像的值,n表示所述原始图像对的数量;Wherein, yi represents the value of the original image, represents the value of the noise image, and n represents the number of the original image pairs;
所述结构相似度损失函数为:The structural similarity loss function is:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数。Where μx is the mean of x , μy is the mean of y, σx2 is the variance of x, σy2 is the variance of y, σxy is the covariance of x and y, and c1 and c2 are constants.
示例性的,在所述AdamW算法中,权重衰减为1e-4,mini-batch设置成10,设置总训练轮数为50轮。在训练过程中采用的是余弦退火(CosineAnnealingLR)来调节学习率,该策略让学习率以恒定的频率在两个边界之间非线性变化,学习率下界为0.0001,学习率上界为0.001。For example, in the AdamW algorithm, the weight decay is 1e-4, the mini-batch is set to 10, and the total number of training rounds is set to 50. During the training process, cosine annealing (CosineAnnealingLR) is used to adjust the learning rate, which allows the learning rate to change nonlinearly between two boundaries at a constant frequency, with a lower bound of 0.0001 and an upper bound of 0.001.
进一步的,在所述计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差的步骤之前还包括:Furthermore, before the step of calculating the error between the output image processed by the image denoising model and the initial image corresponding to the output image, the method further includes:
通过所述四元数卷积神经网络提取所述预处理后的图像的特征并进行前向传播;Extracting features of the preprocessed image through the quaternion convolutional neural network and performing forward propagation;
在所述计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差的步骤之后还包括:After the step of calculating the error between the output image processed by the image denoising model and the initial image corresponding to the output image, the method further includes:
根据所述误差确定所述损失函数的值,并根据所述损失函数的值判断所述四元数卷积神经网络是否收敛,若未收敛,则判定为需要继续训练所述图像去噪模型。The value of the loss function is determined according to the error, and whether the quaternion convolutional neural network has converged is judged according to the value of the loss function. If not, it is determined that it is necessary to continue training the image denoising model.
可以理解的,若未收敛,则神经网络重新提取图像特征并进行前向传播,同时该神经网络会自动反向传播更新学习,以自动调节损失函数和优化算法中的参数,以优化图像去噪模型。It can be understood that if convergence is not achieved, the neural network re-extracts the image features and performs forward propagation. At the same time, the neural network automatically back-propagates and updates the learning to automatically adjust the loss function and the parameters in the optimization algorithm to optimize the image denoising model.
进一步的,根据所述误差的大小调节所述损失函数和所述优化算法中的参数,以优化所述图像去噪模型,进而得到图像去噪优化模型的步骤之后还包括:Furthermore, after the step of adjusting the loss function and the parameters in the optimization algorithm according to the size of the error to optimize the image denoising model and then obtaining the image denoising optimization model, the method further includes:
根据经所述图像去噪模型处理后的去噪图像、及所述去噪图像对应的最初图像,对训练后的所述图像去噪优化模型进行测试评估;Testing and evaluating the trained image denoising optimization model according to the denoised image processed by the image denoising model and the original image corresponding to the denoised image;
其中所述测试评估的指标包括:The test evaluation indicators include:
峰值信噪比(Peak Signal to Noise Ratio,PSNR):用于衡量所述去噪图像和所述最初图像间的差异,公式如下:Peak Signal to Noise Ratio (PSNR): used to measure the difference between the denoised image and the original image. The formula is as follows:
其中,(2n-1)2表示图像像素点的最大值;MSE表示所述最初图像和所述去噪图像之间的均方误差,n表示所述原始图像对的数量,PSNR值越大,去噪效果越好;Wherein, (2 n -1) 2 represents the maximum value of the image pixel; MSE represents the mean square error between the original image and the denoised image; n represents the number of the original image pairs; the larger the PSNR value, the better the denoising effect;
结构相似度(Structural Similarity,SSIM):用于度量所述去噪图像和所述最初图像间的相似性,公式如下:Structural Similarity (SSIM): used to measure the similarity between the denoised image and the original image. The formula is as follows:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数,以避免分母为0,SSIM的值越大,表示去噪图像和最初图像越相似,当两幅图像完全相同时,SSIM=1;Where, μ x is the mean of x, μ y is the mean of y, σ x 2 is the variance of x, σ y 2 is the variance of y, σ xy is the covariance of x and y, c 1 and c 2 are constants to avoid the denominator being 0. The larger the value of SSIM, the more similar the denoised image is to the original image. When the two images are exactly the same, SSIM = 1.
可学习感知图像块相似度(Learned Perceptual Image Patch Similarity,LPIPS),用于计算所述去噪图像和所述最初图像的特征差异,公式如下:The Learned Perceptual Image Patch Similarity (LPIPS) is used to calculate the feature difference between the denoised image and the original image. The formula is as follows:
其中,d是x0和x之间的距离,分别代表真实值和预测值,H,W分别为所述去噪图像和所述最初图像的高和宽,l表示所述四元数卷积神经网络层数,wl表示所述四元数卷积神经网络第l层的权重。where d is the distance between x0 and x, Represent the true value and the predicted value respectively, H, W are the height and width of the denoised image and the original image respectively, l represents the number of layers of the quaternion convolutional neural network, and w l represents the weight of the lth layer of the quaternion convolutional neural network.
可以理解的,从l层提取特征堆栈,并在通道维度上进行单位指定。使用向量来缩减激活通道的数量,最终计算出l2距离。最后,对整个空间进行平均,并对各通道求和。该指标可学习生成的图像与地面实况之间的反向映射,迫使生成器从伪造图像重建真实图像的反向映射,并优先考虑两者之间的感知相似性,这更符合人类的感知,LPIPS值越低,表示两幅图像的相似度越高,而值越高,则表示差异越大。As you can understand, the feature stack is extracted from the l layer and specified in units on the channel dimension. A vector is used to reduce the number of activated channels and finally the l2 distance is calculated. Finally, the entire space is averaged and summed across channels. This metric learns the reverse mapping between the generated image and the ground truth, forcing the generator to reconstruct the reverse mapping of the real image from the fake image and prioritize the perceptual similarity between the two, which is more in line with human perception. The lower the LPIPS value, the higher the similarity between the two images, while the higher the value, the greater the difference.
请参阅图2,为了便于理解,本实施例提供了神经网络训练总体流程图,该流程图对应所述步骤S30-S40。Please refer to FIG. 2 . For ease of understanding, this embodiment provides an overall flowchart of neural network training, which corresponds to steps S30 - S40 .
请参阅图3,本实施例还提供了神经网络结构设计图Please refer to Figure 3. This embodiment also provides a neural network structure design diagram
需要说明的是,图3中的噪声图像实际指的是原始图像对,去噪图像指的是经过神经网络模型输出的去噪后的图像。It should be noted that the noisy image in FIG3 actually refers to the original image pair, and the denoised image refers to the denoised image output by the neural network model.
为了让本发明与目前现有的相关技术更具有可比性和说服力,同时为了排除其他外界因素对本发明的去噪效果的干扰,本发明所涉及的技术实验均在Python 3.8.5环境下,在Intel(R)Core(TM)i7-10875HCPU@2.30GHz的PC上和一个NVIDIA GeForce RTX 2060下完成。In order to make the present invention more comparable and convincing with the currently available related technologies, and to exclude the interference of other external factors on the denoising effect of the present invention, the technical experiments involved in the present invention were completed in the Python 3.8.5 environment, on a PC with Intel(R) Core(TM) i7-10875HCPU@2.30GHz and an NVIDIA GeForce RTX 2060.
通过三项所述测试评估的指标对本发明最终的图像去噪优化模型的去噪效果进行衡量,并与传统方法中其他模型的去噪效果进行对比,结果如下表所示,测试数据集为BSD-100。σ表示噪声等级,加粗的部分表示最好的结果。The denoising effect of the final image denoising optimization model of the present invention is measured by the three test evaluation indicators and compared with the denoising effects of other models in the traditional method. The results are shown in the following table. The test data set is BSD-100. σ represents the noise level, and the bold part represents the best result.
从表中可以看出,本发明的网络效果明显优于其他网络。一方面,本发明的SSIM和LPIPS遥遥领先,表明本发明在恢复图像结构和感知相似性方面具有很大优势。另一方面,本发明的PSNR也非常出色,尤其是在高噪声水平下,例如噪声等级30和40下,与其他网络相比有显著提高。As can be seen from the table, the network effect of the present invention is significantly better than other networks. On the one hand, the SSIM and LPIPS of the present invention are far ahead, indicating that the present invention has great advantages in restoring image structure and perceptual similarity. On the other hand, the PSNR of the present invention is also very good, especially under high noise levels, such as noise levels 30 and 40, which is significantly improved compared with other networks.
各方法参数量(Parameter)和浮点运算次数(FLOPs)的对比如下表所示,参数量的单位是百万,浮点运算次数的单位是十亿,加粗的部分表示最好的结果。The comparison of the number of parameters (Parameter) and the number of floating-point operations (FLOPs) of each method is shown in the following table. The unit of the parameter is million, the unit of the floating-point operation is billion, and the bold part indicates the best result.
上表显示本发明提出的轻量级网络参数少于500000个,FLOPs也非常短。它的最大特点是简单高效,但仍具有先进的去噪效果。这两个指标也可以反映整个网络的训练成本,与实值网络和其他网络相比,本发明的优势非常明显。The above table shows that the lightweight network parameters proposed by the present invention are less than 500,000, and the FLOPs are also very short. Its biggest feature is that it is simple and efficient, but still has advanced denoising effects. These two indicators can also reflect the training cost of the entire network. Compared with real-valued networks and other networks, the advantages of the present invention are very obvious.
请查阅图4,所示为本发明第二实施例中的一种图像去噪系统40,包括:Please refer to FIG. 4 , which shows an image denoising system 40 in a second embodiment of the present invention, comprising:
获取模块11:用于获取待处理图像,利用导向滤波得到所述待处理图像的基础层数据集和细节层数据集,其中所述基础层数据集和所述细节层数据集均包括若干个原始图像对,每个所述原始图像对均包括一对原始图像和噪声图像;Acquisition module 11: used to acquire an image to be processed, and obtain a base layer data set and a detail layer data set of the image to be processed by using guided filtering, wherein the base layer data set and the detail layer data set each include a plurality of original image pairs, and each of the original image pairs includes a pair of an original image and a noise image;
所述获取模块11具体用于:The acquisition module 11 is specifically used for:
对待处理图像进行裁剪以得到若干个斑块,其中裁剪分为两轮,两轮裁剪在所述待处理图像上的作用位置相同,进行第一轮裁剪时的斑块加入高斯噪声,以获得噪声图像,进行第二轮裁剪时的斑块保持原样,以获得原始图像;The image to be processed is cropped to obtain a plurality of patches, wherein the cropping is divided into two rounds, and the two rounds of cropping have the same effect on the image to be processed, Gaussian noise is added to the patches in the first round of cropping to obtain a noise image, and the patches in the second round of cropping remain the same to obtain an original image;
利用导向滤波得到所述斑块的基础层和细节层;Using guided filtering to obtain a base layer and a detail layer of the patch;
将所有所述斑块的基础层整合为基础层数据集,将所有所述斑块的细节层整合为细节层数据集。The base layers of all the patches are integrated into a base layer dataset, and the detail layers of all the patches are integrated into a detail layer dataset.
构建模块12:用于基于四元数卷积神经网络,构建图像去噪模型,其中所述四元数卷积神经网络包括第一子网络和第二子网络,所述第一子网络用于处理所述基础层数据集,所述第二子网络用于处理所述细节层数据集;Construction module 12: used to construct an image denoising model based on a quaternion convolutional neural network, wherein the quaternion convolutional neural network includes a first subnetwork and a second subnetwork, the first subnetwork is used to process the base layer data set, and the second subnetwork is used to process the detail layer data set;
在所述构建模块12中,所述第一子网络和所述第二子网络的深度均有若干层,且所述第一子网络和所述第二子网络的第一层和最后一层均采用普通实值卷积、中间层均采用四元数卷积;In the construction module 12, the depth of the first sub-network and the second sub-network are both several layers, and the first layer and the last layer of the first sub-network and the second sub-network both use ordinary real-valued convolution, and the intermediate layers both use quaternion convolution;
预处理模块13:用于对所述基础层数据集和所述细节层数据集中的所有图像进行张量转换和标准化处理,以得到预处理后的图像;Preprocessing module 13: used for performing tensor conversion and standardization processing on all images in the base layer data set and the detail layer data set to obtain preprocessed images;
训练模块14:用于设置损失函数和优化算法,将所述预处理后的图像输入所述图像去噪模型,以对所述图像去噪模型进行训练,进而得到图像去噪优化模型;Training module 14: used to set a loss function and an optimization algorithm, input the preprocessed image into the image denoising model to train the image denoising model, and then obtain an image denoising optimization model;
所述训练模块14包括:The training module 14 comprises:
传播单元141:用于通过所述四元数卷积神经网络提取所述预处理后的图像的特征并进行前向传播;Propagation unit 141: used for extracting features of the preprocessed image through the quaternion convolutional neural network and performing forward propagation;
计算单元142:用于计算经所述图像去噪模型处理后的输出图像与该输出图像对应的初始图像两者间的误差;Calculation unit 142: used for calculating the error between the output image processed by the image denoising model and the initial image corresponding to the output image;
判断单元143:用于根据所述误差确定所述损失函数的值,并根据所述损失函数的值判断所述四元数卷积神经网络是否收敛,若未收敛,则判定为需要继续训练所述图像去噪模型;A judging unit 143 is used to determine the value of the loss function according to the error, and to judge whether the quaternion convolutional neural network has converged according to the value of the loss function. If not, it is determined that it is necessary to continue training the image denoising model.
优化单元144:用于根据所述误差的大小调节所述损失函数和所述优化算法中的参数,以优化所述图像去噪模型,进而得到图像去噪优化模型;Optimizing unit 144: used for adjusting the loss function and the parameters in the optimization algorithm according to the size of the error to optimize the image denoising model, thereby obtaining an image denoising optimization model;
在所述训练模块14中,所述损失函数采用均方误差和结构相似度作为组合损失函数,所述优化算法采用AdamW算法,且在对所述图像去噪模型训练过程中,采用余弦退火算法调节学习率;In the training module 14, the loss function uses mean square error and structural similarity as a combined loss function, the optimization algorithm uses the AdamW algorithm, and in the process of training the image denoising model, the cosine annealing algorithm is used to adjust the learning rate;
所述均方误差损失函数为:The mean square error loss function is:
其中,yi表示所述原始图像的值,表示所述噪声图像的值,n表示所述原始图像对的数量;Wherein, yi represents the value of the original image, represents the value of the noise image, and n represents the number of the original image pairs;
所述结构相似度损失函数为:The structural similarity loss function is:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数;Where μ x is the mean of x, μ y is the mean of y, σ x 2 is the variance of x, σ y 2 is the variance of y, σ xy is the covariance of x and y, and c 1 and c 2 are constants;
评估模块15:用于根据经所述图像去噪模型处理后的去噪图像、及所述去噪图像对应的最初图像,对训练后的所述图像去噪优化模型进行测试评估;Evaluation module 15: used to test and evaluate the trained image denoising optimization model according to the denoised image processed by the image denoising model and the original image corresponding to the denoised image;
其中所述测试评估的指标包括:The test evaluation indicators include:
峰值信噪比:用于衡量所述去噪图像和所述最初图像间的差异,公式如下:Peak signal-to-noise ratio: used to measure the difference between the denoised image and the original image, the formula is as follows:
其中,(2n-1)2表示图像像素点的最大值;MSE表示所述最初图像和所述去噪图像之间的均方误差,n表示所述原始图像对的数量;Wherein, (2 n -1) 2 represents the maximum value of the image pixels; MSE represents the mean square error between the original image and the denoised image; and n represents the number of the original image pairs;
结构相似度:用于度量所述去噪图像和所述最初图像间的相似性,公式如下:Structural similarity: used to measure the similarity between the denoised image and the original image, the formula is as follows:
其中,μx是x的均值,μy是y的均值,σx 2是x的方差,σy 2是y的方差,σxy是x和y的协方差,c1和c2是常数;Where μ x is the mean of x, μ y is the mean of y, σ x 2 is the variance of x, σ y 2 is the variance of y, σ xy is the covariance of x and y, and c 1 and c 2 are constants;
可学习感知图像块相似度,用于计算所述去噪图像和所述最初图像的特征差异,公式如下:The learnable perceived image block similarity is used to calculate the feature difference between the denoised image and the original image, and the formula is as follows:
其中,d是x0和x之间的距离,分别代表真实值和预测值,H,W分别为所述去噪图像和所述最初图像的高和宽,l表示所述四元数卷积神经网络层数,wl表示所述四元数卷积神经网络第l层的权重。where d is the distance between x0 and x, Represent the true value and the predicted value respectively, H, W are the height and width of the denoised image and the original image respectively, l represents the number of layers of the quaternion convolutional neural network, and w l represents the weight of the lth layer of the quaternion convolutional neural network.
上述各模块、单元被执行时所实现的功能或操作步骤与上述方法实施例大体相同,在此不再赘述。The functions or operation steps implemented when the above modules and units are executed are generally the same as those in the above method embodiments, and will not be repeated here.
本发明实施例所提供的图像去噪系统,其实现原理及产生的技术效果和前述方法实施例相同,为简要描述,装置实施例部分未提及之处,可参考前述方法实施例中相应内容。The image denoising system provided in the embodiment of the present invention has the same implementation principle and technical effects as those of the aforementioned method embodiment. For the sake of brief description, for matters not mentioned in the device embodiment, reference may be made to the corresponding contents in the aforementioned method embodiment.
请参阅图5,本发明第三实施例还提出一种计算机设备,包括存储器10、处理器20以及存储在所述存储器10上并可在所述处理器20上运行的计算机程序30,所述处理器20执行所述计算机程序30时实现上述的图像去噪方法。Please refer to FIG5 . A third embodiment of the present invention further provides a computer device, comprising a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, the above-mentioned image denoising method is implemented.
其中,存储器10至少包括一种类型的存储介质,所述存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、磁性存储器、磁盘、光盘等。存储器10在一些实施例中可以是计算机设备的内部存储单元,例如该计算机设备的硬盘。存储器10在另一些实施例中也可以是外部存储装置,例如插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,存储器10还可以既包括计算机设备的内部存储单元也包括外部存储装置。存储器10不仅可以用于存储安装于计算机设备的应用软件及各类数据,还可以用于暂时地存储已经输出或者将要输出的数据。The memory 10 includes at least one type of storage medium, including flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10 may be an internal storage unit of a computer device, such as a hard disk of the computer device. In other embodiments, the memory 10 may also be an external storage device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Further, the memory 10 may also include both an internal storage unit of a computer device and an external storage device. The memory 10 may be used not only to store application software and various types of data installed in the computer device, but also to temporarily store data that has been output or is to be output.
其中,处理器20在一些实施例中可以是电子控制单元(Electronic ControlUnit,简称ECU,又称行车电脑)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器或其他数据处理芯片,用于运行存储器10中存储的程序代码或处理数据,例如执行访问限制程序等。Among them, in some embodiments, the processor 20 can be an electronic control unit (Electronic Control Unit, abbreviated as ECU, also known as a vehicle computer), a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor or other data processing chip, used to run the program code stored in the memory 10 or process data, such as executing access restriction programs, etc.
需要指出的是,图5示出的结构并不构成对计算机设备的限定,在其它实施例当中,该计算机设备可以包括比图示更少或者更多的部件,或者组合某些部件,或者不同的部件布置。It should be noted that the structure shown in FIG. 5 does not constitute a limitation on the computer device. In other embodiments, the computer device may include fewer or more components than shown in the figure, or a combination of certain components, or a different arrangement of components.
本发明实施例还提出一种可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现如上述的图像去噪方法。The embodiment of the present invention further provides a readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the image denoising method as described above is implemented.
本领域技术人员可以理解,在流程图中表示或在此以其他方式描述的逻辑和/或步骤,例如,可以被认为是用于实现逻辑功能的可执行指令的定序列表,可以具体实现在任何计算机可读介质中,以供指令执行系统、装置或设备(如基于计算机的系统、包括处理器的系统或其他可以从指令执行系统、装置或设备取指令并执行指令的系统)使用,或结合这些指令执行系统、装置或设备而使用。就本说明书而言,“计算机可读介质”可以是任何可以包含、存储、通信、传播或传输程序以供指令执行系统、装置或设备或结合这些指令执行系统、装置或设备而使用的装置。Those skilled in the art will appreciate that the logic and/or steps represented in the flowchart or otherwise described herein, for example, may be considered as an ordered list of executable instructions for implementing logical functions, and may be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For purposes of this specification, a "computer-readable medium" may be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
计算机可读介质的更具体的示例(非穷尽性列表)包括以下:具有一个或多个布线的电连接部(电子装置),便携式计算机盘盒(磁装置),随机存取存储器(RAM),只读存储器(ROM),可擦除可编辑只读存储器(EPROM或闪速存储器),光纤装置,以及便携式光盘只读存储器(CDROM)。另外,计算机可读介质甚至可以是可在其上打印所述程序的纸或其他合适的介质,因为可以例如通过对纸或其他介质进行光学扫描,接着进行编辑、解译或必要时以其他合适方式进行处理来以电子方式获得所述程序,然后将其存储在计算机存储器中。More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering or, if necessary, processing in another suitable manner, and then stored in a computer memory.
应当理解,本发明的各部分可以用硬件、软件、固件或它们的组合来实现。在上述实施方式中,多个步骤或方法可以用存储在存储器中且由合适的指令执行系统执行的软件或固件来实现。例如,如果用硬件来实现,和在另一实施方式中一样,可用本领域公知的下列技术中的任一项或它们的组合来实现:具有用于对数据信号实现逻辑功能的逻辑门电路的离散逻辑电路,具有合适的组合逻辑门电路的专用集成电路,可编程门阵列(PGA),现场可编程门阵列(FPGA)等。It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or a combination thereof: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
在本说明书的描述中,参考术语“一个实施例”、“一些实施例”、“示例”、“具体示例”、或“一些示例”等的描述意指结合该实施例或示例描述的具体特征、结构、材料或者特点包含于本发明的至少一个实施例或示例中。在本说明书中,对上述术语的示意性表述不一定指的是相同的实施例或示例。而且,描述的具体特征、结构、材料或者特点可以在任何的一个或多个实施例或示例中以合适的方式结合。以上所述实施例仅表达了本发明的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本发明构思的前提下,还可以做出若干变形和改进,这些都属于本发明的保护范围。因此,本发明专利的保护范围应以所附权利要求为准。In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. The above-mentioned embodiments only express several implementation methods of the present invention, and the description thereof is relatively specific and detailed, but it cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present invention, several variations and improvements can be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410239261.2A CN118037580A (en) | 2024-03-04 | 2024-03-04 | Image denoising method, system, storage medium and electronic device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202410239261.2A CN118037580A (en) | 2024-03-04 | 2024-03-04 | Image denoising method, system, storage medium and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN118037580A true CN118037580A (en) | 2024-05-14 |
Family
ID=90985514
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202410239261.2A Pending CN118037580A (en) | 2024-03-04 | 2024-03-04 | Image denoising method, system, storage medium and electronic device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN118037580A (en) |
Cited By (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119205583A (en) * | 2024-11-28 | 2024-12-27 | 南京理工大学 | Depth completion method based on infrared feature mining and cross-modal fusion |
| CN119885375A (en) * | 2024-12-30 | 2025-04-25 | 广东松本绿色新材股份有限公司 | Intelligent management system and method for wallboard installation |
| CN119942287A (en) * | 2025-01-14 | 2025-05-06 | 山东省国土空间数据和遥感技术研究院(山东省海域动态监视监测中心) | A remote sensing image fusion method and device based on quaternary convolutional neural network |
| CN120355615A (en) * | 2025-06-24 | 2025-07-22 | 中科亿海微电子科技(苏州)有限公司 | Image noise reduction method and device |
-
2024
- 2024-03-04 CN CN202410239261.2A patent/CN118037580A/en active Pending
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN119205583A (en) * | 2024-11-28 | 2024-12-27 | 南京理工大学 | Depth completion method based on infrared feature mining and cross-modal fusion |
| CN119885375A (en) * | 2024-12-30 | 2025-04-25 | 广东松本绿色新材股份有限公司 | Intelligent management system and method for wallboard installation |
| CN119885375B (en) * | 2024-12-30 | 2025-10-24 | 广东松本绿色新材股份有限公司 | An intelligent management system and method for wall panel installation |
| CN119942287A (en) * | 2025-01-14 | 2025-05-06 | 山东省国土空间数据和遥感技术研究院(山东省海域动态监视监测中心) | A remote sensing image fusion method and device based on quaternary convolutional neural network |
| CN120355615A (en) * | 2025-06-24 | 2025-07-22 | 中科亿海微电子科技(苏州)有限公司 | Image noise reduction method and device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| Liu et al. | Learning converged propagations with deep prior ensemble for image enhancement | |
| CN112529146B (en) | Methods and devices for neural network model training | |
| US11574500B2 (en) | Real-time facial landmark detection | |
| CN118037580A (en) | Image denoising method, system, storage medium and electronic device | |
| US11481585B2 (en) | Segmentation of data | |
| CN114565528B (en) | A remote sensing image denoising method and system based on multi-scale and attention mechanism | |
| CN114782768B (en) | Pre-trained network model training method, medical image processing method and device | |
| Couturier et al. | Image denoising using a deep encoder-decoder network with skip connections | |
| CN115908984B (en) | Training method and device for image clustering model | |
| CN113822144B (en) | Target detection method, device, computer equipment and storage medium | |
| CN112365551A (en) | Image quality processing system, method, device and medium | |
| CN120318499B (en) | UAV target detection method and electronic equipment based on cross-spatial frequency domain | |
| CN119810233B (en) | Image colorization method, system and device based on dual-branch interactive fusion | |
| CN117911258A (en) | Sample generation method and related equipment | |
| CN118674992A (en) | Deep learning-based multi-feature fusion aneurysm identification method and system | |
| CN109949334B (en) | Contour detection method based on deep reinforced network residual error connection | |
| CN113256556B (en) | Image selection method and device | |
| CN112017113A (en) | Image processing method and device, model training method and device, equipment and medium | |
| CN114519865A (en) | 2D human body posture estimation method fused with integrated attention | |
| CN119741419A (en) | Training method and device for diffusion model for Gaussian primitive completion | |
| CN119625169A (en) | A three-dimensional reconstruction method and device based on structured three-dimensional Gaussian representation | |
| CN118570465A (en) | Focal region segmentation method, focal region segmentation device, electronic equipment and storage medium | |
| CN118053174A (en) | Quick body characteristic positioning method and system | |
| CN117315252A (en) | A semantic segmentation method, system and equipment for multi-scale group crop images | |
| CN117710763A (en) | Image noise recognition model training method, image noise recognition method and device |
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 |