Computational ghost imaging reconstruction and restoration method based on Resnet network

By using the Hadamard matrix and spatial attention mechanism in the Resnet network, the problem of insufficient image details and spatial consistency in computational ghost imaging reconstruction and recovery is solved, achieving more efficient reconstruction effects and speeds, avoiding the vanishing gradient phenomenon, and improving The generalization ability of the network.

CN113379614BActive Publication Date: 2024-09-17XIAN UNIV OF TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110346568.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-03-31
Publication Date
2024-09-17
Estimated Expiration
2041-03-31

AI Technical Summary

Technical Problem

Existing computational ghost imaging reconstruction and restoration methods have deficiencies in image detail recovery and spatial consistency, and deep learning networks are prone to gradient disappearance during the training process, resulting in poor results.

Method used

A computational ghost imaging reconstruction and recovery method based on the Resnet network is adopted. By training the network on the MNSIT data set, the Hadamard matrix is ​​used as an improved random phase mask, and the instance layer and depth feature layer are added to the network structure, combined with the pixel space attention mechanism. Perform multi-scale feature fusion and reduce the number of random phase masks to 5%.

Benefits of technology

It significantly improves the reconstruction effect and reconstruction speed of computational ghost imaging, enhances the generalization ability of the network, avoids the vanishing gradient problem, and improves the accuracy and spatial consistency of image detail recovery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113379614B
    Figure CN113379614B
Patent Text Reader

Abstract

The present invention provides a method for ghost imaging restoration based on a Resnet network. First, based on the MNSIT data set, the computational ghost imaging is obtained by using the Hadamard matrix as an improved random phase mask. Secondly, the structure of the Resnet network is adjusted, and an instance layer is added on the original basis, and the depth of the network and the depth of the feature layer are increased. A large number of computational ghost imaging images and their original images are used to train the network, and finally the generalization effect of the experiment is obtained in the test set. The method can effectively improve the reconstruction effect of computational ghost imaging and increase the reconstruction speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of quantum imaging and artificial intelligence, and in particular relates to a computational ghost imaging reconstruction and restoration method based on a Resnet network. Background Art

[0002] In recent years, the reconstruction and restoration of ghost imaging has received widespread attention. Computational ghost imaging is a classic light field ghost imaging that uses computational holography to generate a known correlated light field, eliminating the idle light path for detecting the light field distribution, making the optical system structure simpler, more resistant to external interference, and more efficient in image reconstruction. Computational ghost imaging not only inherits the important characteristics of ghost imaging in terms of imaging principles, but also has more important practical application value than two-photon pair ghost imaging and pseudo-heat source ghost imaging. Ghost imaging technology is currently moving from experimental research to practical application, and has important application value in many fields, such as high-resolution lithography, cryptography, stealth technology, radar imaging, etc.

[0003] The traditional method of restoring ghost images is through compressed sensing. Compressed sensing uses a low-dimensional observation method and takes advantage of the sparse characteristics of the signal (that is, a small number of linear projections of the signal contain enough information for reconstruction). The signal reconstruction process is to obtain a sparse decomposition of the observation vector Y in the corresponding measurement matrix. The signal X to be solved is the coefficient vector of the decomposition. Compressed ghost imaging technology can better reconstruct the target image under the premise of small measurement data. It allows a containing N 2 The number of measurements of an image with pixels is less than N 2 Second, if the random speckle intensity function I i (x,y) is converted to a row vector, denoted as Ir i , convert the distribution function of the target image w(x,y) into a column vector T c , then the light intensity B received by the bucket detector i It can be expressed as:

[0004] B i =Ic i ×T c (1)

[0005] In order to reconstruct the original image information from the measurements, the optimization problem of finding a sparse solution must be solved. In other words, if the column vector T c is sparse, then the reconstruction algorithm can be used to obtain the row vector Ir i And the light intensity B i Recover from T c At present, many effective methods have been proposed to solve this problem, such as matching pursuit (MP), orthogonal matching pursuit (OMP), SL0 algorithm, etc.

