A phase unwrapping method based on interactive self-distillation and structure reparameterization

By introducing interactive self-distillation and structural reparameterization methods into semantic segmentation networks, the problem of phase unwrapping across resolutions is solved, achieving high-precision and stable phase unfolding, which is applicable to fields such as interferometry, synthetic aperture radar, and nuclear magnetic resonance.

CN120783044BActive Publication Date: 2026-02-17SHANGHAI JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510859249.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2026-02-17
Estimated Expiration
2045-06-25

AI Technical Summary

Technical Problem

Existing phase unwrapping methods struggle to achieve high-precision and stable phase unfolding under cross-resolution conditions, and cannot effectively unwrap images of different resolutions.

Method used

A phase unwrapping method based on interactive self-distillation and structural reparameterization is constructed. By adding an interactive self-distillation mechanism to the semantic segmentation network, adopting the Repvgg module and adaptive enhancement strategy, and combining weighted cross-entropy loss and weighted mean square error loss, cross-level supervised learning and high-precision wrapping count gradient prediction are achieved.

Benefits of technology

It achieves end-to-end cross-resolution phase unfolding, ensuring high-precision segmentation of package counting gradients under different resolution conditions, restoring accurate unfolding phase, and improving the speed and accuracy of package unpacking.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120783044B_ABST
    Figure CN120783044B_ABST
Patent Text Reader

Abstract

The application relates to a phase unwrapping method based on interactive self-distillation and structure reparameterization, comprising the following steps: constructing a gradient segmentation model, adding an interactive self-distillation mechanism in a semantic segmentation network; adopting a Repvgg module as a basic module of the network; adopting an integrated architecture strong segmenter at the end of the network; adopting a weighted cross-entropy loss and a weighted mean square error loss as a loss function; adopting an adaptive enhancement strategy to train the gradient segmentation model on a pre-constructed data set to obtain a wrapped count gradient prediction model; inputting a current wrapped phase image into the model to output corresponding transverse and longitudinal wrapped count gradients; obtaining a wrapped count image through a least square method based on discrete cosine variation; multiplying the wrapped count by 2pi and adding the wrapped count to the wrapped phase image to obtain unwrapped phase. Compared with the prior art, the application can realize end-to-end cross-resolution phase unwrapping, and can realize high-precision and stable phase unwrapping on different resolution images.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of three-dimensional measurement, and particularly relates to a phase unwrapping method based on interactive self-distillation and structure reparameterization. BACKGROUND

[0002] Phase unwrapping is a key technique for processing periodic phase images and is a key step in the fields of interferometry, synthetic aperture radar and nuclear magnetic resonance. In these scenarios, the phase often contains important information. For example, in the fields of interferometry and synthetic aperture radar, the phase contains height information. In the field of nuclear magnetic resonance, the phase contains information about the uniformity of the magnetic field and physiological parameters. In many measurement systems, due to the periodic nature of phase measurement, the phase data in the obtained phase image is often wrapped within a limited range [-π, π]. This wrapped phase data needs to be processed by a specific image processing technique to recover the true phase, which is the phase unwrapping technique.

[0003] Traditional phase unwrapping methods recover the true phase by minimizing the influence of phase discontinuity on the unwrapping result, including path tracking methods and optimization methods. Among them, the path tracking method determines a better integration path to minimize the influence of discontinuous points on the whole. This method may produce unreasonable paths when dealing with complex wrapped phases, thereby affecting the accuracy of unwrapping. The optimization-based method uses different objective functions to minimize the difference between the unwrapped phase gradient and the wrapped phase gradient to obtain the unwrapped phase. This method tends to generate a smooth unwrapped phase, which leads to the fact that the difference between the unwrapped phase and the wrapped phase is not necessarily an integer multiple of 2π when dealing with high-noise images. This inconsistency causes errors at each point on the image. Although the traditional phase unwrapping method alleviates the influence of discontinuous phase to some extent, it still fails in the presence of severe noise or complex wrapped phase. In addition, the traditional algorithm is slow and cannot meet the real-time unwrapping requirements in many scenarios.

