Torch smoke image super-resolution method based on deep convolutional neural network
Technical Field
The invention relates to the field of torch smoke image processing, in particular to a torch smoke image super-resolution method based on a deep convolutional neural network.
Background
With the standardized development of petrochemical plants and the gradual increase of natural gas processing plants, the flare system is an indispensable supporting facility. In this system, fumes are a macroscopic form of many polymers and solid carbon particles produced when fuel combustion is inadequate, causing serious pollution to the atmosphere and even more serious accidents. Ensuring the quality of flare combustion is a primary task of the flare system. In general, the construction of the flare is very high to meet the requirements of the manufacturing process and environmental protection, and conventional sensors cannot be located in close proximity to the flare tip for extended periods of time to avoid damage to the sensor from high temperatures. The remotely acquired images of torch smoke are therefore of lower resolution, which makes accurate detection of smoke generated by inadequate combustion of the torch a difficult problem for torch systems.
One of the methods for converting an image from a blurred image to a sharp image is super-resolution processing from low resolution to high resolution. Super-resolution of a single image is a classical problem in computer vision. Most of the latest super-resolution technical methods for single images are designed based on the structural features of natural images. The super-resolution method at the present stage is briefly described as follows: the image interpolation method based on the non-local autoregressive mode can effectively reconstruct an edge structure and inhibit sawtooth artifacts, thereby realizing a better image interpolation result; the super-resolution sparse blending estimator provides a class of nonlinear inverse estimators obtained by an adaptive blending method of a linear estimator; studies of image statistics show that image patches can be well represented as sparse linear combinations of elements from a suitably chosen dictionary. Inspired by this observation, some papers look for a sparse representation at each small block of the low resolution input, and then use the coefficients of this representation to generate the high resolution output. Given that content may vary between different images or different patches in a single image, others consider learning various base sets from a pre-collected dataset of example image patches, then processing for a given patch, adaptively selecting base images to characterize local sparse domains, and so on. However, the above methods are proposed for the features of natural images, and what is emphasized in the torch combustion image is only the super-resolution effect of the smoke image, and further, a super-resolution algorithm dedicated to the smoke image is the key to solve the engineering problem.
One of the most common techniques to increase the resolution of an image is the interpolation of image pixels. Although easy to implement, this method still suffers from a number of drawbacks in visual quality, for example many details (e.g. sharp edges) cannot be recovered naturally. But the convolutional neural network can make up for the lack of detail information by extracting the feature information of the image. The basic deep convolutional neural network can be divided into 3 performance modules: extracting and characterizing image features, and carrying out nonlinear mapping and super-resolution image reconstruction.
Disclosure of Invention
Aiming at the engineering problem that smoke identification and analysis are greatly difficult due to the low resolution of a combustion image of a torch system, the invention designs a torch smoke image super-resolution method based on a deep convolutional neural network, and obtains a better result than a traditional super-resolution algorithm through mapping learning aiming at the super-resolution reconstruction of the smoke image.
The invention adopts the following technical scheme:
a super-resolution method for a torch smoke image utilizes a deep convolutional neural network to obtain a mapping relation from low resolution to high resolution of the torch smoke image based on end-to-end learning, and the resolution of the torch smoke image is improved.
Preferably, the method comprises the steps of:
step 1: the obtained torch smoke image is used as a training sample, and the training sample is preprocessed;
step 2: building a convolutional neural network model;
and step 3: setting training parameters, loss functions and an optimizer of the network;
and 4, step 4: and training the model by using the training sample, and reserving the optimal model as the model of the final practical application by setting a performance evaluation function.
Preferably, in step 2, a Keras deep learning library based on Tensorflow is used for building a convolutional neural network model.
Preferably, step 1 specifically comprises:
step 1.1: cutting the smoke image to obtain an image with all smoke contents;
step 1.2: converting the cut image into YCbCr color gamut, and extracting only Y channel to obtain single channel image required by training;
step 1.3: setting a super-resolution up-sampling multiple S, firstly down-sampling the image to 1/S of the original image through a Bicubic algorithm, then up-sampling the image by S times through the Bicubic algorithm to obtain an input I of the model, wherein the original image is a reference image of the model output and is set as O; different models with different enlarged sizes can be trained by setting different S;
step 1.4: and carrying out normalization processing on the image.
Preferably, in step 1.1, the size of the cropped image is 96mm by 96 mm.
Preferably, in step 1.3, S is set to 2, 3, 4 and 8, resulting in models with super-resolution magnification sizes of 2, 3, 4 and 8, respectively.
Preferably, in step 1.4, the normalization process is performed according to the following formula:
wherein x isnTo normalize the pixel value, xrFor the current pixel value, xminIs the minimum value of the image pixel, xmaxIs the image pixel maximum.
Preferably, the training parameters in step 3 are:
the training set is 1600 preprocessed smoke images, the verification set is 1600 other preprocessed smoke images, the test set is 100 preprocessed smoke images, the training set carries out weight updating by 32 images in each batch, the verification set carries out model performance evaluation by 100 images in each batch, and the total sample cycle is finished for 300 times.
Preferably, the loss function in step 3 is:
the loss function uses a keras built-in mean square error function MSE, and the formula is as follows:
wherein m and n are the number of pixels of the length and the width of the image respectively, P (i, j) is the pixel value with the index position (i, j) in the super-resolution image predicted by the model, and O (i, j) is the pixel value with the index position (i, j) in the original high-definition image.
Preferably, the optimizer in step 3 is:
using an Adam optimizer, the implementation is an Adam function implemented with keras built-in, and the learning rate is set to 0.0003.
Preferably, step 4 specifically includes:
performance evaluation function: the model performance evaluation function is peak signal-to-noise ratio (PSNR) and the formula is as follows:
wherein, MAX is the maximum value of pixels in the image, the larger the value of PSNR is, the better the image quality output by the model is, and the better the model is.
The invention has the beneficial effects that:
the invention provides a super-resolution method of a torch smoke image based on a deep convolutional neural network, which is based on end-to-end supervised learning of the deep convolutional neural network and realizes super-resolution recovery of the smoke image by performing end-to-end learning of a low-resolution to high-resolution mapping mode on the smoke image. Through experimental comparison, the super-resolution result of the method for the smoke area is better. The invention fills the blank of the engineering field of the super-resolution algorithm of the smoke region image aiming at the emptying torch image, and promotes the safe and environment-friendly combustion of the emptying torch system.
Drawings
Fig. 1 training sample illustration.
Fig. 2 is a schematic diagram of a super-resolution model based on a convolutional neural network.
Fig. 3 is detailed parameters of a super-resolution model based on a convolutional neural network.
Detailed Description
The following description of the embodiments of the present invention will be made with reference to the accompanying drawings:
with reference to fig. 1 to 3, the method utilizes a deep convolutional neural network to obtain a mapping relationship from low resolution to high resolution of the flare smoke image based on end-to-end learning, and improves the resolution of the flare smoke image.
The super-resolution method of the torch smoke image based on the deep convolutional neural network comprises the following steps:
step 1: the obtained torch smoke image is used as a training sample, and the training sample is preprocessed;
step 2: constructing a convolutional neural network model by using a Tensorflow-based Keras deep learning library;
and step 3: setting training parameters, loss functions and an optimizer of the network;
and 4, step 4: and training the model by using the training sample, and reserving the optimal model as the model of the final practical application by setting a performance evaluation function.
The principle of the method is as follows: a super-resolution model based on the convolutional neural network is designed according to the property of the convolutional neural network to effectively learn, extract and learn useful image features of a target, and the design principle of the model can be subdivided into the following four blocks:
extracting a simple feature map: in the super-resolution reconstruction process, simple features such as edges are emphasized, so the number of convolution kernels in the first layer should be as large as possible so as to extract more simple features required by reconstruction. The first layer extracts a large number of simple features such as edges, corners, curves, etc. through 64 filters with convolution kernel size 3 x 3.
Fusing the simple feature maps: the main purpose of this block is to combine the simple feature maps obtained in a non-linear way to obtain a feature map that is more favorable for restoring image details. The filter with the convolution kernel size of 1 x 1 does not fuse image space position information, but fuses characteristic map channels. Therefore, the second layer selects 32 filters with convolution kernel size 1 × 1 to fuse 64 simple feature maps extracted from the first layer according to the layers to obtain 32 comprehensive feature maps.
Depth extraction and fusion of feature maps: this block consists of three layers of convolutions, 16 filter layers with convolution kernel size 3 x 3, and 8 filter layers with convolution kernel size 1 x 1. Through the nonlinear mapping of three-layer convolution, the capability of the network for recovering image details is improved, the number of characteristic layers is further fused, and network parameters are reduced.
Restoration and reconstruction of image details: this block consists of three layers of convolutions, 8 filter layers with convolution kernel size 3 x 3, and 1 filter layer with convolution kernel size 5 x 5. The convolution of the first two layers further extracts features required by image detail recovery through nonlinear mapping, and redundant information is further reduced through setting of 8 filters, so that network parameters are reduced. And finally, carrying out nonlinear fusion on 8 layers of feature maps obtained from the previous layer through 1 filter layer with the convolution kernel size of 5 x 5 to obtain a single-channel super-resolution reconstructed image.
Further, step 1 specifically includes:
step 1.1: cutting the smoke image to obtain an image with the uniform size of 96mm by 96mm and the content of 96mm which is smoke;
step 1.2: converting the cut image into YCbCr color gamut, and extracting only Y channel to obtain single channel image required by training;
step 1.3: setting a super-resolution up-sampling multiple S, firstly down-sampling the image to 1/S of the original image through a Bicubic algorithm, then up-sampling the image by S times through the Bicubic algorithm to obtain an input I of the model, wherein the original image is a reference image of the model output and is set as O; training different models with different amplification sizes by setting different S, setting S as 2, 3, 4 and 8, and respectively obtaining models with super-resolution amplification sizes of 2, 3, 4 and 8;
step 1.4: carrying out normalization processing on the image, wherein the normalization processing formula is as follows:
wherein x isnTo normalize the pixel value, xrFor the current pixel value, xminIs the minimum value of the image pixel, xmaxIs the image pixel maximum.
Further, the programming environment of step 2 is the Windows10 os, and the computer core hardware is: two blocks of Inter (R) Xeon (R) E5-2683 v32.00GHz CPUs and two blocks of Nvidia GeForce GTX 1080 GPUs. The model was implemented by python3.5 language based on the Keras deep learning library at the tersorflow back end.
Further, training parameters, a loss function and an optimizer of the network are set in step 3.
Training parameters: the training set is 1600 preprocessed smoke images, the verification set is 1600 other preprocessed smoke images, the test set is 100 preprocessed smoke images, the training set carries out weight updating by 32 images in each batch, the verification set carries out model performance evaluation by 100 images in each batch, and the total sample cycle is finished for 300 times.
Loss function: the loss function uses a keras built-in mean square error function MSE, and the formula is as follows:
wherein m and n are the number of pixels of the length and the width of the image respectively, P (i, j) is the pixel value with the index position (i, j) in the super-resolution image predicted by the model, and O (i, j) is the pixel value with the index position (i, j) in the original high-definition image.
An optimizer: using an Adam optimizer, the implementation is an Adam function implemented with keras built-in, and the learning rate is set to 0.0003.
Further, step 4 specifically includes:
performance evaluation function: the model performance evaluation function is peak signal-to-noise ratio (PSNR) and the formula is as follows:
wherein, MAX is the maximum value of pixels in the image, the larger the value of PSNR is, the better the image quality output by the model is, and the better the model is.
Example 1
The invention carries out super-resolution processing on 100 smoke images and respectively obtains the results of RMSE and PSNR of 100 images, and the average value of the RMSE and the PSNR of 100 images is taken to compare the performance of the algorithm. The comparison algorithm comprises the traditional algorithms Bicubic, NARM and ScSR, and the super-resolution algorithm based on the convolutional neural network is SRCNN. According to the characteristics of the algorithm, the super-resolution results of 2 times are compared, and the comparison shows that the method has the best super-resolution effect on smoke, and the superiority is more obvious along with the increase of the magnification. The deployed represents the present method.
Table 1: comparison result of super-resolution 2-time result algorithm
Example 2
The invention carries out super-resolution processing on 100 smoke images and respectively obtains the results of RMSE and PSNR of 100 images, and the average value of the RMSE and the PSNR of 100 images is taken to compare the performance of the algorithm. The comparison algorithm comprises the traditional algorithms Bicubic, NARM and ScSR, and the super-resolution algorithm based on the convolutional neural network is SRCNN. According to the characteristics of the algorithm, the super-resolution results of 3 times are compared, and the comparison shows that the method has the best super-resolution effect on the smoke, and the superiority is more obvious along with the increase of the magnification. The deployed represents the present method.
Table 2: super-resolution 3-time result algorithm comparison result
Example 3
The invention carries out super-resolution processing on 100 smoke images and respectively obtains the results of RMSE and PSNR of 100 images, and the average value of the RMSE and the PSNR of 100 images is taken to compare the performance of the algorithm. The comparison algorithm comprises the traditional algorithms Bicubic, NARM and ScSR, and the super-resolution algorithm based on the convolutional neural network is SRCNN. According to the characteristics of the algorithm, the 4-time super-resolution results are compared, and the comparison shows that the method has the best super-resolution effect on the smoke, and the superiority is more obvious along with the increase of the magnification. The deployed represents the present method.
Table 3: 4 times result algorithm comparison result of super-resolution
Example 4
The invention carries out super-resolution processing on 100 smoke images and respectively obtains the results of RMSE and PSNR of 100 images, and the average value of the RMSE and the PSNR of 100 images is taken to compare the performance of the algorithm. The comparison algorithm comprises the traditional algorithms Bicubic, NARM and ScSR, and the super-resolution algorithm based on the convolutional neural network is SRCNN. According to the characteristics of the algorithm, the 8-time super-resolution results are compared, and the comparison shows that the method has the best super-resolution effect on the smoke, and the superiority is more obvious along with the increase of the magnification. The deployed represents the present method.
Table 4: comparison result of super-resolution 8-time result algorithm
The algorithm of the above 4 embodiments comes from:
sources of algorithms Bicubic, NARM: W.Dong, L.Zhang, R.Lukac, G.Shi, "spark representation based Image interpolation with non-local auto-reactive modeling," IEEE Transactions on Image Processing, vol.22, No.4, pp.1382-1394, Apr.2013.
The source of the algorithm ScSR: yang, J.Wright, T.S.Huang, Y.Ma, "Image super-resolution video rendering," IEEE Transactions on Image Processing, vol.19, No.11, pp.2861-2873, Nov.2010.
Sources of the algorithm SRCNN: dong, C.L.Chen, K.He, X.Tang, "Learning a deep connected network for image super-resolution," Computer Vision C ECCV 2014, spring International Publishing, pp.184-199,2014.
It is to be understood that the above description is not intended to limit the present invention, and the present invention is not limited to the above examples, and those skilled in the art may make modifications, alterations, additions or substitutions within the spirit and scope of the present invention.