[0006] Since 2012, convolutional neural networks (CNN) have developed rapidly in the field of image processing, breaking through many bottlenecks that traditional methods cannot solve, and have been successfully applied in many industries. Long et al. (2014) transformed the CNN structure into a fully convolutional neural network, completed the classification of each pixel through the convolution and deconvolution process, and proposed the image semantic segmentation algorithm of fully convolutional neural networks (FCN), which made a breakthrough in image segmentation. However, FCN is not sensitive to the details in the image due to multiple downsampling, and does not fully consider the relationship between pixels and lacks spatial consistency. U-Net is a segmentation network proposed by Ronneberger et al. (2015) when participating in the ISBI competition. The network structure adopts the method of fusing multi-scale features in the upsampling process, which can better retain the detailed features of the image. At the same time, its network structure is small, which can not only adapt to a very small training set, but also has a relatively fast network training and prediction speed. Conventional deep learning networks will experience gradient vanishing when they are very deep, and the network training effect will deteriorate, but the recognition effect of shallow networks cannot be significantly improved. Summary of the invention

[0007] The present invention provides a computational ghost imaging reconstruction and restoration method based on a Resnet network, which can effectively improve the reconstruction effect of computational ghost imaging and increase the reconstruction speed.

[0008] The technical solution of the present invention is a computational ghost imaging reconstruction and restoration method based on a Resnet network. Firstly, based on an MNSIT data set, a computational ghost imaging is obtained by using a Hadamard matrix as an improved random phase mask. Secondly, the structure of the residual network is adjusted by adding an instance layer and increasing the depth of the network and the depth of the feature layer on the original basis. The computational ghost imaging images and their original images are used to train the network. Finally, the generalization effect of the experiment is obtained in a test set.

[0009] The specific steps are as follows:

[0010] Step 1, obtain the MNSIT dataset, and obtain the ghost imaging image dataset of the MNSIT dataset according to the fully connected structure;

[0011] Step 2: Make the MNSIT dataset into the dataset we need through step 1, and we train the Resnet network on these datasets respectively;

[0012] Step 3: Multi-scale feature fusion through pixel-based spatial attention mechanism;

[0013] Step 4, test the data on the test set and compare the results. We can reduce the number of random phase masks to 5%.

[0014] In step 1: the ghost imaging O(x,y) result is expressed by the following formula:

[0015] O(x,y)=<δSδI r (x,y)> (2),

[0016] In formula (2), <·> is the ensemble average,

[0017]

[0018]

[0019] In formula (3), B r It can be obtained through the bucket detector,

[0020]

[0021] In formula (5), z represents the propagation distance of light, λ is the wavelength of the laser, and E r is the complex amplitude of the SLM.

[0022]

[0023] In formula (6) is a random phase mask. Here our random phase mask is generated by a random Hadamard matrix.

[0024]

[0025] The final result of ghost imaging O(x,y) is expressed by formula (7).

[0026] In step 2: the Resnet network is trained on the data set obtained in step 1. The process of the computational ghost imaging reconstruction and restoration method based on the Resnet network is as follows:

[0027] The input x is convolved. The Conv module is a convolution module, which contains a convolution layer, a normalization layer and an activation function. The input is first convolved, then regularized, and finally the activation function is used. The above operations are cycled to form the module process.

[0028] The activation function is the relu function.

[0029] In step 2: the formula for regularization is

[0030]

[0031] Where γ and β are hyperparameters.

[0032] In step 2: Since very deep networks are difficult to train and suffer from gradient vanishing and gradient exploding problems, we learn skip connection, which can obtain activation from a certain layer and then quickly feed back to another layer or even deeper layers. We use skip connection to build a residual network Resnet to train deeper networks; skip connection is to connect adjacent network layers by concat.

[0033] In step 3: first, the original features of the object are mapped to low dimensions through global pooling and each feature is represented. The feature layer of interest is selected through adaptive selection of low-dimensional features. The obtained feature layer of interest is combined with the low-dimensional abstract object mask of the original feature to obtain the adaptively selected object mask of interest. Secondly, the pixel-level mask of interest is selected through the attention mechanism. Through these two parts, each pixel of different features can be located and selected, and finally the original features are spatially focused at the pixel level.