[0004] Currently, researchers have discovered that phase unwrapping via neural networks is not constrained by the Itoh condition and remains effective even in noisy conditions. Therefore, phase unwrapping methods based on deep neural networks have become the mainstream research direction in the field of phase unwrapping. Deep learning-based phase unwrapping methods mainly include regression, wrapper counting, and gradient methods. Regression directly maps the wrapped phase to the unwrapped phase using a neural network. This method is the most direct, but its prediction accuracy cannot be guaranteed. Wrapper counting redefines the phase unwrapping problem as a semantic segmentation problem, classifying the wrapper count k(x,y) for each pixel. This method is relatively fast and is currently the most commonly used. However, due to the continuous distribution of wrapper counts, the segmentation of wrapper counts requires comprehensive global feature information, placing high demands on the network's receptive field. Therefore, this method is only suitable for low-resolution images. Furthermore, it is often difficult to ensure generalization when dealing with samples whose phase distribution characteristics differ significantly from the training set. The gradient method classifies the wrapper count gradient for each pixel and then combines this with post-processing steps to reconstruct the unwrapped phase. Gradient prediction relies only on local feature information, alleviating the receptive field problem to some extent. This method is closer to the essence of the phase solution process. However, the wrapper count gradient is a typical example of sparse semantic information. The number of points with a wrapper count gradient of +1 or -1 in a wrapper phase image is far less than the number of points with a gradient of 0. This severe sample imbalance makes network training very difficult. Furthermore, when the number of phase periods in an image is fixed, the sparsity of the wrapper count gradient intensifies with increasing resolution, and the proportion of points with gradients of +1 or -1 decreases continuously. This makes training gradient prediction networks at high resolutions even more challenging. Therefore, current networks are still only designed for low-resolution images. Moreover, because the gradients predicted by these networks are not accurate enough, complex post-processing is required, resulting in slow overall unwrapping speeds. These factors limit the application of gradient-based methods.

[0005] In summary, existing phase unwrapping methods struggle to achieve phase unfolding across resolutions and cannot perform high-precision and stable phase unwrapping on images of different resolutions. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of the prior art by providing a phase unwrapping method based on interactive self-distillation and structure reparameterization, which can achieve end-to-end cross-resolution phase unfolding.

[0007] The objective of this invention can be achieved through the following technical solution: a phase unwrapping method based on interactive self-distillation and structure reparameterization, comprising the following steps:

[0008] The dataset is divided into training, validation and test sets. Each set of data includes input and label. The input is a noisy package phase map and the label is a horizontal and vertical package count gradient map.

[0009] A gradient segmentation model based on convolutional neural networks is constructed. An interactive self-distillation mechanism is added to the semantic segmentation network to achieve cross-layer supervised learning and ensure the stability of semantic extraction at high resolution. The Repvgg (Re-parameterization Visual Geometry Group) module is used as the basic module of the network. During the training process, the parameters of this module are trained in a two-branch form. During the inference phase, the two-branch architecture is equivalently merged into a single-branch architecture through structural reparameterization, reducing the number of model parameters and memory consumption. The segmenter at the end of the network adopts an integrated architecture, combining three weak segmenters containing convolutions with different dilation rates into a strong segmenter to adapt to semantic information with different spatial frequencies. The loss function adopts weighted cross-entropy loss and weighted mean squared error loss to improve the gradient segmentation accuracy.

[0010] The constructed gradient segmentation model is trained on the dataset. During training, an adaptive augmentation strategy is adopted, which assigns higher weights to samples with high error rates to increase the attention to error-prone samples. At the same time, different weights are assigned according to the accuracy of the three segmenters to achieve the optimal ensemble effect. After training is completed, a package counting gradient prediction model with fixed parameters is obtained.

[0011] The current package phase map is input into the package counting gradient prediction model, and the corresponding horizontal and vertical package counting gradients are output. The package counting map is then obtained by using the least squares method based on discrete cosine transformation. The package count is multiplied by 2π and added to the package phase map to obtain the expanded phase.

[0012] Furthermore, the dataset is specifically generated through a simulation algorithm, the process of which includes:

[0013] The true phase is generated by superimposing a Gaussian function with random mean and standard deviation onto a ramp function with random slope. According to the formula Get the package count k, where round is the rounding operation;

[0014] Differentiate the package count k to obtain the horizontal and vertical package count gradient distribution maps, which serve as gradient labels. Then... An arctangent transform is performed and different levels of noise are added to obtain a noisy wrapper phase ψ, which is then used as the network input.

[0015] Furthermore, the semantic segmentation network includes an encoder, a decoder, and an interactive self-distillation module. The encoder is used to downsample the input wrapper phase map multiple times, and after each downsampling, the Repvgg module is used for feature extraction.

[0016] The decoder is used to upsample the input wrapper phase map multiple times, and after each upsampling, features are extracted through a regular convolutional layer.

[0017] The feature layers with the same resolution in the encoder and decoder are connected through an interactive self-distillation module to perform bidirectional attention distillation.

[0018] Furthermore, the interactive self-distillation module specifically uses the feature attention maps of the corresponding layers of the encoder and decoder as the interactive distillation target during the training process to optimize the bidirectional Kullback-Leibler (KL) divergence, realize cross-layer supervised learning, and ensure the stability of semantic extraction at high resolution.

[0019] The working process of the interactive self-distillation module includes:

[0020] The first step is to extract the feature attention map soft labels of the corresponding layers in the encoder and decoder. During the extraction process, the sum of the pixel values ​​of each channel at each point in the feature map is calculated first, using the following expression:

[0021]

[0022] Among them, E (c,i,j) and D (c,i,j) Let represent the value of the c-th channel at position (i,j) in the feature maps of the encoder and decoder, respectively;

