Image denoising method and system
By combining the U-Net network and the width learning system into an image denoising model, the problems of long training time and poor performance of existing image denoising models are solved, achieving efficient and accurate image denoising and improving the quality and efficiency of industrial visual inspection.
Patent Information
- Application Number
- CN202310841751.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-10
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2043-07-10
AI Technical Summary
In existing technologies, image denoising models are time-consuming to train and have poor denoising effects, which affects the efficiency and accuracy of industrial visual inspection.
An image denoising model combining U-Net network and width learning system is adopted. The initial model is trained by training on noisy images and denoised images to construct the target image denoising model, and then the denoising process is performed on the image to be denoised.
It improves the efficiency and accuracy of image denoising, enhances the efficiency and accuracy of industrial visual inspection, and reduces the computational burden on computer systems.
Smart Images

Figure CN117011173B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of image denoising, and particularly relates to an image denoising method and system. BACKGROUND
[0002] Before industrial visual inspection (such as defect detection, anomaly detection, etc.), a clear and real image data needs to be provided as input for the detection system. However, due to the interference of imaging devices and external environment, the image to be detected is often contaminated by noise in the acquisition process, and loses its original detail features, thereby affecting the detection result. Therefore, it is necessary to perform denoising processing on the noisy image, so as to obtain a clean denoised image.
[0003] The prior art can utilize image denoising technology to perform denoising processing on the noisy image. The image denoising technology includes BM3D, DnCNN and FFDNet. These image denoising methods are based on feature learning, that is, the internal features of the image are automatically learned by using a neural network, so as to realize image denoising, and focus on learning the potential mapping from the noisy image to the clean image.
[0004] However, although the denoising method based on feature learning has strong learning ability, the deep learning model often has the characteristics of long training time due to large number of parameters and complex structure. In addition, the highly non-convex optimization problem involved in the deep learning model makes it challenging to analyze them theoretically. At present, most of the work only involves adjusting parameters or adding layers, and the accuracy of the model is low, which makes the image denoising effect poor. SUMMARY
[0005] (I) Technical problems solved
[0006] In view of the deficiencies of the prior art, the present application provides an image denoising method and system, which solves the technical problems of long model training time and poor image denoising effect in the prior art.
[0007] (II) Technical solutions
[0008] To achieve the above purpose, the present application is implemented by the following technical solutions:
[0009] The image denoising method provided by the present application to solve its technical problems is executed by a computer, and includes the following steps:
[0010] Obtain training sample image data, the training sample image data including training noise image and training denoised image;
[0011] Construct an initial image denoising model, the initial image denoising model being constructed by a U-Net network and a width learning system, an output end of the U-Net network being connected to an input end of the width learning system.
[0012] training the initial image denoising model based on the training noise image and the training denoising image to obtain a target image denoising model;
[0013] performing denoising processing on a to-be-denoised image based on the target image denoising model to obtain a denoised image.
[0014] Preferably, the training of the initial image denoising model based on the training noise image and the training denoising image comprises:
[0015] encoding processing of the training noise image based on the U-Net network to extract image features;
[0016] decoding processing of the image features based on the U-Net network to obtain image enhanced features;
[0017] semantic classification of the image enhanced features to obtain a semantic classification result;
[0018] determining the semantic classification result as a feature node, and performing non-linear transformation processing of the feature node based on the width learning system to obtain an enhanced node;
[0019] connecting the feature node and the enhanced node to an output end of the width learning system to obtain an image denoising function;
[0020] calculating an output weight of the image denoising function based on the training denoising image.
[0021] Preferably, the encoding processing of the training noise image based on the U-Net network comprises:
[0022] convolution processing of the training noise image to obtain a first image feature;
[0023] successive downsampling operation and convolution processing of the first image feature to obtain a second image feature;
[0024] successive downsampling operation and convolution processing of the second image feature to obtain a third image feature;
[0025] successive downsampling operation and convolution processing of the third image feature to obtain a fourth image feature;
[0026] successive downsampling operation and convolution processing of the fourth image feature to obtain a fifth image feature.
[0027] Preferably, the decoding processing of the image features based on the U-Net network comprises:
[0028] The fifth image feature is up-sampled to obtain a first up-sampling result; the first up-sampling result and the fourth image feature are subjected to feature mapping concatenation processing to obtain a first fusion feature; and the first fusion feature is subjected to convolution processing to obtain a first image enhancement feature;
[0029] The first image enhancement feature is up-sampled to obtain a second up-sampling result; the second up-sampling result and the third image feature are subjected to feature mapping concatenation processing to obtain a second fusion feature; and the second fusion feature is subjected to convolution processing to obtain a second image enhancement feature;
[0030] The second image enhancement feature is up-sampled to obtain a third up-sampling result; the third up-sampling result and the second image feature are subjected to feature mapping concatenation processing to obtain a third fusion feature; and the third fusion feature is subjected to convolution processing to obtain a third image enhancement feature;
[0031] The third image enhancement feature is up-sampled to obtain a fourth up-sampling result; the fourth up-sampling result and the first image feature are subjected to feature mapping concatenation processing to obtain a fourth fusion feature; and the first fusion feature is subjected to convolution processing to obtain a fourth image enhancement feature.
[0032] Preferably, the semantic classification of the image enhancement feature comprises:
[0033] The fourth image enhancement feature is subjected to convolution operation based on a preset convolution kernel to obtain a semantic classification result;
[0034] The expression of the semantic classification result is:
[0035]
[0036] wherein,
[0037] Z i represents the i-th semantic classification result; Conv 1×1 represents 1x1 convolution operation;
[0038] represents the fourth image enhancement feature.
[0039] Preferably, the non-linear transformation processing of the feature node based on the width learning system comprises:
[0040] H j =ξ j (Z n W hj +β hj ),j=1,2,…,m
[0041] wherein,
[0042] denotes a set of Z n j denotes a nonlinear activation function;
[0043] W hj denotes a weight coefficient, and β hj denotes a bias.
[0044] Preferably, the expression of the image denoising function is:
[0045] Y = [ξ(Z n |W n W h1 + β h1 ), …, ξ(Z n W hj + β hj )]W n m
[0046] wherein,
[0047] Y denotes a denoised image output by the model, and W n m denotes an output weight.
[0048] Preferably, the method further comprises:
[0049] obtaining test sample image data, the test sample image data comprising a test noise image and a test denoised image;
[0050] performing denoising processing on the test sample image data based on the target image denoising model to obtain an initial denoised image;
[0051] testing and evaluating the target image denoising model based on the test denoised image and the initial denoised image.
[0052] Preferably, the testing and evaluating the target image denoising model comprises:
[0053] obtaining evaluation index data of the initial denoised image and the test denoised image, the evaluation index data comprising a peak signal-to-noise ratio and a structural similarity;
[0054] calculating a peak signal-to-noise ratio score and a structural similarity score based on a preset weight;
[0055] calculating a test evaluation score based on the peak signal-to-noise ratio score and the structural similarity score;
[0056] If the test evaluation score is greater than or equal to a preset score, it is determined that the target image denoising model passes the test;
[0057] If the test evaluation score is less than the preset score, the initial image denoising model is retrained.
[0058] The image denoising system provided by the present application solves the technical problems and comprises:
[0059] A data acquisition module is configured to acquire training sample image data, wherein the training sample image data comprises training noise images and training denoising images;
[0060] A model construction module is configured to construct an initial image denoising model, wherein the initial image denoising model is constructed by a U-Net network and a width learning system, and an output end of the U-Net network is connected to an input end of the width learning system;
[0061] A model training module is configured to train the initial image denoising model based on the training noise images and the training denoising images to obtain a target image denoising model;
[0062] An image denoising module is configured to perform denoising processing on a to-be-denoised image based on the target image denoising model to obtain a denoised image.
[0063] (Three) beneficial effects
[0064] The present application provides an image denoising method and system. Compared with the prior art, the present application has the following beneficial effects:
[0065] The present application acquires training sample image data, wherein the training sample image data comprises training noise images and training denoising images; constructs an initial image denoising model, wherein the initial image denoising model is constructed by a U-Net network and a width learning system; trains the initial image denoising model based on the training noise images and the training denoising images to obtain a target image denoising model; and performs denoising processing on a to-be-denoised image based on the target image denoising model to obtain a denoised image. By connecting an output end of the U-Net network to an input end of the width learning system, an image denoising model is constructed and trained, efficient denoising of a to-be-inspected image in industrial visual inspection is realized, and the efficiency and accuracy of industrial visual inspection are improved. BRIEF DESCRIPTION OF DRAWINGS
[0066] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description only constitute some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0067] Figure 1 A flowchart of an image denoising method provided by the embodiments of the present application is shown.
[0068] Figure 2 A structural schematic diagram of a U-Net network in some embodiments is shown.
[0069] Figure 3 A structural schematic diagram of a U-Net network in some embodiments is shown.
[0070] Figure 4 A structural schematic diagram of an image denoising model in some embodiments is shown. DETAILED DESCRIPTION
[0071] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application are described clearly and completely. Obviously, the described embodiments are some embodiments of the present application, but not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0072] The embodiments of the present application provide an image denoising method and system, which solve the problems of long training time and poor image denoising effect of the prior art model, and improve the efficiency and accuracy of image denoising.
[0073] The technical solutions in the embodiments of the present application are as follows to solve the above technical problems:
[0074] The embodiments of the present application acquire training sample image data, the training sample image data including training noise images and training denoising images; construct an initial image denoising model, the initial image denoising model being constructed by a U-Net network and a width learning system; train the initial image denoising model based on the training noise images and the training denoising images to obtain a target image denoising model; and perform denoising processing on a to-be-denoised image based on the target image denoising model to obtain a denoised image. By connecting the output end of the U-Net network and the input end of the width learning system, an image denoising model is constructed and trained, efficient denoising of a to-be-inspected image in industrial visual inspection is realized, and the efficiency and accuracy of industrial visual inspection are improved.
[0075] For better understanding of the above technical solutions, the above technical solutions will be described in detail below in combination with the drawings of the specification and specific embodiments.
[0076] The embodiment of the application provides an image denoising method, the method is executed by a computer, Figure 1 A flowchart of an image denoising method provided by the embodiment of the application is shown. The method comprises the following steps:
[0077] S1, obtaining training sample image data, the training sample image data comprising training noise images and training denoised images;
[0078] S2, constructing an initial image denoising model, the initial image denoising model being constructed by a U-Net network and a width learning system, an output end of the U-Net network being connected to an input end of the width learning system;
[0079] S3, training the initial image denoising model based on the training noise images and the training denoised images, to obtain a target image denoising model;
[0080] S4, performing denoising processing on a to-be-denoised image based on the target image denoising model, to obtain a denoised image.
[0081] The embodiment of the application connects the output end of the U-Net network to the input end of the width learning system, thereby constructing and training an image denoising model. Thus, the efficiency and accuracy of image denoising are improved.
[0082] The steps will be analyzed in detail below.
[0083] In step S1, training sample image data is obtained, the training sample image data comprising training noise images and training denoised images.
[0084] The training sample image data is used to train the image denoising model constructed in the embodiment of the application, wherein the training sample image data comprises noise images with certain noise pollution, which are referred to as training noise images in the embodiment of the application; and the training sample image data also comprises clean images after denoising processing, which are referred to as training denoised images in the embodiment of the application.
[0085] It should be noted that, in order to ensure that the model can be normally trained, the training noise images and the training denoised images are matched images, and the training denoised images are images after denoising processing of the training noise images. That is, the training noise images and the training denoised images are two different forms of the same image before and after denoising processing.
[0086] In step S2, an initial image denoising model is constructed, the initial image denoising model being constructed by a U-Net network and a breadth learning system, an output end of the U-Net network being connected to an input end of the breadth learning system.
[0087] In the embodiment of the application, the U-Net network and the breadth learning system (BLS) are combined, the output end of the U-Net network is connected to the input end of the breadth learning system, the U-Net network is taken as a data input source of the breadth learning system, and the image denoising model is constructed. In the embodiment of the application, the image denoising model before training is referred to as an initial image denoising model.
[0088] The U-Net network can obtain more accurate classification results in the case of a limited data set, better solves the problem of difficulty in obtaining a data set, and achieves good results in pixel-based image segmentation. Figure 2 A structure schematic diagram of the U-Net network in some embodiments is shown.
[0089] The U-Net network is also referred to as an encoder-decoder structure, the compression channel is an encoder, is composed of four program blocks, each program block includes a 3x3 convolution layer, uses a Relu activation function, and a pooling layer with a step of 2x2. The features of the picture are extracted layer by layer after being processed by each program block; the expansion channel is a decoder, can be used to restore the position information of the image, is also composed of four program blocks, each program block includes a 2x2 up-sampling operation, then is mapped with the features of the encoding part, and finally is processed through two 3x3 convolution layers. In addition, each hidden layer of the U-Net model has a large number of feature dimensions, which is conducive to the model to learn more diverse and comprehensive features; the "U-shaped" structure of the U-Net model makes the whole feature extraction, fusion, analysis and prediction process more intuitive and rigorous, and the splicing between the feature layers and the repeated and continuous operation of the convolutional neural network are conducive to the model to obtain more accurate output feature maps from the context information and the detail information.
[0090] The breadth learning system (BLS) has two characteristics of network horizontal expansion and efficient incremental learning, so that it can effectively solve the problems of slow weight update of deep learning and insufficient model generalization ability.
[0091] In the embodiment of the application, the BLS no longer takes the original data as the input, and can use the features extracted from other models as the input for training, so as to have better combination with other machine learning algorithms.
[0092] The BLS can be constructed based on a random vector function chain neural network, which has a single hidden layer structure. First, the mapped features of the input data are used as feature nodes of the network; second, the mapped features are enhanced as enhanced nodes with randomly generated weights; and finally, all the mapped features and enhanced nodes are directly connected to the output end, and the corresponding output coefficients can be obtained by pseudo-inverse or gradient descent method.
[0093] In step S3, the initial image denoising model is trained based on the training noise image and the training denoised image to obtain a target image denoising model. Specifically, the following steps are included:
[0094] S301, encoding processing of the training noise image is performed based on the U-Net network to extract image features.
[0095] The U-Net network can be used to extract the backbone features of the image, referred to as image features in the embodiments of the present application. Considering that maximum pooling for downsampling can cause information loss, a 3x3 convolution with a step of 2 can be used instead of maximum pooling, thereby avoiding position offset. A multi-layer convolutional neural network can be used for feature extraction, and finally five preliminary effective feature layers are obtained.
[0096] Specifically, the following steps are included:
[0097] S3011, the training noise image is convolved to obtain a first image feature.
[0098] In the embodiments of the present application, the convolution processing includes consecutive convolution operation, BN layer processing and ReLU activation function processing. By connecting a BN layer after the convolution layer, the learning convergence speed of the network is improved, and the training speed is greatly accelerated. An activation function is connected after the BN layer to activate the output of the layer, forming a convolution processing unit, so as to perform convolution processing on the image or image feature. The expression of the first image feature is:
[0099] x1=F ReLU [F BN (Conv 7×7 (x))]
[0100] wherein,
[0101] F ReLU represents the ReLU activation function, F BN represents the BN layer, Conv 7×7 represents the 7x7 convolution operation, x1 represents the first image feature, and x represents the training noise image.
[0102] S3012, the first image feature is sequentially subjected to downsampling operation and convolution processing to obtain a second image feature.
[0103] S3013, sequentially performing downsampling operation and convolution processing on the second image feature to obtain a third image feature.
[0104] S3014, sequentially performing downsampling operation and convolution processing on the third image feature to obtain a fourth image feature.
[0105] S3015, sequentially performing downsampling operation and convolution processing on the fourth image feature to obtain a fifth image feature.
[0106] The expressions of the second image feature to the fifth image feature are:
[0107] x i =F ReLU [F BN (Conv 3×3 (F ds (x i-1 )))],i=2,3,4,5
[0108] Wherein,
[0109] F ds represents downsampling operation, Conv 3×3 represents performing 3x3 convolution operation.
[0110] So far, five image features can be obtained.
[0111] S302, decoding processing the image feature based on the U-Net network to obtain an image enhancement feature.
[0112] By performing reverse operation of downsampling on the five obtained preliminary effective image feature layers, for example, upsampling with a step of 2. At the same time, different skip connections are added to cascade the feature mapping to perform feature fusion, and finally an effective feature layer fused with all features is obtained. Specifically, it includes:
[0113] S3021, performing upsampling operation on the fifth image feature to obtain a first upsampling result; performing feature mapping cascade processing on the first upsampling result and the fourth image feature to obtain a first fusion feature; performing convolution processing on the first fusion feature to obtain a first image enhancement feature. Wherein, the feature mapping cascade can be to perform skip connection between the upsampling feature and a certain image feature obtained in the last step to perform feature fusion.
[0114] The expression of the first image enhancement feature is:
[0115] x 1 =F ReLU [F BN (Conv3×3 F SC (x4)F us (x5))
[0116] wherein,
[0117] x 1 denotes the first image enhanced feature, F SC denotes feature mapping cascading by a skip connection, F us denotes an up-sampling operation.
[0118] S3022, performing an up-sampling operation on the first image enhanced feature to obtain a second up-sampling result; performing feature mapping cascading processing on the second up-sampling result and the third image feature to obtain a second fusion feature; performing convolution processing on the second fusion feature to obtain a second image enhanced feature.
[0119] The expression of the second image enhanced feature is:
[0120] x 2 =F ReLU [F BN (Conv 3×3 F SC (x3)F us (x 1 ))
[0121] S3023, performing an up-sampling operation on the second image enhanced feature to obtain a third up-sampling result; performing feature mapping cascading processing on the third up-sampling result and the second image feature to obtain a third fusion feature; performing convolution processing on the third fusion feature to obtain a third image enhanced feature.
[0122] The expression of the third image enhanced feature is:
[0123] x 3 =F ReLU [F BN (Conv 3×3 F SC (x2)F us (x 2 ))
[0124] S3024, performing an up-sampling operation on the third image enhanced feature to obtain a fourth up-sampling result; performing feature mapping cascading processing on the fourth up-sampling result and the first image feature to obtain a fourth fusion feature; performing convolution operation on the first fusion feature to obtain a fourth image enhanced feature.
[0125] The expression of the fourth image enhanced feature is:
[0126] x 4 =FTanh [Conv 7×7 F SC (x1)F us (x 3 )]
[0127] wherein,
[0128] F Tanh denotes a Tanh activation function. It should be noted that when the fourth image enhanced feature is obtained, the convolution processing unit is no longer used for convolution processing, but convolution operation and Tanh activation function processing are performed.
[0129] Figure 3 A schematic diagram of the U-Net network in some embodiments is shown.
[0130] In order to ensure that the input and output dimensions of the image are consistent, the U-Net network adopts a symmetric convolution operation. The convolution operation is divided into multiple layers, wherein the first layer and the last layer adopt a 7x7 convolution kernel size, and the remaining layers adopt a 3x3 convolution kernel size with a step size of 1, so as to capture more detailed information. A BN layer is connected after each convolution layer of the network to improve the learning convergence speed of the network and greatly speed up the training speed. An activation function is connected after each BN layer to activate the output of the layer. The last layer uses Tanh as the activation function to prevent the problem of gradient explosion, thereby ensuring the stability of the entire training.
[0131] S303, performing semantic classification on the image enhanced feature to obtain a semantic classification result.
[0132] wherein the semantic classification can be semantic segmentation on the fourth image enhanced feature. The U-Net network can perform convolution operation on the fourth image enhanced feature based on a preset convolution kernel to obtain a semantic classification result, and the preset convolution kernel can be a 1x1 convolution kernel.
[0133] The expression of the semantic classification result is:
[0134]
[0135] wherein,
[0136] Z i denotes the i-th semantic classification result; Conv 1×1 denotes performing 1x1 convolution operation;
[0137] denotes the fourth image enhanced feature.
[0138] It should be noted that after semantic segmentation, each pixel in the image is assigned a class label, where n represents the number of image semantic segmentation classes, and one class represents a feature of the image, i.e. multiple feature information contained in an image.
[0139] S304, determine the semantic classification result as a feature node, and perform nonlinear transformation processing on the feature node based on the width learning system to obtain an enhanced node.
[0140] Figure 4 The structure of the image denoising model in some embodiments is shown. It should be noted that the embodiments of the present application do not directly input the original data into the BLS network, but first input it into the U-Net derived network for feature extraction, so as to perform semantic segmentation. Then the semantic segmentation result is taken as the input of the BLS, thereby replacing the feature mapping link in the original BLS. Then the output of the U-Net derived network is subjected to nonlinear transformation to generate an enhanced node that extracts deeper features, thereby improving the nonlinear fitting capability of the model.
[0141] The expression of the enhanced node is:
[0142] H j =ξ j (Z n W hj +β hj ),j=1,2,…,m
[0143] wherein,
[0144] Z1 to Z n m represents a set of Z1 to Z j m; ξ hj represents a nonlinear activation function;
[0145] W hj represents a weight coefficient, and β n represents a bias.
[0146] S305, connect the feature node and the enhanced node to the output end of the width learning system to obtain an image denoising function.
[0147] The expression of the image denoising function is:
[0148] Y=[Z1,…,Z n m|ξ(Z h1 W h1 +β n ),…,ξ(Z hj W hj +β n )]W m
[0149] wherein,
[0150] Y represents a denoised image output by the model, W n m represents an output weight.
[0151] S306, calculate an output weight of the image denoising function based on the training denoised image.
[0152] It should be noted that the output weight in the image denoising function is unknown and needs to be calculated.
[0153] According to the expression of the image denoising function, the training denoised image is substituted into Y on the left side of the expression as the expected output of the model, so as to calculate the output weight W n m .
[0154] After the output weight is calculated, the output weight is substituted into the image denoising function, so as to obtain the complete image denoising function and complete the training process of the model.
[0155] In some embodiments, after training the model, the model can also be tested to detect the accuracy of the model in image denoising. It includes the following steps:
[0156] S311, obtain test sample image data, the test sample image data including test noise images and test denoised images.
[0157] The test sample image data is used to test the image denoising model constructed in the embodiments of the present application, wherein the test sample image data includes noise images with certain noise pollution, which is referred to as test noise images in the embodiments of the present application; and also includes clean images after denoising processing, which is referred to as test denoised images in the embodiments of the present application.
[0158] The test noise image and the test denoised image are matched images, and the test denoised image is an image after denoising processing of the test noise image. That is, the test noise image and the test denoised image are two different forms of the same image before and after denoising processing.
[0159] S312, based on the target image denoising model, denoising processing is performed on the test sample image data to obtain an initial denoised image.
[0160] It should be noted that the initial denoised image is an image obtained by processing the image denoising model provided by the embodiments of the present application. The test denoised image is a clean image obtained after denoising processing. By comparing the initial denoised image and the test denoised image, the similarity is determined, and the image denoising effect of the image denoising model can be tested.
[0161] S313, based on the test denoising image and the initial denoising image, the target image denoising model is tested and evaluated. Specifically, it includes:
[0162] S3131, obtain the evaluation index data of the initial denoising image and the test denoising image, and the evaluation index data includes peak signal to noise ratio and structural similarity.
[0163] Peak signal to noise ratio (PSNR) generally takes a value range of 20-40, the larger the value, the closer the image. The definition is as follows:
[0164] Given the size of the image I and image K is m*n, the mean square error MSE is defined as:
[0165]
[0166] Wherein,
[0167] I(i,j) represents the pixel value of the pixel point at the (i,j) coordinate in the image I, and K(i,j) represents the pixel value of the pixel point at the (i,j) coordinate in the image K.
[0168] Then PSNR is defined as:
[0169]
[0170] Wherein, The maximum pixel value of the image. Bits, that is, the number of bits occupied by each pixel point. If the pixel is represented by 8-bit binary, it is 255.
[0171] Structural similarity (structural similarity index measurement, SSIM) generally takes a value range of 0-1, the larger the value, the better the denoising effect.
[0172] SSIM is a comparison index of brightness (l), contrast (c) and structure (s):
[0173]
[0174]
[0175]
[0176] Wherein, μ x And μ y Respectively represent the mean of images x and y, and the image mean refers to the mean of the pixel value of the pixel point in the image.
[0177] σ x and σ y respectively represent the corresponding standard deviation, and σ xy respectively represent the variance of images x and y and the covariance between them; C1, C2, C3 are constants, usually taken C1=(k1l) 2 , C2=(k2l) 2 , k1=0.01, k2=0.03; l is the dynamic range of pixel value, usually taken 255. Let , we can get:
[0178]
[0179] S3132, calculating the peak signal-to-noise ratio score and the structural similarity score based on the preset weight.
[0180] The peak signal-to-noise ratio and the structural similarity can be pre-set with weights, for example, 4:6, 5:5.
[0181] S3133, calculating the test evaluation score based on the peak signal-to-noise ratio score and the structural similarity score.
[0182] S3134, if the test evaluation score is greater than or equal to a preset score, determining that the target image denoising model passes the test.
[0183] If the test evaluation score is less than the preset score, retraining the initial image denoising model.
[0184] In step S4, performing denoising processing on the to-be-denoised image based on the target image denoising model to obtain a denoised image.
[0185] The embodiment of the application further provides an image denoising system, and the above system comprises:
[0186] A data acquisition module configured to acquire training sample image data, wherein the training sample image data comprises training noise images and training denoised images;
[0187] A model construction module configured to construct an initial image denoising model, wherein the initial image denoising model is constructed by a U-Net network and a width learning system, and an output end of the U-Net network is connected to an input end of the width learning system;
[0188] A model training module configured to train the initial image denoising model based on the training noise images and the training denoised images to obtain a target image denoising model;
[0189] The image denoising module is configured to perform denoising processing on the image to be denoised based on the target image denoising model to obtain a denoised image.
[0190] It can be understood that the above-mentioned image denoising system provided by the embodiments of the present application corresponds to the above-mentioned image denoising method, and the explanation, examples, beneficial effects and the like of the related content can refer to the corresponding content in the image denoising method, which will not be described here.
[0191] In summary, compared with the prior art, the above-mentioned image denoising system has the following beneficial effects:
[0192] The image detection technology is used to replace the traditional manual quality inspection, so that the industrial quality inspection has a high intelligent level.
[0193] Compared with several representative algorithms at present, the denoising method (UNet-BLS) has greatly improved the denoising ability, can obtain clearer and more real high-quality images, and improves the accuracy and effectiveness of industrial visual detection.
[0194] The model training time of the denoising method (UNet-BLS) is shorter, the denoising efficiency is improved, and the computing burden of the computer system is greatly reduced.
[0195] The present application adds an image denoising link to the front end of industrial visual detection, which can effectively improve the accuracy of industrial visual detection, reduce the risk of false detection, and improve the production quality control efficiency.
[0196] It should be noted that, through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be realized by means of software and necessary general hardware platform. Based on such understanding, the above technical solutions essentially or said to make contributions to the prior art can be embodied in the form of a software product, which can be stored in a computer readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including a plurality of instructions to make a computer device (which can be a personal computer, server, or network device, etc.) execute the method described in each embodiment or some part of the embodiment. In the specification provided herein, a large number of specific details are described. However, it can be understood that the embodiments of the present application can be practiced without these specific details. In some examples, well-known methods, structures and techniques are not described in detail in order not to obscure the understanding of the specification.
[0197] In this document, relational terms such as first and second and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. An element proceeded by "comprises... a" does not, without more constraints, exclude the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0198] The above embodiments are only used to illustrate the technical solutions of the present application, not limit the present application; even though the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: it can still modify the technical solutions recorded in the foregoing embodiments, or make equivalent replacement for part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. An image denoising method, wherein the image denoising method is executed by a computer, characterized in that, Includes the following steps: Acquire training sample image data, which includes training noisy images and training denoised images; An initial image denoising model is constructed, which is composed of a U-Net network and a width learning system, wherein the output of the U-Net network is connected to the input of the width learning system; The initial image denoising model is trained based on the training noisy image and the training denoised image to obtain the target image denoising model; The image to be denoised is processed based on the target image denoising model to obtain a denoised image. The step of training the initial image denoising model based on the training noisy image and the training denoised image includes: The training noisy images are encoded based on the U-Net network to extract image features; The image features are decoded based on the U-Net network to obtain image enhancement features; The image enhancement features are semantically classified to obtain semantic classification results; The semantic classification result is determined as a feature node, and the feature node is subjected to a nonlinear transformation based on the width learning system to obtain enhanced nodes; the nonlinear transformation based on the width learning system includes: in, ,express arrive A set; Represents a nonlinear activation function; Indicates the weighting coefficient. Indicates deviation; The feature node and the enhancement node are connected to the output of the width learning system to obtain the image denoising function; The output weights of the image denoising function are calculated based on the trained denoised image.
2. The image denoising method according to claim 1, characterized in that, The encoding process of the training noisy image based on the U-Net network includes: The training noisy image is convolved to obtain the first image feature; The first image features are sequentially downsampled and convolutionally processed to obtain the second image features; The second image features are then subjected to downsampling and convolution operations in sequence to obtain the third image features; The third image features are then subjected to downsampling and convolution operations in sequence to obtain the fourth image features; The fourth image feature is then subjected to downsampling and convolution operations in sequence to obtain the fifth image feature.
3. The image denoising method according to claim 2, characterized in that, The decoding process of the image features based on the U-Net network includes: An upsampling operation is performed on the fifth image feature to obtain a first upsampling result; the first upsampling result and the fourth image feature are subjected to feature mapping concatenation processing to obtain a first fusion feature; the first fusion feature is subjected to convolution processing to obtain a first image enhancement feature; The first image enhancement feature is upsampled to obtain a second upsampled result; the second upsampled result and the third image feature are concatenated by feature mapping to obtain a second fused feature; the second fused feature is convolved to obtain a second image enhancement feature. The second image enhancement feature is upsampled to obtain a third upsampled result; the third upsampled result and the second image feature are concatenated using feature mapping to obtain a third fused feature; the third fused feature is convolved to obtain a third image enhancement feature. An upsampling operation is performed on the third image enhancement feature to obtain a fourth upsampling result; the fourth upsampling result and the first image feature are concatenated by feature mapping to obtain a fourth fusion feature; a convolution operation is performed on the first fusion feature to obtain a fourth image enhancement feature.
4. The image denoising method according to claim 3, characterized in that, The semantic classification of the image enhancement features includes: Based on a preset convolution kernel, a convolution operation is performed on the enhanced features of the fourth image to obtain a semantic classification result; The expression for the semantic classification result is: in, Indicates the first i One semantic classification result; This indicates that a 1×1 convolution operation is performed; This indicates the enhanced features of the fourth image.
5. The image denoising method according to claim 1, characterized in that, The expression for the image denoising function is: in, Y This represents the denoised image output by the model. This indicates the output weights.
6. The image denoising method according to claim 1, characterized in that, Also includes: Acquire test sample image data, which includes test noisy images and test denoised images; The test sample image data is denoised based on the target image denoising model to obtain an initial denoised image. The target image denoising model is tested and evaluated based on the test denoised image and the initial denoised image.
7. The image denoising method according to claim 6, characterized in that, The testing and evaluation of the target image denoising model includes: The evaluation index data of the initial denoised image and the test denoised image are obtained, and the evaluation index data includes peak signal-to-noise ratio and structural similarity. Peak signal-to-noise ratio score and structural similarity score are calculated based on preset weights; The test evaluation score is calculated based on the peak signal-to-noise ratio score and the structural similarity score. If the test evaluation score is greater than or equal to the preset score, then the target image denoising model is determined to have passed the test; If the test evaluation score is less than the preset score, the initial image denoising model is retrained.
8. An image denoising system, applied to the image denoising method as described in claim 1, characterized in that, The system includes: The data acquisition module is configured to acquire training sample image data, which includes training noisy images and training denoised images; The model building module is configured to build an initial image denoising model, which is constructed from a U-Net network and a width learning system, with the output of the U-Net network connected to the input of the width learning system. The model training module is configured to train the initial image denoising model based on the training noisy image and the training denoised image to obtain the target image denoising model; The image denoising module is configured to perform denoising processing on the image to be denoised based on the target image denoising model to obtain a denoised image.
Citation Information
Patent Citations
Image fusion denoising method and system based on U-Net and pyramid module
CN112801909A
Cryoelectron microscope image denoising method and system based on deep learning
CN116205807A