[0034] The invention discloses a computational ghost imaging reconstruction and restoration method based on a Resnet network. The computational ghost imaging reconstruction and restoration method based on a Resnet network first obtains computational ghost imaging based on an MNSIT data set by using a Hadamard matrix as an improved random phase mask, and then adjusts the structure of the residual network, adds an instance layer on the original basis, increases the depth of the network and the depth of the feature layer, and uses computational ghost imaging images and their original images to train the network, and finally obtains the generalization effect of the experiment in a test set. The method can effectively improve the reconstruction effect of computational ghost imaging and improve the reconstruction speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 It is a fully connected structure diagram adopted by the computational ghost imaging reconstruction and restoration method based on the Resnet network of the present invention;

[0036] Figure 2 It is a basic device for calculating ghost imaging adopted by the calculation ghost imaging reconstruction and restoration method based on the Resnet network of the present invention;

[0037] Figure 3 It is a flowchart of computational ghost imaging reconstruction and restoration based on a Resnet network adopted by the computational ghost imaging reconstruction and restoration method based on a Resnet network of the present invention;

[0038] Figure 4is a Resnet network structure diagram adopted by the computational ghost imaging reconstruction and restoration method based on the Resnet network of the present invention;

[0039] Figure 5 1 is a structural diagram of a convolution module used in the computational ghost imaging reconstruction and restoration method based on the Resnet network of the present invention;

[0040] Figure 6 It is the structure of the pixel-based spatial attention mechanism adopted by the computational ghost imaging reconstruction and restoration method based on the Resnet network of the present invention;

[0041] Figure 7 are images of ghost imaging obtained by different methods adopted by the computational ghost imaging reconstruction and restoration method based on the Resnet network of the present invention, wherein N is the number of random phase masks;

[0042] Figure 8 It is the reconstructed image result obtained by the ghost imaging result obtained by 5% random phase mask selected from the test set of the embodiment of the computational ghost imaging reconstruction and restoration method based on the Resnet network of the present invention. The leftmost is the input of the network, the middle is the true value, and the right is the reconstruction result. DETAILED DESCRIPTION

[0043] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.

[0044] Step 1: Follow the steps below Figure 1 The apparatus shown obtains ghost imaging images.

[0045] The ghost imaging O(x,y) result is expressed by the following formula: O(x,y)=<δSδI r (x,y)>(2), where <·> is the ensemble average, In formula (3), B r It can be obtained through the bucket detector, In formula (5), z represents the propagation distance of light, λ is the wavelength of the laser, and Er is the complex amplitude of the SLM. In formula (6) is a random phase mask. Here our random phase mask is generated by a random Hadamard matrix. The final ghost imaging result is expressed by formula (7).

[0046] Step 2: Make the MNSIT dataset into the dataset we need through step 1. We train the Resnet network on these datasets. The network structure of Resnet is as follows: Figure 4 shown.

[0047] Each Conv module in the figure contains a convolution layer, a normalization layer and an activation function. The activation function here is the relu function. The formula for normalization is: γ and β are both hyperparameters. The skip connection in the figure is connected by concat, which ensures that we do not lose too much information when performing deep convolution operations.

[0048] Step 3: Multi-scale feature fusion is performed through a pixel-based spatial attention mechanism, such as Figure 6 As shown, first, the original features of the object are mapped to low dimensions through global pooling and each feature is represented. In this stage, the feature layer of interest is selected through adaptive selection of low-dimensional features, and the obtained feature layer of interest is combined with the low-dimensional abstract object mask of the original feature to obtain the adaptively selected object mask of interest. On this basis, the pixel-level mask of interest is selected through the attention mechanism. Through these two parts, each pixel of different features can be located and selected, and finally the original features are spatially focused at the pixel level.

[0049] Step 4: Test the data on the test set and compare the results.