[0023] Then, the Softmax function is applied along the spatial dimension for normalization, generating attention map soft labels:

[0024]

[0025] Where H and W represent the height and width of the image, respectively. These are the values ​​of the soft labels in the attention maps of the encoder and decoder at position (i,j), respectively.

[0026] The second step is to calculate the bidirectional KL divergence loss to achieve bidirectional distillation learning. The calculation method is as follows:

[0027] KLloss = KL(E|D) + KL(D||E)

[0028]

[0029] Where KL(E||D) is the KL divergence from the encoder to the decoder, where the encoder acts as the teacher and the decoder as the student, and KL(D||E) is the KL divergence from the decoder to the encoder, where the decoder acts as the teacher and the encoder as the student.

[0030] Furthermore, the Repvgg module adopts a training-inference decoupling mode: during training, it maintains a dual-branch architecture, with the first branch consisting of a 3×3 convolutional layer and a batch normalization layer, and the second branch consisting of a 1×1 convolutional layer and a batch normalization layer.

[0031] During reasoning, the structural reparameterization technique is used to effectively merge two branches into a single branch. The specific reasoning process includes:

[0032] The first step is to transform the 1×1 convolutional layer in the 1×1 convolutional layer branch into a 3×3 convolutional layer through zero padding;

[0033] The second step is to merge the batch normalization layers within the two branches with the convolutional layers in their respective branches into a new convolutional layer with bias, thus obtaining an equivalent convolutional layer.

[0034] The third step is to add and merge the equivalent convolutional layer parameters of the two branches to obtain the parameters of the merged single-branch convolutional layer, thus completing the equivalent transformation from two branches to one branch.

[0035] Furthermore, the expression for the equivalent convolutional layer is:

[0036]

[0037] Where ω and b are the weights and biases of the original convolutional layer, respectively, and p, μ, γ, and σ are the offset, mean, scaling, and standard deviation parameters of the BN (Batch Normalization) layer, respectively. and The weights and biases of the equivalent convolutional layers are respectively.

[0038] Furthermore, the integrated segmenter at the end of the network specifically combines three sub-segments with different receptive fields into a strong segmenter, and these three sub-segments use convolutional layers with dilation rates of 1, 2, and 4, respectively.

[0039] Furthermore, the loss function includes weighted cross-entropy loss and weighted mean squared error loss:

[0040]

[0041] Among them, L wce For weighted cross-entropy loss and L wmse For the weighted mean square error loss, y c,i,jLet (i,j) be the one-hot encoded label of the midpoint (i,j) in channel C. This is the output of the corresponding model after softmax normalization, and the class weight corresponding to channel C is represented by β. c Channels 0, 1, and 2 represent categories 0, +1, and -1, respectively. Therefore, the values ​​of β1 and β2 are relatively large, while the value of β0 is relatively small. This means that the loss at gradient points is assigned a larger weight, while the loss at non-gradient points is assigned a smaller weight.

[0042] Furthermore, the adaptive enhancement strategy comprises two parts:

[0043] The first part is to calculate the error rate ∈ for each sample in the current training round t. i ,∈ i The proportion of points misclassified for the i-th sample in the entire image, and then based on ∈ i Set the current sample weights Updated to sample weights for round t+1

[0044]

[0045] This gives higher weight to samples with high error rates, making the network pay more attention to those samples in the next round of training;

[0046] The second part is based on the classification accuracy R of each sub-segmenter. k The weight of the sub-segmenter in round t Update the weights to round t+1

[0047]

[0048] This assigns greater weight to sub-segmenters with high accuracy and less weight to sub-segmenters with low accuracy. The final gradient segmentation result of the model is the weighted output of each sub-segmenter.

[0049] Furthermore, the process of solving for the expanded phase includes:

[0050] After obtaining the horizontal and vertical package count gradients of the output, a least-squares mathematical model is established between the ideal package count value and the package count gradient:

[0051]

[0052] Where, k i,j Let gradx(i,j) represent the ideal package count at point (i,j), gradx(i,j) represent the package count gradient along the x-direction at point (i,j), and grady(i,j) represent the package count gradient along the y-direction.

[0053] The corresponding Poisson equation is derived as follows:

[0054] (k i+1,j -2k i,j +k i-1,j )+(k i,j+1 -2k i,j +k i,j-1 )

[0055] =gradx(i,j)-gradx(i-1,j)+grady(i,j)-grady(i,j-1)=ρ i,j

[0056] By performing a Discrete Cosine Transform (DCT) on both sides of the Poisson equation, the package count value k can be obtained. i,j and ρ i,j Relationships in the DCT domain:

[0057]

[0058] in, Indicates k i,j The value in the DCT domain, Represents ρ i,j In the DCT domain, n and m represent the x and y coordinates in the DCT domain, N represents the number of columns in the entire image, and M represents the number of rows in the entire image.

