Real-time holographic phase unwrapping and phase distortion elimination method and system, computer equipment and storage medium
By pre-processing and background segmentation of the holograms using HS-TransUNet and HS-ResNet50 neural networks, combined with Zenik polynomial fitting, the accuracy and efficiency problems of phase diswrapping and phase distortion elimination in complex environments in the prior art are solved, achieving low cost and strong generalization effects.
Patent Information
- Application Number
- CN202510374317.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-06-27
AI Technical Summary
The existing phase disposal method cannot take into account both accuracy and efficiency in complex noise and high phase difference environments, and the phase distortion elimination method is limited by the high cost of hardware and the weak generalization of software.
The hologram is preprocessed and background segmented by HS-TransUNet neural network, and Zernik polynomial fitting is performed in combination with the HS-ResNet50 neural network to achieve phase diswrapping and phase distortion elimination.
Improve the accuracy and efficiency of phase distortion in complex noise environments, achieve low-cost and strong generalized phase distortion elimination, taking into account both accuracy and efficiency.
Smart Images

Figure CN120219205A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to phase reconstruction technology in the field of optical imaging, and in particular to a real-time holographic phase unwrapping and phase distortion elimination method, system, computer equipment and storage medium. Background Art
[0002] Phase reconstruction technology is a method of recovering light field phase information from light field intensity information. It obtains accurate phase information from the imaging system through phase unwrapping and phase distortion elimination. It can realize tasks such as three-dimensional surface reconstruction, detection of tiny structural changes, and dynamic process monitoring. It is widely used in medical imaging, optics, spectroscopy, seismology, astronomy, and materials science.
[0003] Classical phase unwrapping methods, such as the least squares method, path pruning algorithm, and deep learning-based methods. The least squares method transforms the phase unwrapping problem into a least squares optimization problem, and can usually obtain the global optimal solution. However, the least squares method has a large amount of computational complexity in traversing the entire image and is highly sensitive to noise. When the input image data is large, its speed is extremely slow and resource consumption is large. Although the path pruning algorithm reduces the computational space by retaining only one unwrapping path with the least consumption, it prunes some effective phase paths, resulting in incomplete unwrapping results and reducing the accuracy of the results. When there is discontinuity or complex noise interference in the phase image and accurate phase recovery is required, its feasibility in real-time applications is limited. The deep learning-based method introduces visual transformers and captures long-distance dependencies through the self-attention mechanism, which improves the feature extraction in the phase unwrapping task. However, the model based purely on transformers performs poorly in phase unwrapping at the edge of phase jumps, and most of them ignore the scenarios where the phase difference exceeds 50 radians and the noise is large. Therefore, how to improve the accuracy and efficiency of phase unwrapping in complex noise environments and high phase difference scenarios, and output high-quality unwrapped images for subsequent segmentation of the background image and elimination of background distortion, is a problem worthy of attention.
[0004] In addition, common methods for phase distortion cancellation currently include, for example, hardware-based methods, software-based methods, etc. Hardware-based methods, such as the FPSoC adaptive wavefront correction system, can achieve real-time distortion correction and can correct spatial distortions up to the 14th-order Zernike polynomial. However, such systems require complex equipment settings and are costly. Software-based methods, such as algorithms that combine Zernike polynomial approximation and total variation regularization, significantly reduce errors through lower computational costs. However, when dealing with problems such as tilt, astigmatism, and defocus, the algorithm that combines Zernike polynomial approximation and total variation regularization loses details due to increased model complexity and insufficient fitting approximation ability, making the algorithm unable to meet the requirements in terms of speed and accuracy. It can be seen that existing phase unwrapping methods cannot balance accuracy and efficiency in complex noise and high phase difference environments, and phase distortion cancellation methods are limited by the high cost of hardware and the weak generalization ability of software. Summary of the Invention
[0005] Based on this, in view of the above technical problems, it is necessary to provide a phase unwrapping and phase distortion cancellation method, system, computer device, and storage medium that balance accuracy and efficiency in complex noise and high phase difference environments, and achieve low cost and strong generalization.
[0006] A phase unwrapping method, the method comprising:
[0007] Obtain a hologram of the object to be measured;
[0008] Preprocess the hologram to obtain a wrapped phase map;
[0009] Perform wrapped count segmentation on the wrapped phase map to obtain a wrapped count map;
[0010] Multiply the wrapped count map by 2π and superimpose it on the wrapped phase map to obtain an unwrapped phase map.
[0011] In one embodiment, the preprocessing the hologram to obtain a wrapped phase map includes:
[0012] Perform a fast Fourier transform, window filtering, and inverse fast Fourier transform on the hologram, and use the numerical value as the input of the arctangent function to obtain a wrapped phase map.
[0013] In one embodiment, the performing wrapped count segmentation on the wrapped phase map to obtain a wrapped count map includes:
[0014] Input the wrapped phase map into a trained HS-TransUNet neural network to obtain a wrapped count, and obtain a wrapped count map.
[0015] In one embodiment, the training steps of the HS-TransUNet neural network model include:
[0016] Obtain a target holographic atlas;
[0017] Blur the edges of the holograms in the holographic atlas, and perform random scaling, translation, and rotation processing to obtain a real phase data set;
[0018] Add the real phase to random distortion and Gaussian noise to obtain an unwrapped phase data set;
[0019] Perform wrapping processing on the unwrapped phase to obtain a wrapped phase map and a wrapped number map, which are used as the training data set of the HS-TransUNet neural network;
[0020] Use the obtained wrapped phase map as the input feature, and use the obtained corresponding wrapped number map as the expected output feature to train the model, and obtain a trained HS-TransUNet neural network model.
[0021] In one embodiment, the target holographic atlas satisfies at least one of the following conditions:
[0022] The following conditions include:
[0023] There are multiple types of objects corresponding to the target holographic atlas and they have biological significance;
[0024] The shapes and sizes of the objects corresponding to the target holographic atlas are diverse;
[0025] The positions and directions of the objects corresponding to the target holographic atlas are diverse.
[0026] In one embodiment, using the HS-TransUNet neural network to perform wrapped count segmentation on the wrapped phase map to obtain the wrapped number map includes:
[0027] Perform multi-scale feature extraction on the input wrapped phase map through a convolutional encoder module to obtain a feature map;
[0028] Process the feature map through a transformer layer, divide the feature map into a sequence of image patches, and capture long-range dependencies through a multi-head self-attention mechanism to obtain a new feature map;
[0029] Perform progressive upsampling and skip connection on the new feature map through a decoder module to restore the original resolution;
[0030] Generate a probability map for wrapped count segmentation through a classification layer;
[0031] Estimate the wrapped number map from the segmentation probability map.
[0032] A method for eliminating phase distortion, the method comprising:
[0033] Performing background segmentation on the unwrapped phase map to obtain a background map;
[0034] Predicting background distortion data for the background map;
[0035] Processing the unwrapped phase map and the background distortion to obtain the true phase of the target object.
[0036] In one embodiment, performing background segmentation on the unwrapped phase map to obtain a background map includes:
[0037] Inputting the unwrapped phase map into a trained HS-TransUNet neural network for background segmentation to obtain the background map.
[0038] In one embodiment, predicting background distortion data for the background map includes:
[0039] Inputting the background map into a trained HS-ResNet50 neural network;
[0040] Performing Zernike polynomial fitting on the background map through the HS-ResNet50 neural network to obtain the first six Zernike coefficients;
[0041] Predicting the background distortion data using the first six Zernike coefficients.
[0042] In one embodiment, the training steps of the HS-ResNet50 neural network model include:
[0043] Obtaining randomly generated first six Zernike coefficients;
[0044] Fitting a Zernike surface using the randomly generated first six Zernike coefficients;
[0045] Eliminating the object region of the Zernike surface to obtain a Zernike surface containing only the background region, as the background map dataset for training the HS-ResNet50 neural network model;
[0046] Using the obtained background map as the input feature and the corresponding randomly generated first six Zernike coefficients as the expected output feature for model training to obtain the trained HS-ResNet50 neural network model.
[0047] In one embodiment, processing the unwrapped phase map and the background distortion to obtain the true phase of the target object includes:
[0048] Subtract the unwrapped phase from the background distortion data to finally obtain the true phase of the target object.
[0049] A computer device includes a memory and a processor. The memory stores a computer program, and when the processor executes the computer program, the steps in the above method embodiments are implemented.
[0050] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0051] The above method, system, computer device, and storage medium for phase unwrapping and phase distortion elimination preprocess the hologram of the object to be measured to obtain a wrapped phase map; use the HS-TransUNet neural network to perform background segmentation on the wrapped phase map to obtain a wrapped number map; multiply the wrapped number map by 2π and superimpose it on the wrapped phase map to obtain an unwrapped phase map. Since the HS-TransUNet neural network can effectively perform global context modeling and its long-range dependence is insensitive to noise, it can improve the accuracy of obtaining the unwrapped image in a complex noise environment, thereby enhancing the applicability of phase unwrapping in complex imaging in real scenarios. Further, perform background segmentation on the unwrapped phase map to obtain a background map, use the HS-ResNet50 neural network to perform Zernike polynomial fitting on the background map to obtain the first six Zernike coefficients, and use the first six Zernike coefficients to predict the background distortion data. Since the fully connected layer of the HS-ResNet50 network is modified to have 6 neurons, it can efficiently utilize its deep feature extraction ability to accurately predict the required coefficients, improving the accuracy and efficiency of predicting the background distortion data. Finally, subtract the background distortion data from the unwrapped phase map to obtain the true phase of the target object. Thus, this method can balance accuracy and efficiency, achieving low cost and strong generalization. Description of the Drawings
[0052] Figure 1 is a schematic flowchart of a method for phase unwrapping and phase distortion elimination in an embodiment;
[0053] Figure 2 is a schematic flowchart of preprocessing a hologram to obtain a wrapped phase map in an embodiment;
[0054] Figure 3 is an architecture diagram of the HS-TransUNet neural network for performing wrapped count segmentation on a wrapped phase map to obtain a wrapped number map in an embodiment;
[0055] Figure 4It is a schematic flowchart of using an HS-ResNet50 neural network to perform Zernike polynomial fitting to obtain background distortion data in an embodiment;
[0056] Figure 5 It is a schematic flowchart of the transformer layer in the HS-TransUNet neural network in an embodiment;
[0057] Figure 6 It is a schematic diagram of the effect of obtaining an unwrapped phase map from a wrapped phase map in an embodiment. Among them, subfigure (a) is the wrapped phase map of three sample types, subfigure (b) is the corresponding wrapped number map obtained by processing through the HS-TransUNet neural network, and subfigure (c) is the corresponding unwrapped phase map obtained by superimposing the wrapped phase map multiplied by 2π and the wrapped number map;
[0058] Figure 7 It is a schematic diagram of the effect from the unwrapped phase map to the true phase of the target object in an embodiment. Among them, subfigure (a) is the unwrapped phase map of three sample types, subfigure (b) is the corresponding background map obtained by performing background segmentation through the HS-TransUNet neural network, subfigure (c) is the background distortion data further obtained by performing Zernike polynomial fitting on the background map, subfigure (d) is the true phase of the corresponding target object obtained by subtracting the background distortion data from the unwrapped phase map, and subfigure (e) is the true value of the three sample types;
[0059] Figure 8 It is a structural block diagram of a phase unwrapping and phase distortion elimination device in an embodiment;
[0060] Figure 9 It is a schematic diagram of the hardware structure of a computer device provided in an embodiment of the present application. Specific embodiments
[0061] In order to make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] In one embodiment, as Figure 1 shown, a real-time holographic phase unwrapping and phase distortion elimination method is provided. In this embodiment, this method is illustrated by taking its application to a terminal as an example. It can be understood that this method can also be applied to a server, and can also be applied to a system including a terminal and a server, and is realized through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0063] Step 100, acquire and record the hologram of the object to be measured.
[0064] Specifically, a strong coherent light source is used to provide a laser beam, and the beam generated by the light source is expanded into a planar laser beam through a beam expansion optical device. Subsequently, a half-wave polarizer and a polarization beam splitter are used to split the laser beam into two orthogonally polarized light beams, namely the object light wave and the reference light wave. The vibration plane of the object light wave is rotated by the half-wave polarizer so that its vibration direction is the same as that of the reference light wave. Finally, an object light wave and a reference light wave are superimposed through a beam splitter to form a holographic projection, and the projection signal is collected by a CCD camera to obtain a hologram of the object to be measured.
[0065] Step 102: Preprocess the hologram to obtain a wrapped phase map.
[0066] Step 104: Input the wrapped phase map into the HS-TransUNet neural network for wrapped count segmentation to obtain a wrapped count map.
[0067] Among them, HS-TransUNet is an improved neural network architecture that combines the advantages of convolutional neural networks and transformers.
[0068] Specifically, the input wrapped phase map first undergoes multi-scale feature extraction through a convolutional encoder to obtain a feature map. The feature map is further processed through a transformer layer, and long-range dependencies are captured through the multi-head self-attention mechanism to obtain a new feature map. The new feature map is restored to the original resolution through a decoder module, and a probability map for wrapped count segmentation is generated through a classification layer.
[0069] Step 106: Multiply the wrapped count map by 2π and superimpose it on the wrapped phase map to obtain an unwrapped phase map.
[0070] Specifically, multiply the wrapped count map by 2π and then superimpose it on the wrapped phase map, that is, the unwrapped phase map is obtained through formula (1):
[0071] φ unwrap =φ wrapped +2π×φ warp count image (1)
[0072] The unwrapped phase map realizes the continuous recovery of phase information and provides a basis for subsequent phase distortion elimination.
[0073] Step 108: Input the unwrapped phase map into the HS-TransUNet neural network for background segmentation to obtain a background map.
[0074] Step 110: Input the background map into the HS-ResNet50 neural network to obtain the first six Zernike coefficients.
[0075] Specifically, the HS-ResNet50 neural network performs Zernike polynomial fitting on the background map to obtain the first six Zernike coefficients.
[0076] Step 112: Predict the background distortion data using the first six Zernike coefficients.
[0077] Specifically, the HS-ResNet50 neural network outputs the first six Zernike coefficients, and the corresponding Zernike surface is fitted through these coefficients to obtain the background distortion data.
[0078] Step 114: Subtract the unwrapped phase map from the background distortion data to obtain the true phase of the target object.
[0079] The above method, system, computer device, and storage medium for phase unwrapping and phase distortion elimination preprocess the hologram of the object to be measured to obtain a wrapped phase map; use the HS-TransUNet neural network to perform background segmentation on the wrapped phase map to obtain a wrapped number map; multiply the wrapped number map by 2π and superimpose it on the wrapped phase map to obtain an unwrapped phase map. Since the HS-TransUNet neural network can effectively perform global context modeling, its long-range dependencies are insensitive to noise, which can improve the accuracy of obtaining unwrapped images in complex noise environments. Moreover, by combining local feature extraction and global context connection, this method can improve the applicability of phase unwrapping in complex imaging in real scenarios. Further, perform background segmentation on the unwrapped phase map to obtain a background map, use the HS-ResNet50 neural network to perform Zernike polynomial fitting on the background map to obtain the first six Zernike coefficients, and use the first six Zernike coefficients to predict the background distortion data. Since the fully connected layer of the HS-ResNet50 network is modified to have 6 neurons, it can efficiently utilize its deep feature extraction ability to accurately predict the required coefficients, improving the accuracy and efficiency of predicting background distortion data. Finally, subtract the background distortion data from the unwrapped phase map to obtain the true phase of the target object. Thus, this method can balance accuracy and efficiency, achieving low cost and strong generalization.
[0080] In one embodiment, step 102 includes: performing a fast Fourier transform, window filtering, and an inverse fast Fourier transform on the hologram, and using the value as the input of the arctangent function to obtain a wrapped phase map.
[0081] Among them, the hologram is generated by recording the interference pattern between the object beam E o (x, y) and the reference beam E r (x, y). Its intensity distribution is mathematically expressed as:
[0082] I(x, y) = |E o (x, y) + E r (x, y)| 2 (2)
[0083] After expansion, it is obtained:
[0084]
[0085] Among them, E o (x, y) is the complex field of the object wave:
[0086]
[0087] E r (x, y) is the complex field of the reference wave:
[0088]
[0089] |E o | 2 and |E r | 2 are the intensities of the object wave and the reference wave respectively. Their interference terms and encode the phase information of the object light modulated by the reference light.
[0090] Specifically, performing a fast Fourier transform on the intensity distribution I(x, y) gives:
[0091]
[0092] where the interference terms and are the components shifted due to the reference light. Then, window filtering is performed to isolate and an inverse Fourier transform is performed to reconstruct the object wavefront:
[0093]
[0094] The phase φ o (x, y) of the reconstructed wavefront is obtained through formula (8):
[0095] φ o (x, y) = arg(E rec (x, y)) (8)
[0096] where arg is used to calculate the argument (phase) of a complex number.
[0097] The phase φ o (x, y) is essentially wrapped in (-π, π]. The wrapped phase is expressed as:
[0098] φ wrapped (x, y) = φ o (x, y) mod 2 (9)
[0099] The wrapped phase diagram is thus obtained. This wrapped phase will be used as the input to the unwrapping algorithm, which contains the phase discontinuity phenomenon wrapped with a period of 2π.
[0100] In one embodiment, step 104 includes: First, perform multi-scale feature extraction on the input wrapped phase diagram through a convolutional encoder module to obtain a feature map.
[0101] Among them, the convolutional encoder module is based on the residual block structure of HS-ResNet50.
[0102] Specifically, the input feature map is first transformed through a 1×1 convolution to adjust the channel dimension to C′. The transformed feature map x ′ is divided into s groups, denoted as The number of channels in each group is:
[0103]
[0104] x i = split(x′, s), i = 1, 2, …, s (11)
[0105] Among them, the split() function means to divide the input feature map x ′ along the channel dimension into s groups, and each group x i generates output features through a 3×3 convolution. The output group y i is divided into two components, where retains the local details, while is passed to the next group to obtain the inter-group context. Among them, y i,1 focuses on fine-grained features, while y i,2 helps cross-group feature fusion, gradually expands the receptive field and adapts to large-scale scene modeling. By connecting y i,2 with the input x of the next group i+1 to achieve inter-group flow. After processing all groups, the local detail features y i,1 are connected along the channel dimension, and a final 1×1 convolution is used to restore the channel dimension, and the output features are combined with the input through a residual connection.
[0106] The feature map output by the convolutional encoder is input to the transformer layer for processing. The feature map is segmented into a sequence of image patches, and long-range dependencies are captured through the multi-head self-attention mechanism to obtain a new feature map.
[0107] Specifically, the final feature map from the convolutional encoder is reshaped into N p patches of size P×P, where:
[0108] Np = H L W L / P 2 (12)
[0109] These patches are linearly embedded into a d-dimensional feature space, and the resulting is used as the input to the transformer layer, where d is chosen to be greater than the channel dimension C of the convolutional feature map L , to enhance the expressive power. For the input feature Each patch feature is mapped into query (Q), key (K), and value (V) vectors using a learnable weight matrix:
[0110] Q = F patch W Q (13)
[0111] K = F patch W K (14)
[0112] V = F patch W V (15)
[0113] where, with W Q , W K , W V ∈ R d×d are the projection weights.
[0114] The scaled dot product is used to calculate the attention scores for the relationship between each query and all keys:
[0115]
[0116] where the softmax() function is a commonly used activation function in neural networks, represents the attention weights, and the scaling factor prevents the dot product value from being too large.
[0117] The output feature representation is obtained by using the A weight values:
[0118] Z = AV (17)
[0119] The resulting captures the global context dependencies.
[0120] The transformer layer uses multiple heads. Each attention head independently calculates the projections of its queries, keys, and values. The outputs of all heads are concatenated and linearly transformed to generate the final multi-head self-attention output, which simulates the global relationships between patches and forms the core of the transformer. The output of the multi-head self-attention is combined with the original input through a residual connection and then layer normalization is performed. The output of the transformer layer is processed by a feed-forward network (FNN) to further enhance the feature representation.
[0121] The FNN consists of two fully connected layers with a GELU activation function in the middle:
[0122] FFN(x) = GELU(xW1 + b1)W2 + b2 (18)
[0123] Here, W1 and W2 are weight matrices, b1 and b2 are bias terms, and d ff is usually larger than d to increase the non-linear modeling ability. The FFN output is also updated through residual connections and normalization.
[0124] The features output by the transformer are progressively upsampled and restored to the original resolution through skip connections in the decoder module.
[0125] Specifically, the features output by the transformer are mapped back to a convolutional feature map. The decoder adopts an architecture similar to UNet and gradually restores the spatial resolution of the feature map through transposed convolutions. For the l-th layer of the transposed convolution, the feature map of the decoder:
[0126]
[0127] where, Deconv l (·) represents the transposed convolution operation of the l-th layer, and F L-l is the feature map of the L - l-th layer of the encoder. It is introduced through skip connections to provide the fine-grained details necessary to maintain spatial accuracy during the upsampling process. Through these sequential transposed convolution operations, the decoder reconstructs the feature map at gradually increasing resolutions and finally reaches the original input resolution H×W.
[0128] The output of the decoder undergoes a channel transformation and a Softmax operation to generate a segmentation probability map, and finally a parcel quantity map is estimated from the segmentation probability map.
[0129] In one embodiment, the terminal is pre-configured locally with a trained HS-TransUNet model so that after the terminal obtains the parcel phase map, it can segment the parcel phase map through the pre-configured model to obtain the parcel quantity map. This model can be trained by the terminal locally or trained by the server and sent to the terminal.
[0130] In one embodiment, after obtaining the wrapped phase diagram, the terminal dynamically obtains the pre-trained HS-TransUNet model from the server, so as to count the packages through the dynamically obtained model for the wrapped phase diagram of the package.
[0131] In one embodiment, step 110 includes: inputting the background image into the HS-ResNet50 neural network, and predicting the first six Zernike coefficients through this network.
[0132] In the above embodiment, a modified HS-ResNet50 network is used, and its final fully connected layer outputs 6 neurons to predict the first six Zernike coefficients. Then, in step 112, the first six Zernike coefficients are used to fit the Zernike surface to obtain the background distortion data.
[0133] Among them, the processing process of the HS-ResNet50 network for the background image is the same as the processing process of the convolutional encoder module in the HS-TransUNet neural network for the input wrapped phase diagram of the package.
[0134] Figure 2 It is a schematic flowchart of the process of preprocessing the hologram to obtain the wrapped phase diagram in one embodiment.
[0135] Specifically, the hologram is subjected to fast Fourier transform, window filtering, and inverse fast Fourier transform, and the numerical value is used as the input of the arctangent function to obtain the wrapped phase diagram.
[0136] Figure 3 It is a flowchart of the HS-TransUNet neural network architecture for segmenting the wrapped phase diagram to obtain the package quantity diagram in one embodiment.
[0137] Specifically, the wrapped phase diagram with an input size of 224×224×1 is processed by the HS block to extract multi-scale features. These features are further processed by the HS-ResNet50 to generate hidden features. The hidden features are linearly projected to prepare for the subsequent processing of the transformer layer. In the transformer layer, by stacking 12 transformer Layer modules, long-range dependencies are captured, enhancing the global context connection of the features. The processed feature map is reshaped and gradually restored to the original resolution through a series of upsampling operations. During this process, the shallow features of the encoder are spliced with the feature map of the decoder through skip connections to enrich the fine details in the reconstruction process. Finally, the final segmentation probability map is obtained through a convolutional layer (Conv 3x3 ReLU) and feature splicing.
[0138] Figure 4 It is a schematic flowchart of using the HS-ResNet50 neural network to perform Zernike polynomial fitting to obtain the background distortion data in one embodiment.
[0139] Specifically, the Zernike coefficients of the background image are predicted using the HS-ResNet50 neural network. The segmented background image obtained through HS-TransUNet is input into the HS-ResNet50 network, which has been modified so that its final fully connected layer outputs 6 neurons, specifically for predicting the first six Zernike coefficients. The HS-ResNet50 network learns the mapping relationship from the background image to the Zernike coefficients through training. The dataset used in the training process includes various background distortion situations, ensuring that the network has good generalization ability. The Zernike coefficients output by the network are then used for Zernike polynomial synthesis to fit the Zernike surface, obtaining an accurate representation of the background distortion data, thereby effectively eliminating the influence of background distortion on the true phase of the object and improving the accuracy of phase unwrapping.
[0140] In one embodiment, the training steps of the HS-ResNet50 neural network model include: First, obtain the randomly generated first six Zernike coefficients, and use the randomly generated first six Zernike coefficients to fit the Zernike surface; then eliminate the object region of the Zernike surface to obtain a Zernike surface containing only the background region, which serves as the background image dataset for training the HS-ResNet50 neural network model; then use the obtained background image as the input feature, and use the randomly generated corresponding first six Zernike coefficients as the expected output feature for model training to obtain a trained HS-ResNet50 neural network model.
[0141] The above embodiments only represent several implementation manners of the present application, and their descriptions are relatively specific and detailed, but should not be construed as limiting the scope of the invention patent. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several deformations and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
[0142] Figure 5 It is a schematic flow diagram of the transformer layer in the HS-TransUNet neural network in one embodiment.
[0143] Specifically, the transformer layer reshapes the final feature map of the convolutional encoder into patches of size P×P and maps them to the d-dimensional feature space through linear embedding. The features are fed into the multi-head self-attention (MHSA) module to calculate query, key, and value vectors, and global dependencies are obtained through the scaled dot-product attention mechanism. The output of the MHSA is combined with the input features and then subjected to layer normalization. The features are further enhanced through a feed-forward network, which includes two fully connected layers and the GELU activation function, and its output is also updated through residual connection and layer normalization. Finally, the transformer layer outputs a feature representation that fuses global context information.
[0144] Figure 6 This is a schematic diagram showing the effect of obtaining an unwrapped phase map from a wrapped phase map in an embodiment. As Figure 6 shown, subfigure (a) is the wrapped phase map of three sample types, subfigure (b) is the corresponding wrapped count map obtained by processing through the HS-TransUNet neural network, and subfigure (c) is the corresponding unwrapped phase map obtained by superimposing the wrapped phase map multiplied by 2π and the wrapped count map.
[0145] Figure 7 This is a schematic diagram showing the effect from the unwrapped phase map to the true phase of the target object in an embodiment. As Figure 7 shown, subfigure (a) is the unwrapped phase map of three sample types, subfigure (b) is the corresponding background map obtained by performing background segmentation through the HS-TransUNet neural network, subfigure (c) is the background distortion data obtained by further performing Zernike polynomial fitting on the background map, subfigure (d) is the true phase of the corresponding target object obtained by subtracting the background distortion data from the unwrapped phase map, and subfigure (e) is the true value of three sample types.
[0146] In one embodiment, as Figure 8 shown, a phase unwrapping and phase distortion elimination device 800 is provided, including: a data acquisition module 801, a preprocessing module 802, an unwrapping module 803, a background segmentation module 804, and a distortion elimination module 805, where
[0147] The data acquisition module 801 is configured to acquire and record the hologram of the object to be measured;
[0148] The preprocessing module 802 is configured to perform a fast Fourier transform, window filtering, and an inverse fast Fourier transform on the hologram, and use the numerical value as the input of the arctangent function to obtain the wrapped phase map;
[0149] The unwrapping module 803 is configured to input the wrapped phase map into the HS-TransUNet neural network for wrapped count segmentation to obtain a wrapped count map, then multiply the wrapped count map by 2π, and superimpose it with the wrapped phase map to obtain an unwrapped phase map;
[0150] The background segmentation module 804 is configured to input the unwrapped phase map into the HS-TransUNet neural network for background segmentation to obtain a background map;
[0151] The distortion elimination module 805 is configured to input the background map into HS-ResNet50 for Zernike polynomial fitting to obtain the first six Zernike coefficients, use the first six Zernike coefficients to predict the background distortion data, and then subtract the background distortion data from the unwrapped phase map to obtain the true phase of the target object.
[0152] In one embodiment, the above-mentioned phase unwrapping and phase distortion elimination device includes: a model training module;
[0153] The model training module is used to obtain a target hologram set; perform edge blurring, random scaling, translation, and rotation processing on the holograms in the hologram set to obtain a real phase data set; add the real phase to random distortion and Gaussian noise to obtain an unwrapped phase data set; perform wrapping processing on the unwrapped phase to obtain a wrapped phase map and a wrapped quantity map, which are used as the training data set of the HS-TransUNet neural network; use the obtained wrapped phase map as the input feature and the obtained corresponding wrapped quantity map as the desired output feature to perform model training to obtain a trained HS-TransUNet neural network model.
[0154] In one of the embodiments, the target hologram set satisfies at least one of the following conditions: The following conditions include: There are multiple types of objects corresponding to the target hologram set and they have biological significance; There are various shapes and sizes of the objects corresponding to the target hologram set; There are various positions and directions of the objects corresponding to the target hologram set.
[0155] In one embodiment, the present application provides a computer device, and its internal structure can be referred to Figure 9 . The device includes a processor, a memory, a communication interface, a display screen, and an input device, and each component is connected through a system bus. Among them, the processor is responsible for calculation and control; the memory consists of a non-volatile storage medium and an internal memory. The non-volatile storage medium is used to store the operating system and computer programs, and the internal memory provides a running environment for the operation of the operating system and computer programs; the communication interface supports wired or wireless communication, and the wireless communication methods include WIFI, operator network, NFC, etc.; the display screen can be a liquid crystal display screen or an electronic ink display screen; the input device includes a touch layer, buttons, a trackball, a touchpad, and can also be externally connected to a keyboard, a mouse, etc.
[0156] It should be noted that Figure 9 The structure shown is only a partial structure schematic diagram related to the solution of the present application, and it is not a limitation on the electronic device applicable to the present application. The actual computer device may include more or fewer components according to requirements, or combine some components, or adopt different component layout methods.
[0157] In one embodiment, a computer device is provided, which only includes a memory and a processor. A computer program is stored in the memory, and when the processor executes the program, the steps in the above method embodiments can be implemented.
[0158] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the steps in the above method embodiments can be implemented.
[0159] Those skilled in the art should understand that all or part of the processes of implementing the methods in the above embodiments can be completed by computer program instructions related to hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it covers the processes of the above method embodiments. The memory, storage, database, or other media mentioned in this application all include non-volatile and volatile memories. Non-volatile memories include ROM, magnetic tapes, floppy disks, flash memories, optical memories, etc.; volatile memories include RAM (such as SRAM, DRAM, etc.) or external cache memories.
[0160] The technical features in the embodiments of the present application can be combined arbitrarily as long as there is no contradiction, and they all belong to the protection scope of the present application. The above embodiments only show several implementation manners of the present application, and the description is relatively specific and detailed, but should not be construed as a limitation on the patent scope of the present application. Those of ordinary skill in the art can make deformations and improvements to the present application without departing from the concept of the present application, and these deformations and improvements all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application should be subject to the appended claims.
Claims
1. A real-time holographic phase unwrapping and phase distortion elimination method, characterized in that: include: Acquire and record the hologram of the object to be measured; Preprocessing the hologram to obtain a wrapped phase image; Inputting the package phase map into the HS-TransUNet neural network for package counting and segmentation to obtain a package quantity map; Multiply the wrapped quantity map by 2π, and then superimpose it with the wrapped phase map to obtain an unwrapped phase map; Inputting the unwrapped phase image into the HS-TransUNet neural network for background segmentation to obtain a background image; The background image is input into the HS-ResNet50 neural network for Zernike polynomial fitting to obtain the first six Zernike coefficients; Using the first six Zernike coefficients to predict background distortion data; The unwrapped phase image is subtracted from the background distortion data to obtain the true phase of the target object.
2. The real-time holographic phase unwrapping and phase distortion elimination method according to claim 1, characterized in that: The specific steps of preprocessing the hologram include: The hologram is subjected to fast Fourier transformation, window filtering and fast inverse Fourier transformation, and the numerical value is used as an input of an inverse tangent function to obtain a wrapped phase map.
3. The method for performing package counting segmentation on a package phase diagram according to claim 1, characterized in that: The HS-TransUNet neural network includes a convolutional encoder module, a transformer layer, a decoder module and a classification layer.
4. The method for performing package counting segmentation on a package phase diagram according to claim 3, characterized in that: The convolutional encoder module performs the following processing: Adjust the channel dimension of the input features through 1×1 convolution; Divide the feature map into multiple groups and perform convolution operations in parallel to extract local features; Through layered splitting and splicing, the inter-group features are integrated to expand the receptive field; Residual connection is used to retain the original feature information.
5. The method for performing package counting segmentation on a package phase diagram according to claim 3, characterized in that: The converter layer comprises: Reshape the feature map into multiple small blocks and embed them into a high-dimensional feature space; Use multi-head self-attention mechanism to capture long-range dependencies; The feature representation is further enhanced through a feed-forward network.
6. A real-time holographic phase unwrapping and phase distortion elimination system, characterized in that: The system comprises: A data acquisition module, used to acquire and record a hologram of the object to be measured; A preprocessing module, used for performing fast Fourier transform, window filtering and fast inverse Fourier transform on the hologram, and taking the numerical value as input of an inverse tangent function to obtain the wrapped phase map; An unwrapping module is used to input the wrapped phase map into the HS-TransUNet neural network to perform package counting segmentation to obtain a package quantity map, and then multiply the package quantity map by 2π, and superimpose it with the wrapped phase map to obtain an unwrapped phase map; A background segmentation module, used for inputting the unwrapped phase image into the HS-TransUNet neural network to perform background segmentation to obtain a background image; The distortion elimination module is used to input the background image into HS-ResNet50 for Zernike polynomial fitting to obtain the first six Zernike coefficients, use the first six Zernike coefficients to predict the background distortion data, and then subtract the unwrapped phase image from the background distortion data to obtain the true phase of the target object.
7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Image phase unwrapping method and device
CN120970533A
Image phase unwrapping method and apparatus
CN120970533B