[0050] By applying the above method, we can reduce the number of random phase masks to 5% and obtain good results.

[0051] Example

[0052] First, we use the Hadamard matrix as an improved random phase mask and obtain training data for different groups of networks by changing the number of random phase masks. Then we divide each training set into two categories. First, the training set is 60,000 images and the test set is 10,000 images. Then, we use the training set in the training data of each group of networks to train the network, and the validation set to train the hyperparameters. Finally, we verify the generalization effect of the network in the test set.

[0053] The specific steps include:

[0054] Step 1: Follow the steps below Figure 1 The apparatus shown obtains ghost imaging images.

[0055] The ghost imaging O(x,y) result is expressed by the following formula: O(x,y)=<δSδI r (x,y)>(2), where <·> is the ensemble average, In formula (3), B r It can be obtained through the bucket detector, In formula (5), z represents the propagation distance of light, λ is the wavelength of the laser, and E r is the complex amplitude of the SLM. In formula (6) is a random phase mask. Here our random phase mask is generated by a random Hadamard matrix. The final ghost imaging result is expressed by formula (7). The result obtained is Figure 5 As shown in the figure, it can be seen that when the sampling rate is the same, the ghost imaging results based on the random Hadamard matrix are significantly better than those based on the random phase mask. When the sampling number is 430, the results based on the random Hadamard matrix are similar to those based on the random matrix with a sampling rate of 784.

[0056] Step 2: Based on the MNSIT dataset (http: / / yann.lecun.com / exdb / mnist / ), the dataset of this network is obtained through step 1. The Resnet network is trained on this dataset. The flowchart of ghost imaging reconstruction based on the Resnet network is as follows: Figure 2 The specific process is as follows:

[0057] Step 2.1: Divide the data set obtained by formula (1) into a training set of 60,000 images and a test set of 10,000 images.

[0058] The 60,000 data in the training set and the 10,000 data in the test set are used to generate ghost imaging reconstruction results with a sampling rate of 5%.

[0059] The 60,000 data in the training set and the 10,000 data in the test set are low-pass filtered. The specific processing method is to perform Gaussian low-pass filtering on the original image.

[0060] The 60,000 data in the training set and the 10,000 data in the test set are subjected to edge filtering detection. The specific processing method is to perform edge detection on the original image using the Canny edge detection algorithm.

[0061] Step 2.2: Build Figure 3 The same Resnet network structure is used, and all parameters in the initial network are initialized. The first 49 layers in the Resnet50 network are used as the feature extraction network.

[0062] Divide Resnet50 into five modules and save them separately. Perform convolution operation on our first module, where the convolution kernel size is 7*7 and the step size is 1, and then downsample through the maximum pooling layer.

[0063] Save the result of the first module in the layer.

[0064] Step 2.3 First input the image to be input into the network.

[0065] (2.3.1) The first module first makes a backup copy of the input x called short_skip.

[0066] The convolution module is operated on the input x, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 32, and then a BN and a relu are performed.

[0067] Then perform the convolution module operation on the result of the previous step, where the size of the convolution kernel is 3*3, the step size is 1, the number of features is 32, and then perform a BN and a relu.

[0068] Finally, the result of the previous step is subjected to the convolution module operation, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 64, and then a BN and a relu are performed.

[0069] Perform a convolution module operation on the previously backed up short_skip, where the convolution kernel size is 1*1, the step size is 1, the number of features is 64, and then perform a BN.

[0070] Add the result to the results of the previous three convolutions, perform a relu at last, and back up the result as block_1.

[0071] (2.3.2) The second module first makes a backup copy of the input x called short_skip.

[0072] The convolution module is operated on the input x, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 64, and then a BN and a relu are performed.

[0073] Then perform the convolution module operation on the result of the previous step, where the size of the convolution kernel is 3*3, the step size is 1, the number of features is 64, and then perform a BN and a relu.

[0074] Finally, the result of the previous step is subjected to the convolution module operation, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 128, and then a BN and a relu are performed.