[0059] Through the Perform inverse DCT transformation to obtain the required package count value k. i,j The package count value k i,j Multiply by 2π and add the input wrapper phase ψ to obtain the expanded phase.

[0060] Compared with the prior art, the present invention has the following advantages:

[0061] This invention constructs a gradient segmentation model based on a convolutional neural network and trains it using a dataset to obtain a package counting gradient prediction model. Specifically, the gradient segmentation model adds an interactive self-distillation mechanism to the semantic segmentation network. Through mutual supervision between shallow and deep layers within the network during training, cross-layer representation learning is achieved, promoting fine-grained segmentation of package counting gradients under cross-resolution conditions. Furthermore, an adaptive enhancement-based ensemble segmenter is employed to achieve stable segmentation of semantic information at different spatial frequencies. This ensures high-precision segmentation of package counting gradients under cross-resolution conditions, obtaining accurate package counting gradients. Subsequently, only a simple least-squares solution is needed to recover the unfolded phase, reliably achieving end-to-end cross-resolution phase unfolding.

[0062] In this invention, the semantic segmentation network includes an encoder, a decoder, and an interactive self-distillation module. Feature layers with the same resolution in the encoder and decoder are connected through the interactive self-distillation module to perform bidirectional attention distillation. During training, the interactive self-distillation mechanism uses the feature attention maps of corresponding layers in the encoder and decoder as the interactive distillation target to optimize the bidirectional KL divergence, thereby achieving cross-layer supervised learning. The symmetrical distillation process enables the network to perform internal cross-layer supervision, enhancing the perception ability of shallow structures and strengthening the detailed information in deep feature maps, ensuring that the semantic information extraction capability can be maintained under inputs of different resolutions.

[0063] This invention uses the Repvgg module as the basic module of the network. During the training process, the module trains parameters in a two-branch configuration. This two-branch architecture is beneficial to improving the model's ability to extract features. During the inference phase, the two-branch architecture is equivalently merged into a single-branch architecture through structural reparameterization. This can significantly reduce the number of model parameters and memory consumption while maintaining the model accuracy, and significantly improve the inference speed. This is beneficial for efficiently and accurately predicting the package count gradient.

[0064] This invention employs a strong segmenter at the network end, which is obtained by a weighted combination of three sub-segmenters with different receptive fields. These three sub-segmenters use convolutional layers with dilation rates of 1, 2, and 4, respectively. This integrated architecture with multiple receptive field sizes helps the segmenter adapt to semantic features at various spatial frequencies extracted from the network front end, and helps the network maintain stable dephase resolution for wrapper phase maps with different spatial frequencies. When segmenting semantic information, this strong segmenter can adapt to a wider range of spatial frequencies, avoiding the frequency bias problem that may occur with a single segmenter, and achieving accurate and generalized segmentation of multi-resolution semantic information.

[0065] This invention takes into account that for all pixels in an image, the number of categories +1 and -1 is far less than the number of category 0. Therefore, the loss function designed during training includes weighted cross-entropy loss and weighted mean squared error loss. By assigning different weights to the channels of each category, the model pays more attention to the segmentation loss of categories +1 and -1 during training, which can effectively solve the problem of class imbalance and ensure reliable training to obtain the package counting gradient prediction model. Attached Figure Description

[0066] Figure 1 This is a schematic diagram of the method flow of the present invention;

[0067] Figure 2 This is a schematic diagram of the phase unwrapping process in the embodiment;

[0068] Figure 3This is a schematic diagram of the semantic segmentation network structure in the embodiment;

[0069] Figure 4 This is a schematic diagram illustrating the working mechanism of the interactive self-distillation mechanism in the embodiment;

[0070] Figure 5 This is a schematic diagram of the network end strong splitter in the embodiment;

[0071] Figure 6 This is a flowchart of the adaptive enhancement strategy during network training. Detailed Implementation

[0072] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.

[0073] Example

[0074] like Figure 1 As shown, a phase unwrapping method based on interactive self-distillation and structure reparameterization includes the following steps:

[0075] The dataset is divided into training, validation and test sets. Each set of data includes input and label. The input is a noisy package phase map and the label is a horizontal and vertical package count gradient map.

[0076] A gradient segmentation model based on convolutional neural networks is constructed. An interactive self-distillation mechanism is added to the semantic segmentation network to achieve cross-layer supervised learning and ensure the stability of semantic extraction at high resolution. The Repvgg module is used as the basic module of the network. During the training process, the parameters of this module are trained in a two-branch form. During the inference phase, the two-branch architecture is equivalently merged into a single-branch architecture through structural reparameterization, reducing the number of model parameters and memory consumption. The segmenter at the end of the network adopts an integrated architecture, combining three weak segmenters containing convolutions with different dilation rates into a strong segmenter to adapt to semantic information with different spatial frequencies. The loss function adopts weighted cross-entropy loss and weighted mean squared error loss to improve the gradient segmentation accuracy.

