Phase unwrapping method based on deep learning semantic segmentation network
Through the phase unwrapping method of the deep learning semantic segmentation network and multi-information fusion module, the problem of low phase unwrapping accuracy in structured light three-dimensional measurement is solved, achieving higher measurement accuracy and noise robustness, and is suitable for a variety of optical imaging application.
Patent Information
- Application Number
- CN202410918667.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-10
- Publication Date
- 2024-09-27
AI Technical Summary
In existing structured light three-dimensional measurement technology, due to factors such as the measurement environment, object surface characteristics, and nonlinear errors of cameras and projectors, it is difficult to achieve high-precision phase expansion of the wrapped phase information of the deformation fringe pattern, affecting the three-dimensional measurement accuracy.
The phase unwrapping method based on the deep learning semantic segmentation network is used to generate a data set through the U-Net network and multi-information fusion module, combined with Zernike polynomials, and train the model to quickly and accurately solve the phase unwrapping problem and adapt to the noisy wrapped phase image. .
It significantly improves the accuracy of three-dimensional measurement and enhances the robustness to noise, and is suitable for the optical imaging research field of high-precision three-dimensional measurement and image segmentation.
Smart Images

Figure CN118709744A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of optical three-dimensional measurement, and in particular to phase unwrapping of deformation fringe patterns, and specifically relates to a phase unwrapping method based on a deep learning semantic segmentation network. Background Art
[0002] Structured light 3D measurement technology is the mainstream 3D measurement method at present. It has the advantages of non-contact measurement, high imaging accuracy, and fast reconstruction speed. It is widely used in industrial automatic inspection, reverse engineering, human body measurement, aerospace and other fields. Among them, phase measurement deflectometric method (PMD) is widely used in the field of optical 3D measurement because of its simple and low-cost characteristics. The principle is to project structured light onto the optical element to be measured. The change of the surface shape of the measured object will cause the phase and intensity of the light field to change. The CCD camera receives the modulated reflected (transmitted) light field. By performing phase unwrapping calculation on the received wrapped phase information of the deformation fringe pattern, the gradient of each point on the wavefront can be obtained, and then the wavefront shape can be inferred. However, in actual measurement, due to the limitations of factors such as the measurement environment, object surface characteristics, and nonlinear errors of the camera and projector, it is difficult to achieve high-precision phase unwrapping of the wrapped phase information of the deformation fringe pattern, and the 3D measurement accuracy is greatly affected.
[0003] High-precision phase unwrapping is an important prerequisite for object surface reconstruction and wavefront measurement. The wrapped phase is calculated by the inverse tangent function, so the phase information is truncated within the range of [-π, π). During the phase unwrapping process of structured light 3D measurement, due to factors such as the measurement environment, object surface characteristics, and nonlinear errors of the camera and projector, the integer order of the fringe is rounded incorrectly, resulting in a jump error of 2π in the unwrapped phase. If you want to reconstruct the 3D model of the object, all phases must be in the same period, so you need to perform phase unwrapping calculations on the wrapped phase, a process called phase unwrapping.
[0004] Phase unwrapping methods can be mainly divided into two categories: spatial phase unwrapping and temporal phase unwrapping. Spatial phase unwrapping only requires a wrapped phase image at any unspecified time to calculate the absolute phase, but this method can only be used for objects with smooth surfaces and simple contours, and must also meet the prerequisite of a high signal-to-noise ratio. This series of requirements restricts the application scenarios of spatial phase unwrapping. Spatial phase unwrapping mainly includes path tracking algorithms (branch cutting method, quality map-guided method, mask cutting method), minimum norm method (unweighted least squares method, weighted least squares method), etc. The principle of the path tracking algorithm is to unfold the phase according to a specific path and determine the best path based on the quality, while the minimum norm method solves the problem by converting it to the minimum norm. Summary of the invention
[0005] The purpose of the present invention is to solve the shortcomings of the prior art and propose a phase unwrapping method based on a deep learning semantic segmentation network. By fusing the semantic segmentation network U-Net and multi-information and through a large amount of training and model parameter adjustment, it can quickly and accurately solve the phase unwrapping problem, and can cope with the unwrapping problem of wrapped phase diagrams with more noise in actual environments.
[0006] The above purpose is achieved through the following technical solutions: A phase unwrapping method based on a deep learning semantic segmentation network, the method comprising the following steps: Step 1: Generate a data set based on Zernike polynomials using computer simulation software.
[0007] Zernike polynomials are a set of completely orthogonal polar coordinate polynomials expressed in radius and azimuth within the unit circle, so any image within the unit circle can be uniquely represented. Zernike polynomials have the same form as aberration polynomials, so they are often used to describe wavefront characteristics. Wavefront aberrations and surface errors can be expressed by Zernike polynomials.
[0008] The first 36 terms of the Zernike polynomial are used to generate the unwrapped phase data, which is mathematically expressed as: , in, is the generated unwrapped phase, Z j is the jth term of the Zernike polynomial, C j Its corresponding Zernike polynomial coefficients.
[0009] By converting the obtained unwrapped phase data from radians to angles, the corresponding wrapped phase data can be obtained. The specific conversion formula between the wrapped phase and the unwrapped phase is: , in, To wrap the phase, the angle function is a function that calculates the phase angle corresponding to the complex number. The range of the angle function is The function of i is an imaginary unit, and the wrapped phase must be an integer of one cycle, so the value cannot be ±π at the same time, so this is a half-open and half-closed interval.
[0010] Step 2: Divide the total data set into three parts in the ratio of 70%, 15%, and 15%, and set them as training set, validation set, and test set respectively.
[0011] Step 3: Based on the U-Net network, a U-shaped network including convolutional layers and pooling layers is built, and a multi-information fusion module is added to form a composite neural network model PMDU model.
[0012] Features at lower scales (high resolution) contain rich detail information, while features at higher scales (low resolution) contain more global context information. The translation invariance of the fully convolutional neural network and the existence of the pooling layer will lead to the loss of important information, while ignoring the association between global and local information. In order to better introduce more context information, the present invention proposes a new multi-information fusion module. This module fuses the feature maps generated by each layer of the encoding layer so that the extracted feature maps can carry both local and global context information.
[0013] The PMDU model includes a backbone feature extraction stage and an enhanced feature extraction stage. The backbone feature extraction stage includes a total of 6 coding layers, each of which is composed of two convolutional layers and one pooling layer. In the backbone feature extraction stage, a multi-information fusion module is added to the fifth coding layer, and the feature map obtained after the information obtained from the first five coding layers is fused and input into the first convolutional layer of the sixth coding layer. The utilization rate of global information is improved by the upper and lower layer information of feature maps of different sizes, so as to extract more image information and the intrinsic feature connection of the image.
[0014] In the backbone feature extraction stage, the convolution kernel size of the convolution layer is 3×3, the step size is 1 by default, and the convolution kernel size of the pooling layer is 2×2, the step size is 2, so the image size of each next layer of the coding layer will be reduced to 50% of the original. The multi-information fusion module adopts multi-level maximum pooling. In order to ensure the consistency of image size during multi-information fusion, the pooling factors are set to 8, 4, 2, and 1. By setting different pooling factors, the corresponding pooling step size is obtained without changing the number of channels in each layer. This module can obtain pooling results of the same scale (32 × 64). Subsequently, for the feature maps at the same scale, the feature channels are adjusted using 1×1 convolution and used as the input of the next layer. The setting of the pooling factor is used to capture the scale information features of the input parcel phase with different scales. The characteristics of the pooling factor from large to small enable the more obvious and fine-grained information features in the parcel phase feature map to be captured by the network model. Larger pooling factors (such as 8 and 4) are used to capture a wider range of contextual information, which helps to understand global features. Smaller pooling factors (such as 2 and 1) focus more on details and local features. Through multi-level pooling, feature maps can be integrated from different scales, which is very helpful for unwrapping phase tasks that need to consider both global and local details.
[0015] The multi-information fusion module aggregates contextual information by integrating feature maps of different scales in the encoding layer. Through the maximum pooling operation, it fully combines detail features (shallow convolution) and global features (deep convolution). This module eliminates the limitations of the feature extraction process in the encoding layer, adjusts the number of channels through 1×1 convolution and directly outputs, avoiding the problem of local information loss that may be caused during the feature extraction process of the encoding layer.
[0016] In the present invention, the multi-information fusion module is an important component of the improved UNet network, which plays a key role in improving the phase unwrapping accuracy, accelerating the solution speed, and enhancing the robustness to noise. By extracting features at multiple scales, local details and global information in the image can be captured. This is particularly important for the phase unwrapping process of the present invention, because it can enhance the network's sensitivity to features of different scales and extract more useful information.
[0017] In order to train deep neural networks, an activation function neural network is required that looks and behaves like a linear function, but is actually a nonlinear function that allows learning complex relationships in the data. The function must also provide more sensitive activation and input to avoid saturation.
[0018] The convolution layer uses the ReLU function as the activation function. The expression of the ReLU activation function is: , Where x is the function input, is the corresponding function output.
[0019] The ReLU function is linear for values greater than zero, which means that it has many desirable properties of a linear activation function when training a neural network using backpropagation. However, it is a nonlinear function because negative values are always output as zero. Since the rectifier function is linear in half of its input domain and nonlinear in the other half, it is called a piecewise linear function.
[0020] The enhanced feature extraction stage includes a total of 6 decoding layers, each decoding layer consists of an upsampling layer and two convolutional layers, where the convolution kernel size of the upsampling layer is 2×2 and the step size is 2, and the convolution kernel size of the convolution layer is 3×3 and the step size is 1 by default.
[0021] Step 4: Preprocess the package phase data in the training set. Use the preprocessed training set to perform model training on the PMDU model to obtain network model parameters of the PMDU model.
[0022] The preprocessing includes adding random noise to the image, inverting the image and other methods to preprocess the data of the training set. One or more methods can be combined for preprocessing. The training set can be expanded through preprocessing, and the image after adding random noise is closer to the actual wrapped phase image.
[0023] Through the conversion formula of the wrapped phase and the unwrapped phase, the unwrapped phase corresponding to the preprocessed and expanded wrapped phase is generated as the label information corresponding to the expanded wrapped phase in the training set, forming a complete expanded training set.
[0024] A processed training set is obtained, and the pre-processed training set is used to perform model training on the PMDU model.
[0025] Set the size of the input image to 256×256.
[0026] When training the PMDU model, the learning rate of the network is set to 0.0001, the number of iterations is set to 300, and the batch_size of each batch is set to 256.
[0027] During the model training process, the validation set is used to verify the effect of the current PMDU model after every 10 training batches, and the network model parameters of the PMDU model are gradually determined through iterative training.
[0028] Step 5: Use the wrapped phase data in the test set as the input of the PMDU model to preliminarily verify the phase unwrapping ability of the PMDU model for the real wrapped phase image.
[0029] The test set is used to test the phase unwrapping capability of the PMDU model. The wrapped phase data in the test machine is used as the input of the PMDU model. The wrapped phase data is phase unwrapped by the PMDU model to obtain the corresponding unfolded phase data output by the PMDU model. The unfolded phase data is compared with the corresponding unfolded phase data in the test set to preliminarily verify the phase unwrapping capability of the PMDU model for the wrapped phase image.
[0030] Step 6: Use the real wrapped phase image as the input of the PMDU model to finally verify the phase unwrapping ability of the PMDU model for the real wrapped phase image and determine the accuracy of the PMDU model.
[0031] A CCD camera is used to collect the deformation fringe pattern in the phase measurement profilometry process to obtain the real wrapped phase image. The collected real wrapped phase image is used as the input of the PMDU model. The PMDU model outputs the corresponding unwrapped phase image, which is compared with the real data and the traditional multi-frequency heterodyne phase unwrapping results to finally verify the phase unwrapping ability of the PMDU model for the real wrapped phase image and determine the accuracy of the PMDU model.
[0032] The beneficial effects of the present invention are as follows: the method proposed by the present invention combines the semantic segmentation network U-Net with the multi-information fusion module, and the method has a faster solution speed, higher accuracy, and stronger robustness to noise than the prior art. The method is particularly suitable for phase unwrapping of large noise phase images measured in phase deflectometry (PMD), which significantly improves the accuracy of three-dimensional measurement. The method can also be extended to other optical imaging research fields that require high-precision three-dimensional measurement and image segmentation, and has broad application prospects and development space. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] Figure 1 A flowchart of a phase unwrapping method based on a deep learning semantic segmentation network according to an embodiment of the present invention.
[0034] Figure 2 1 is a diagram of a neural network structure according to an embodiment of the present invention.
[0035] Figure 3 is a wrapped phase diagram of an embodiment of the present invention.
[0036] Figure 4 This is a phase unwrapping diagram obtained by using a phase unwrapping method of a PMD network model according to an embodiment of the present invention.
[0037] Figure 5 is a corresponding unwrapped phase diagram of an embodiment of the present invention.
[0038] Figure 6 is a true wrapped phase diagram of an embodiment of the present invention.
[0039] Figure 7 It is a phase unwrapping diagram corresponding to a real wrapped phase diagram obtained by a phase unwrapping method using a PMD network model according to an embodiment of the present invention. DETAILED DESCRIPTION
[0040] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. It should be pointed out that the embodiments described below are intended to facilitate the understanding of the present invention, rather than to limit the present invention, and the embodiments described are only part of the embodiments of the present invention, rather than all of the embodiments.
[0041] In some processes described in the specification and claims of the present invention and the above-mentioned drawings, multiple operations appearing in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. In addition, these processes may include more or fewer operations in combination with actual application scenarios, and of course these operations may also be executed in sequence or in parallel.
[0042] The hardware environment in this embodiment is as follows: the processor is Intel i9-12900kf, the number of cores is 16 cores, the number of threads is 24 threads, the memory is 48GB, the frequency is 4000MHz, the graphics card model is NVIDIA GeForce RTX 3090Ti, and the video memory is 24GB.
[0043] Software environment: operating system 64-bit Windows 10, deep learning environment: Python 3.8+ TensorFlow2.8.0.
[0044] According to the attached Figure 1 ~Attached Figure 7 In order to solve the phase unwrapping problem, the present invention provides a phase unwrapping method based on a deep learning semantic segmentation network, comprising the following steps: Step 1: Generate a data set using simulation software. Use the first 36 terms of the Zernike polynomial in MATLAB software to simulate and generate 100,000 pairs of different types of wrapped phase images and their corresponding unwrapped phase images. The image size is unified to 256×256.
[0045] The mathematical expression of Zernike polynomial is: , in, is the generated unwrapped phase, Z j is the jth term of the Zernike polynomial, C j Its corresponding Zernike polynomial coefficients.
[0046] By converting the obtained unwrapped phase data from radians to angles, the corresponding wrapped phase data can be obtained. The specific conversion formula between the wrapped phase and the unwrapped phase is: , in, To wrap the phase, the angle function is a function that calculates the phase angle corresponding to the complex number. The range of the angle function is The function of i is an imaginary unit, and the wrapped phase must be an integer of one cycle, so the value cannot be ±π at the same time, so this is a half-open and half-closed interval.
[0047] The data set includes different types of wrapped phase data and corresponding unwrapped phase data, and the wrapped phase data and the corresponding unwrapped phase data serve as input information and corresponding label information, respectively.
[0048] Step 2: randomly divide the data set into a training set, a validation set, and a test set. Divide the 100,000 pairs of wrapped phase images and their corresponding unwrapped phase images into a ratio of 70%, 15%, and 15%, corresponding to the training set, the validation set, and the test set, respectively.
[0049] Step 3: Based on the U-Net network, a U-shaped network including convolutional layers and pooling layers is built, and a multi-information fusion module is added to form a composite neural network model PMDU model.
[0050] The PMDU model includes a backbone feature extraction stage and an enhanced feature extraction stage. The backbone feature extraction stage includes 6 coding layers, each of which is composed of two convolutional layers and one pooling layer. The convolution kernel size of the convolution layer is 3×3 and the step size is 1 by default. The convolution kernel size of the pooling layer is 2×2 and the step size is 2.
[0051] In the backbone feature extraction stage, a multi-information fusion module is added to the 5th coding layer. The feature map obtained by fusing the information obtained from the first five coding layers is input into the first convolutional layer of the sixth coding layer. The upper and lower layer information of feature maps of different sizes is used to improve the utilization of global information, so as to extract more image information and the intrinsic feature connections of the image.
[0052] The multi-information fusion module uses multi-level maximum pooling, and uses different pooling factors to perform maximum pooling operations on each feature map. The different pooling factors are 8, 4, 2, and 1. By setting different pooling factors, the corresponding pooling step size is obtained without changing the number of channels in each layer. This module is used to adjust the size of the feature maps obtained by the first four coding layers so that the size of the feature maps obtained by the first four layers is consistent with the size of the feature maps of the fifth coding layer (32 × 64). Subsequently, for feature maps at the same scale, 1×1 convolution is used to adjust the feature channels and use them as the input of the next layer.
[0053] The enhanced feature extraction stage includes a total of 6 decoding layers, each decoding layer consists of an upsampling layer and two convolutional layers, where the convolution kernel size of the upsampling layer is 2×2 and the step size is 2, and the convolution kernel size of the convolution layer is 3×3 and the step size is 1 by default.
[0054] Step 4: Preprocess the package phase data in the training set. Use the preprocessed training set to perform model training on the PMDU model to obtain network model parameters of the PMDU model.
[0055] The training set is preprocessed using methods such as adding random noise to the image and inverting the image. The training set can be expanded through preprocessing, and the image after adding random noise is closer to the actual wrapped phase image.
[0056] Through the conversion formula of the wrapped phase and the unwrapped phase, the unwrapped phase corresponding to the preprocessed and expanded wrapped phase is generated as the label information corresponding to the expanded wrapped phase in the training set, forming a complete expanded training set.
[0057] A processed training set is obtained, and the pre-processed training set is used to perform model training on the PMDU model.
[0058] Set the size of the input image to 256×256.
[0059] When training the PMDU model, the learning rate of the network is set to 0.0001, the number of iterations is set to 300, and the batch_size of each batch is set to 256.
[0060] During the model training process, the validation set is used to verify the effect of the current PMDU model after every 10 training batches, and the network model parameters of the PMDU model are gradually determined through iterative training.
[0061] Step 5: Use the wrapped phase data in the test set as the input of the PMDU model to preliminarily verify the phase unwrapping ability of the PMDU model for the real wrapped phase image.
[0062] The test set is used to test the phase unwrapping capability of the PMDU model. The wrapped phase data in the test machine is used as the input of the PMDU model. The wrapped phase data is phase unwrapped by the PMDU model to obtain the corresponding unfolded phase data output by the PMDU model. The unfolded phase data is compared with the corresponding unfolded phase data in the test set to preliminarily verify the phase unwrapping capability of the PMDU model for the wrapped phase image.
[0063] Step 6: Use the real wrapped phase image as the input of the PMDU model to finally verify the phase unwrapping ability of the PMDU model for the real wrapped phase image and determine the accuracy of the PMDU model.
[0064] A CCD camera is used to collect the deformation fringe pattern in the phase measurement profilometry process to obtain the real wrapped phase image. The collected real wrapped phase image is used as the input of the PMDU model. The PMDU model outputs the corresponding unwrapped phase image, which is compared with the real data and the traditional multi-frequency heterodyne phase unwrapping results to finally verify the phase unwrapping ability of the PMDU model for the real wrapped phase image and determine the accuracy of the PMDU model.
Claims
1. A phase unwrapping method based on a deep learning semantic segmentation network, characterized in that: The steps include: (1) using computer simulation software to generate a data set according to Zernike polynomials, wherein the data set includes wrapped phase data and corresponding unwrapped phase data, and the wrapped phase data and the unwrapped phase data are used as input information and corresponding label information, respectively; (2) randomly dividing the data set into a training set, a validation set, and a test set; (3) Based on the U-Net network, a U-shaped network including convolutional layers and pooling layers is built, and a multi-information fusion module is added to form a composite neural network model PMDU model. The PMDU model includes a main feature extraction stage and an enhanced feature extraction stage. The main feature extraction stage consists of 6 coding layers, each of which includes two convolutional layers and a pooling layer. The two convolutional layers are the first convolutional layer and the second convolutional layer. In order to extract more image information and the intrinsic feature connection of the image, a multi-information fusion module is added to the fifth coding layer in the main feature extraction stage, and the feature map obtained by fusing the information obtained from the first five coding layers is input into the first convolutional layer of the sixth coding layer. (4) preprocessing the wrapped phase data in the training set, wherein the preprocessing includes one or more of adding random noise to the image and inverting the image, to obtain a processed training set, and using the preprocessed training set to perform model training on the PMDU model to obtain network model parameters of the PMDU model; (5) using the wrapped phase data in the test set as the input of the PMDU model to perform phase unwrapping on the wrapped phase data in the test set, obtaining the corresponding unwrapped phase data output by the PMDU model, and preliminarily verifying the phase unwrapping capability of the PMDU model for the wrapped phase image; (6) The wrapped phase image captured by the CCD camera is used as the input of the PMDU model to finally verify the phase unwrapping ability of the PMDU model for the real wrapped phase image and determine the accuracy of the PMDU model.
2. The phase unwrapping method based on deep learning semantic segmentation network according to claim 1 is characterized in that: The specific steps of step (1) are: (1-1) The first 36 terms of the Zernike polynomial are used to generate the unwrapped phase data, and its mathematical expression is: , in, is the generated unwrapped phase, Z j is the jth term of the Zernike polynomial, C j Its corresponding Zernike polynomial coefficients; (1-2) The wrapped phase is generated from the generated unwrapped phase. The conversion formula between the wrapped phase and the unwrapped phase is: , in, To wrap the phase, the angle function is a function that calculates the phase angle corresponding to the complex number. The range of the angle function is is a function of , where i is an imaginary unit.
3. The phase unwrapping method based on deep learning semantic segmentation network according to claim 1, characterized in that: In step (2), the proportions of the training set, validation set, and test set to the total data set are 70%, 15%, and 15%, respectively.
4. The phase unwrapping method based on deep learning semantic segmentation network according to claim 1, characterized in that: The multi-information fusion module in the backbone feature extraction stage of the PMDU model adopts multi-level maximum pooling and sets the pooling factors to 8, 4, 2 and 1 respectively to set different pooling factors. Without changing the number of channels in each layer, the corresponding pooling step size is obtained, and finally the pooling result of the same scale of 32 × 64 is obtained. For the feature map at the same scale, the feature channel is adjusted using 1×1 convolution and used as the input of the next layer.
5. The phase unwrapping method based on deep learning semantic segmentation network according to claim 1, characterized in that: The convolution kernel size of the first convolution layer and the second convolution layer in the backbone feature extraction stage of the PMDU model is 3×3, the convolution layer uses the ReLU function as the activation function, and the maximum pooling operation with a convolution kernel size of 2×2 and a step size of 2 is performed between different coding layers.
6. The phase unwrapping method based on deep learning semantic segmentation network according to claim 1, characterized in that: The enhanced feature extraction stage of the PMDU model includes a total of 6 decoding layers, each of which is composed of an upsampling layer and two convolutional layers, where the convolution kernel size of the upsampling layer is 2×2 and the step size is 2, and the convolution kernel size of the convolution layer is 3×3 and the step size is 2 by default.
7. The phase unwrapping method based on deep learning semantic segmentation network according to claim 1, characterized in that: When the PMDU model is trained in step (4), the learning rate of the network is set to 0.0001, the number of iterations is set to 300, and the batch_size of each batch is set to 256.
Citation Information
Cited By
White light interferometric phase unwrapping method, device, equipment and medium
CN119845181A
Phase unwrapping method based on interactive self-distillation and structural re-parameterization
CN120783044A