[0075] Perform a convolution module operation on the previously backed up short_skip, where the convolution kernel size is 1*1, the step size is 1, the number of features is 128, and then perform a BN.

[0076] Add the result to the results of the previous three convolutions, perform a relu at last, and back up the result as block_2.

[0077] (2.3.3) The third module first makes a backup copy of the input x called short_skip.

[0078] The convolution module is operated on the input x, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 64, and then a BN and a relu are performed.

[0079] Then perform the convolution module operation on the result of the previous step, where the size of the convolution kernel is 3*3, the step size is 1, the number of features is 64, and then perform a BN and a relu.

[0080] Finally, the result of the previous step is subjected to the convolution module operation, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 128, and then a BN and a relu are performed.

[0081] Perform a convolution module operation on the previously backed up short_skip, where the convolution kernel size is 1*1, the step size is 1, the number of features is 128, and then perform a BN.

[0082] Add the result to the results of the previous three convolutions, perform a relu at last, and back up the result as block_3.

[0083] (2.3.4) The fourth module first makes a backup copy of the input x called short_skip.

[0084] The convolution module is operated on the input x, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 256, and then a BN and a relu are performed.

[0085] Then perform the convolution module operation on the result of the previous step, where the size of the convolution kernel is 3*3, the step size is 1, the number of features is 256, and then perform a BN and a relu.

[0086] Finally, the result of the previous step is subjected to the convolution module operation, where the size of the convolution kernel is 1*1, the step size is 1, the number of features is 512, and then a BN and a relu are performed.

[0087] Perform a convolution module operation on the previously backed up short_skip, where the convolution kernel size is 1*1, the step size is 1, the number of features is 512, and then a BN is performed.

[0088] Add the result to the results of the previous three convolutions, perform a relu at last, and back up the result as block_4.

[0089] (2.3.5) Input the result layer, block_1, block_2, block_3, block_4 into the Pixel-level Spatial Attention module.

[0090] Step 2.4: Perform multi-scale feature fusion on the features obtained above.

[0091] Step 2.5: The obtained features are reconstructed for low-frequency information and edge information. The two network framework models at this stage are the same, but they are trained separately. The information obtained after training the low-frequency information reconstruction network is recorded as gene_Iow_fre, the low-frequency information obtained directly from the object is recorded as Iow_fre, and the high-frequency information is recorded as high_fre. The information after training the edge information reconstruction network is recorded as gene_high_fre. L2 (gene_Iow_fre, Iow_fre) is used as the loss function of the low-frequency network, and L2 (gene_high_fre, high_fre) is used as the loss function of the high-frequency information to train the two networks respectively. Finally, the two networks obtain the low-frequency information and high-frequency information of 5% ghost imaging respectively.

[0092] Step 2.6: Perform feature fusion on the low-frequency information and high-frequency information of the 5% ghost image obtained in the previous step, and use the fused result as the input of the image reconstruction network. Finally, the l2 loss of the image gene generated by the network and the original image object is used as the loss of the generated network.

[0093] Step 2.7: Calculate the overall loss function of the network as loss = 10*l2(gene,object)+L2(gene_Iow_fre,Iow_fre)+L2(gene_high_fre,high_fre).

[0094] In the network of step 2.3, the operation of the convolution module is described as Figure 4 As shown in the figure, the specific description is as follows: the input passes through a convolution layer with given parameters, and then a BN normalization layer. After BN, the mean of the output of each batch at the same feature layer is 0 and the variance is 1, which can effectively avoid the gradient disappearance and speed up the training process. Finally, it passes through an activation function layer. For the activation function layer, except for the last convolution module, the activation function layer of other convolution modules is the relu activation function, and the activation function layer of the last convolution module is the sigmoid activation function.

[0095] The formula for instance regularization is: Where γ and β are hyperparameters.

[0096] In step 2.2, we use max pooling to downsample the image. We use convolution with max_pooling and stride 2 for pooling, select the largest value in the pooling_size area, and downsample according to the stride. We use convolution with stride 2 to avoid information loss in the max_pooling method.