[0077] The constructed gradient segmentation model is trained on the dataset. During training, an adaptive augmentation strategy is adopted, which assigns higher weights to samples with high error rates to increase the attention to error-prone samples. At the same time, different weights are assigned according to the accuracy of the three segmenters to achieve the optimal ensemble effect. After training is completed, a package counting gradient prediction model with fixed parameters is obtained.

[0078] The current package phase map is input into the package counting gradient prediction model, and the corresponding horizontal and vertical package counting gradients are output. The package counting map is then obtained by using the least squares method based on discrete cosine transformation. The package count is multiplied by 2π and added to the package phase map to obtain the expanded phase.

[0079] This embodiment applies the above-described solution, such as Figure 2 As shown, the semantic segmentation network is a fast high-resolution phase unwrapping network based on interactive self-distillation and structural reparameterization. The wrapped phase map is input into this phase unwrapping network, and the network outputs the horizontal and vertical wrapped count gradient maps. Then, the wrapped count map is reconstructed by the least squares algorithm based on discrete cosine transform. The wrapped count map is multiplied by 2π and added to the wrapped phase map to output the unfolded phase map.

[0080] Specifically, this embodiment first constructs a dataset using a simulation algorithm, and then generates the true phase by superimposing a Gaussian function with random mean and standard deviation onto a ramp function with random slope. According to the formula Obtain the package count k, where round is the floor function; differencing the package count k yields the horizontal and vertical gradient distribution maps of the package counts, which serve as gradient labels. Then... An arctangent transform is performed and different levels of noise are added to obtain a noisy wrapping phase ψ, which is used as the network input. The dataset constructed in this embodiment contains 12,000 samples. Each sample contains a wrapping phase map, horizontal and vertical wrapping count gradient labels, a wrapping count map, and an unfolded phase ground truth map. 80% of the samples are used for training, 10% for validation, and 10% for testing.

[0081] Figure 3 The diagram shows the structure of the semantic information extraction part. After the phase map is input into the network, it first passes through this part to output the semantic information feature map. This part consists of an encoder, a decoder, and an interactive self-distillation module. In this embodiment, the encoder performs 5 downsampling operations on the image, each downsampling is completed through a max pooling layer, and after each downsampling, the Repvgg module is used for feature extraction. The decoder performs 5 upsampling operations on the image, each upsampling is completed through bilinear interpolation, and after each upsampling, a regular convolutional layer is used to further extract features. Feature layers with the same resolution in the encoder and decoder are connected by the interactive self-distillation module to perform bidirectional attention distillation.

[0082] The specific working mechanism of the self-distillation module is as follows: Figure 4 As shown, it extracts attention from feature maps with the same resolution in both the encoder and decoder, and obtains soft labels for the attention maps after softmax normalization. Then, it calculates the bidirectional KL divergence loss to achieve bidirectional distillation learning. The interactive self-distillation module's operation includes:

[0083] The first step is to extract the feature attention map soft labels of the corresponding layers in the encoder and decoder. During the extraction process, the sum of the pixel values ​​of each channel at each point in the feature map is calculated first, using the following expression:

[0084]

[0085] Among them, E (c,i,j) and D (c,i,j) Let represent the value of the c-th channel at position (i,j) in the feature maps of the encoder and decoder, respectively;

[0086] Then, the Softmax function is applied along the spatial dimension for normalization, generating attention map soft labels:

[0087]

[0088] Where H and W represent the height and width of the image, respectively. These are the values ​​of the soft labels in the attention maps of the encoder and decoder at position (i,j), respectively.

[0089] The second step is to calculate the bidirectional KL divergence loss to achieve bidirectional distillation learning. The calculation method is as follows:

[0090] KLloss = KL(E|D) + KL(D||E)

[0091]

[0092]

[0093] Where KL(E||D) is the KL divergence from the encoder to the decoder, where the encoder acts as the teacher and the decoder as the student, and KL(D||E) is the KL divergence from the decoder to the encoder, where the decoder acts as the teacher and the encoder as the student.

[0094] KL(E||D) is used to reduce the loss of detail in deep features, while KL(D||E) is used to enhance the context awareness of shallow features, enabling fine segmentation and dense prediction on large images.

[0095] In this embodiment, the Repvgg basic network module adopts a training-inference decoupling mode. During training, it maintains a two-branch architecture. The first branch consists of a 3×3 convolutional layer and a batch normalization layer, while the second branch consists of a 1×1 convolutional layer and a batch normalization layer. This two-branch architecture is beneficial for improving the model's ability to extract features. During inference, the two branches are equivalently merged into a single branch through structural reparameterization. Specifically, in the first step of the inference process, the 1×1 convolutional layer in the 1×1 convolutional layer branch is transformed into a 3×3 convolutional layer through zero padding. In the second step, the batch normalization layer within each of the two branches is equivalently merged with the convolutional layers in their respective branches into a new convolutional layer with bias, as shown in the following expression:

[0096]

[0097] In the formula, ω and b are the weights and biases of the original convolutional layer, respectively, and p, μ, γ, and σ are the offset, mean, scaling, and standard deviation parameters of the BN layer, respectively. and The first step is to convert the weights and biases of the two equivalent convolutional layers. The second step is to add and merge the parameters of the equivalent convolutional layers of the two branches to obtain the parameters of the merged single-branch convolutional layer. This completes the equivalent conversion from two branches to one branch. The model accuracy remains unchanged, while the number of parameters and memory consumption are greatly reduced, and the inference speed is significantly improved.

[0098] Figure 5 The diagram shows the structure of the strong segmenter (adaptive ensemble segmenter) at the end of the network in this embodiment. The semantic information feature map output by the semantic segmentation network is input into the strong segmenter, and the final output is the horizontal and vertical wrapping count gradient map. This adaptive ensemble segmenter consists of three branches, each consisting of two dilated convolutional layers. The dilation rates of the dilated convolutional layers in the three branches are different: the first branch has a dilation rate of 2, the second branch has a dilation rate of 1, and the third branch has a dilation rate of 4. The results output by the three branches are weighted and integrated to obtain the final gradient segmentation result. This ensemble architecture integrates three segmenters with different receptive fields into a strong segmenter. This multi-size receptive field ensemble architecture is beneficial for the segmenter to adapt to the semantic features at various spatial frequencies extracted by the front end of the network, and it is beneficial for the network to maintain a stable dephase resolution effect for wrapping phase maps with different spatial frequencies.

[0099] This embodiment treats the package counting gradient segmentation task as a 3-class segmentation problem. Both horizontal and vertical gradients have three classes: 0, 1, and -1, with -1 represented as class 2 in the network. Therefore, the gradient prediction network output contains 6 channels: the first three channels represent the three classes of the horizontal gradient, and the last three channels represent the three classes of the vertical gradient. For all pixels in the image, the number of classes +1 and -1 is far less than the number of classes 0. To address the class imbalance problem, a weighted loss function is proposed. By assigning different weights to the channels of each class, the model focuses more on the segmentation loss of classes +1 and -1 during training. This loss function uses weighted cross-entropy loss and weighted mean squared error loss, both of which assign relatively large weights to gradient points, thus helping the network to pay more attention to the segmentation accuracy of gradient points during training. The weighted cross-entropy loss L... wce and weighted mean square error loss L wmse They are represented as follows:

[0100]

[0101] In the formula, y c,i,j Let (i,j) be the one-hot encoded label of the midpoint (i,j) in channel C, and This is the output of the corresponding model after softmax normalization, and the class weight corresponding to channel C is represented by β. c Channels 0, 1, and 2 represent categories 0, +1, and -1, respectively. Therefore, the values ​​of β1 and β2 are relatively large, while the value of β0 is relatively small. This means that the loss at gradient points is assigned a larger weight, while the loss at non-gradient points is assigned a smaller weight.

[0102] Furthermore, an adaptive augmentation strategy is employed during model training to enhance training performance and provide appropriate weights to the sub-segments at the network's end, such as... Figure 6 As shown, the adaptive enhancement strategy consists of two parts. The first part is to calculate the error rate ∈ [0, 0] for each sample in the current training round t. i ,∈ i The proportion of points misclassified for the i-th sample in the entire image, and then based on ∈ i Set the current sample weights Updated to sample weights for round t+1

[0103]

[0104] This gives higher weight to samples with high error rates, making the network pay more attention to those samples in the next round of training;

[0105] The second part is based on the classification accuracy R of each sub-segmenter. k The weight of the sub-segmenter in round t Update the weights to round t+1

[0106]

[0107] This assigns greater weight to sub-segmenters with high accuracy and less weight to sub-segmenters with low accuracy. The final gradient segmentation result of the model is the weighted output of each sub-segmenter.

[0108] After training the package counting gradient prediction model through the above process, the current package phase map is input into the model, and the corresponding horizontal and vertical package counting gradients are output. Then, based on the least squares method of discrete cosine transformation, the gradient segmentation results output by the network are converted into the final unfolded phase. Specifically:

[0109] After obtaining the horizontal and vertical package count gradients of the output, a least-squares mathematical model is established between the ideal package count value and the package count gradient:

[0110]

[0111] Where, ki,j Let gradx(i,j) represent the ideal package count at point (i,j), gradx(i,j) represent the package count gradient along the x-direction at point (i,j), and grady(i,j) represent the package count gradient along the y-direction.

[0112] The corresponding Poisson equation is derived as follows:

[0113] (k i+1,j -2k i,j +k i-1,j )+(k i,j+1 -2k i,j +k i,j-1 )

[0114] =grady(i,j)-gradx(i-1,j)+grady(i,j)-grady(i,j-1)=ρ i,j

[0115] By performing a Discrete Cosine Transform (DCT) on both sides of the Poisson equation, the package count value k can be obtained. i,j and ρ i,j Relationships in the DCT domain:

[0116]

[0117] in, Indicates k i,j The value in the DCT domain, Represents ρ i,j In the DCT domain, n and m represent the x and y coordinates in the DCT domain, N represents the number of columns in the entire image, and M represents the number of rows in the entire image.

[0118] Through the Perform inverse DCT transformation to obtain the required package count value k. i,j The package count value k i,j Multiply by 2π and add the input wrapper phase ψ to obtain the expanded phase.

[0119] To verify the effectiveness of this scheme, this embodiment compares it with several commonly used phase unwrapping networks, including REDN, DeepLabv3+, PhaseNet2.0, VDENet, and PhaseNet. The comparison includes analysis under different resolutions, different phase period densities, and discontinuous phase conditions. All methods were trained on the same dataset and with the same learning rate, and the same epochs were selected for comparison. The results are shown in Table 1.

[0120] Table 1

[0121]

[0122]

[0123] This embodiment constructed four sub-test sets with different resolutions for comparative testing: 256×256, 512×512, 768×768, and 1024×1024. The average RMSE of each method under each sub-test set is shown in Table 1. It can be seen that at a resolution of 256×256, the RMSE of all six methods is relatively small. Among them, the proposed solution performs best, with an average RMSE of 0.3254, while the second best, REDN, has an average RMSE of 0.5185. Compared to REDN, the average RMSE of the proposed solution is reduced by 37.24%. When the resolution is increased to 512×512, 768×768, and 1024×1024, the average RMSE of the proposed solution at these three resolutions are 0.3492, 0.3503, and 0.3429, respectively, consistently maintaining high accuracy. Clearly, our proposed solution maintains excellent performance across multiple resolutions, while the other five methods are only effective at low resolutions, with their errors increasing sharply as the resolution increases. Experimental results demonstrate that our proposed solution significantly improves the network's multi-resolution adaptability, enabling high-precision gradient prediction across resolution scenarios and achieving high-precision and stable phase unwrapping for images of different resolutions.

Claims

1. A phase unwrapping method based on interactive self-distillation and structure reparameterization, characterized in that, The method comprises the following steps: The data set is divided into a training set, a validation set and a test set, each group of data comprising an input and a label, the input being a wrapped phase image with noise, and the label being a transverse and longitudinal wrapped count gradient image; A gradient segmentation model based on a convolutional neural network is constructed, an interactive self-distillation mechanism is added to the semantic segmentation network to realize cross-level supervised learning and ensure the stability of semantic extraction at high resolution; a Repvgg module is used as the basic module of the network, which trains parameters in a double-branch form during training, and in the inference stage, the double-branch architecture is equivalent to a single-branch architecture through structure reparameterization, thereby reducing the model parameter quantity and memory consumption; the end of the network uses an integrated architecture to integrate three weak segmenters containing convolutions with different hole rates into a strong segmenter for adapting to semantic information of different spatial frequencies; a weighted cross-entropy loss and a weighted mean square error loss are used as the loss function to improve the gradient segmentation accuracy; The constructed gradient segmentation model is trained on the data set, and an adaptive enhancement strategy is used during training to give higher weights to samples with high error rates to increase the importance of easy-to-mistake samples, and different weights are given to the correct rates of the three segmenters to achieve optimal integration effect; after training, a wrapped count gradient prediction model with fixed parameters is obtained; The current wrapped phase image is input into the wrapped count gradient prediction model, and the corresponding transverse and longitudinal wrapped count gradient is output, and then a wrapped count image is obtained through a least square method based on discrete cosine transformation, and the wrapped count is multiplied by 2π and added to the wrapped phase image to obtain the unwrapped phase; The semantic segmentation network comprises an encoder, a decoder and an interactive self-distillation module, the encoder is used for multiple times of down-sampling of the input wrapped phase image, and feature extraction is performed through the Repvgg module after each down-sampling; The decoder is used for multiple times of up-sampling of the input wrapped phase image, and feature extraction is performed through a normal convolution layer after each up-sampling; The feature layers with the same resolution in the encoder and the decoder are connected through the interactive self-distillation module to perform bidirectional attention distillation; The interaction self-distillation module specifically takes the feature attention maps of the corresponding layers of the encoder and the decoder as interaction distillation targets in the training process, and optimizes the bidirectional KL Divergence, realizing cross-level supervised learning, ensuring the stability of semantic extraction at high resolution; The working process of the interactive self-distillation module comprises: In the first step, the feature attention map soft label of the corresponding layer in the encoder and the decoder is extracted, and in the extraction process, the sum of the pixel values of each channel in the feature map is calculated first, and the calculation expression is as follows: , wherein, and denote the value of a channel in the feature map of the encoder and the decoder, respectively, at position c ; and ; and Normalization is then applied along the spatial dimension Softmax The function generates attention map soft labels: , , wherein, and denote the height and width of the image, respectively, , are the values of the attention map soft labels of the encoder and decoder at position, respectively; In the second step, the bidirectional KL divergence loss is calculated to realize bidirectional distillation learning, and the calculation method is as follows: , , , wherein, is the KL divergence from the encoder to the decoder, with the encoder as the teacher and the decoder as the student, is the KL divergence from the decoder to the encoder, with the decoder as the teacher and the encoder as the student.

2. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 1, characterized in that, The data set is specifically a data set generated by a simulation algorithm, and the process comprises: Superimposing a Gaussian function of random mean and standard deviation on a ramp function of random slope generates a real phase φ The wrapped count is obtained according to the formula k wherein round is a rounding operation;​ Counting the wrapping k Differential is performed to get the transverse and longitudinal wrapping count gradient distribution map as the gradient label, and then φ The arctangent transformation is performed and different degrees of noise are added to get the wrapping phase with noise as the network input.

3. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 1, characterized in that, The Repvgg module adopts a training-inference decoupling mode: in training, it remains a double-branch architecture, the first branch is composed of a 3*3 convolution layer and a batch normalization layer, and the second branch is composed of a 1*1 convolution layer and a batch normalization layer; In inference, the double-branch is equivalent to a single-branch through structure reparameterization technology, and the specific inference process comprises: In the first step, the 1×1 convolution layer in the 1×1 convolution layer branch is changed into a 3×3 convolution layer by zero padding; In the second step, the batch normalization layers in the two branches are combined into a new convolution layer with bias, and the equivalent convolution layer is obtained; In the third step, the parameters of the equivalent convolution layers in the two branches are added and combined, and the combined single-branch convolution layer parameters are obtained, and the equivalent conversion from the double branch to the single branch is completed.

4. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 3, characterized in that, The expression of the equivalent convolution layer is: , wherein, , are original convolutional layer weights and biases, respectively, , , , are batch normalization layer shift, mean, scale, and standard deviation parameters, respectively, and are equivalent convolutional layer weights and biases, respectively.

5. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 1, characterized in that, The integrated segmenter at the end of the network is a strong segmenter composed of three sub-segmenters with different receptive fields, which are combined by weighting.

6. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 1, characterized in that, The loss function includes weighted cross-entropy loss and weighted mean square error loss: , , wherein, and denote the height and width of the image, respectively, is a weighted cross-entropy loss and is a weighted mean square error loss, is a channel midpoint one-hot encoded label, is the corresponding model output after Softmax standardization, and the class weight corresponding to channel is denoted as , channels 0, 1 and 2 represent classes 0, +1 and -1 respectively, so and have larger values, have smaller values, indicating that the loss of the gradient point is given a larger weight, and the loss of the non-gradient point is given a smaller weight.

7. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 1, characterized in that, The adaptive enhancement strategy includes two parts: The first part is to count the error rate of each sample in the current training epoch t , i The proportion of the points that are misclassified by the first sample in the whole image, and then update the current sample weight to the sample weight of the epoch t+1 :​​​​ , This gives the high error rate sample a greater weight, so that the network pays more attention to this sample in the next round of training; The second part is according to the classification accuracy of each sub-splitter , the weight of the sub-splitter in the first t round is updated as , the weight of the sub-splitter in the second t+1 round is updated as : , This gives the sub-segmenter with high accuracy a greater weight and the sub-segmenter with low accuracy a smaller weight, and the final model gradient segmentation result is the weighted output result of each sub-segmenter.

8. The phase unwrapping method based on interactive self-distillation and structure reparameterization according to claim 1, characterized in that, The solution process of the unwrapped phase includes: After obtaining the transverse and longitudinal wrapped count gradients, a least squares mathematical model between the ideal wrapped count value and the wrapped count gradient is established: , wherein, an ideal wrap count value at a point , is a wrap count gradient in a direction at the point x , represents a wrap count gradient in a direction y ; The corresponding Poisson equation is derived: , Discrete cosine transform (DCT) is applied to both sides of the Poisson equation to obtain wrapped count values and Relationship in DCT domain: , wherein denotes the value in the DCT domain, denotes the value in the DCT domain, n and m denotes the horizontal and vertical coordinate in the DCT domain, N denotes the number of columns of the whole image, M denotes the number of rows of the whole image; By performing an inverse DCT transform on the wrapped count value, the desired unwrapped count value is obtained The wrapped count value is multiplied by 2π and added to the input wrapped phase to obtain the unwrapped phase ​ .​

Citation Information

Patent Citations

  • Intelligent two-dimensional phase unwrapping system, application and training and data set construction method thereof

    CN114529723A

  • Central difference information filtering phase unwrapping method based on deep learning

    CN115272683A