[0097] In the fully connected module of the Resnet network, all parameters in the one-dimensional array are associated to achieve the full connection operation of the network. The formula for full connection is a=WX+b. Figure 1 This is a fully connected structure diagram:

[0098] Step 3: Multi-scale feature fusion is performed through a pixel-based spatial attention mechanism. First, the original features of the object are mapped to a low dimension through global pooling and each feature is represented. In this stage, the feature layer of interest is selected through the adaptive selection of low-dimensional features. The obtained feature layer of interest is combined with the low-dimensional abstract object mask of the original feature to obtain the adaptively selected object mask of interest. On this basis, the pixel-level mask of interest is selected through the attention mechanism. Through these two parts, each pixel of different features can be located and selected, and finally the original features are focused at the spatial pixel level.

[0099] Step 4: Test the data on the test set and compare the results.

[0100] By applying the above method, we can reduce the number of random phase masks to 5% and obtain good results.

[0101] Figure 7 are the ghost imaging images obtained by different methods, where N is the number of random phase masks. The reconstruction results in the test set with 5% phase masks are as follows: Figure 8 As shown, the first one is the true value of the image, the second one is the ghost imaging image with a sampling rate of 5% generated based on the Hadamard matrix, the third one is the edge information of the original image, the fourth one is the 5% ghost imaging reconstructed edge information obtained by neural network training, the fifth one is the low-frequency information of the original image, and the sixth one is the 5% ghost imaging reconstructed low-frequency information obtained by neural network training.

Claims

1. Computational ghost imaging reconstruction and restoration method based on Resnet network, It is characterized in that Firstly, based on the MNSIT dataset, the ghost images are calculated by using the Hadamard matrix as an improved random phase mask. Secondly, the structure of the residual network is adjusted by adding an instance layer and increasing the depth of the network and the feature layer. The network is trained using the calculated ghost images and their original images. Finally, the generalization effect of the experiment is obtained in the test set. The specific steps are as follows: Step 1, obtain the MNSIT dataset, and obtain the ghost imaging image dataset of the MNSIT dataset according to the fully connected structure; Step 2, training the Resnet network on the ghost imaging image dataset obtained in step 1; The process of the computational ghost imaging reconstruction and restoration method based on the Resnet network is: The input x is convolved. The Conv module is a convolution module. This module contains a convolution layer, a normalization layer and an activation function. First, the input is convolved, then regularized, and finally the activation function is used. The above operations are repeated in this module process. The activation functions used in the above process are all relu functions; The formula for regularization is in and These are all hyperparameters; Since very deep networks are difficult to train and suffer from gradient vanishing and gradient exploding problems, learning skip connection can obtain activation from a certain layer and then quickly feed back to another layer or even deeper layers. Using skip connection to build residual network Resnet to train deeper networks; skip connection is to connect adjacent network layers in a concat way; Step 3: Multi-scale feature fusion through pixel-based spatial attention mechanism; The specific steps are as follows: First, the original features of the object are mapped to low dimensions through global pooling and each feature is represented. The feature layer of interest is selected through adaptive selection of low-dimensional features. The obtained feature layer of interest is combined with the low-dimensional abstract object mask of the original feature to obtain the adaptively selected object mask of interest. Secondly, the pixel-level mask of interest is selected through the attention mechanism. Through these two parts, each pixel of different features can be located and selected, and finally the original features are spatially focused at the pixel level; Step 4, test the data on the test set and compare the results. We can reduce the number of random phase masks to 5%.

2. According to the Resnet network-based computational ghost imaging reconstruction and restoration method of claim 1, It is characterized in that In step 1: the ghost imaging O(x, y) result is expressed by the following formula: In formula (2) is the ensemble average; In formula (3) This can be derived through the bucket detector; In formula (5) represents the distance light travels, is the wavelength of the laser, is the complex amplitude of the SLM; In formula (6) is a random phase mask, where the random phase mask is generated by a random Hadamard matrix; The final result of ghost imaging O(x,y) is expressed by formula (7).