Objective In optical three-dimensional (3D) shape reconstruction, phase unwrapping is a critical step that directly affects reconstruction accuracy and efficiency. Traditional temporal phase unwrapping methods rely on multi-frame input, limiting their adaptability to dynamic scenes due to poor real-time performance. Meanwhile, spatial unwrapping techniques, though capable of single-frame processing, are prone to spectral aliasing, leading to significant phase jump errors at edges. Current deep learning-based methods face three core limitations: accuracy bottlenecks under single-frame input, with noticeable prediction errors in complex texture and jump regions of industrial parts; contradictions between interpretability and robustness, as "black-box" models hinder error tracing while physics-integrated models suffer from reduced convergence efficiency due to complex constraints; and the challenge of balancing efficiency and precision, where lightweight models sacrifice detail extraction and high-precision models fail to meet real-time requirements in industrial online detection. To address these issues, this study proposes a multi-task deep learning framework for high-precision absolute phase unwrapping under single-frame input conditions. Methods A multi-task architecture model (MTU-SEDD) featuring a shared encoder and dual decoders is developed. The model incorporates three key innovative designs: 1) a shared encoder-dual branch decoder structure, where both the encoder and decoder employ multi-branch dilated convolution modules. These modules utilize convolution kernels with different dilation rates (e. g., dilation rate 1 for focusing on local fringe deformation and rate 4 for capturing global order distribution patterns) to extract multi-scale fringe features, enabling simultaneous prediction of wrapped phase and fringe order from a single input frame. 2) A channel-spatial hybrid attention (CSHA) module is specifically designed for fringe projection images. In the frequency domain, this module performs precise channel weight calibration through global average pooling and fully connected layers; in the spatial domain, it introduces anisotropic Gaussian kernels to enhance feature responses in phase jump regions, effectively suppressing noise interference. 3) A dynamic gradient balancing strategy is proposed, which adaptively adjusts task weights by calculating the gradient norms of task losses is proposed. This strategy mitigates gradient competition between the wrapped phase regression task [with mean-square error (MSE) loss] and the fringe order classification task (with cross-entropy loss), ensuring balanced convergence of both tasks. Experiments were conducted on both simulated and real datasets. The simulated dataset was constructed using a random virtual object surface generator, producing height maps with 1-3 convex structures (including rectangles, ellipses, polygons, and noise-disturbed surfaces) with heights ranging from 5 mm to 60 mm and resolutions of 128x128 and 480x640. The real dataset consisted of 1120 groups of deformed fringe images of objects with diverse materials (plaster, metal, and plastic), covering complex surface deformations (grooves, edge mutations) and specular reflection interference. Performance was evaluated using metrics including structural similarity index (SSIM), peak signal-to-noise ratio (PSNR), normalized root mean square error (NRMSE), and root mean square error (RMSE), with comparisons against traditional convolutional neural network (CNN), DL-SPU, MultiResHNet, and U-Net (double) models. Ablation experiments were also conducted to verify the contributions of key modules, including the multi-task balancing strategy, dual-branch structure, and multi-branch dilated convolution. Results and Discussions Experimental results clearly demonstrate the superiority of the proposed method. In simulated dataset tests, MTU-SEDD achieved significantly lower RMSE than the traditional CNN model across all samples-for instance, image 1 showed an RMSE of 0.9260 for MTU-SEDD versus 8.9656 for CNN. The model maintained stable performance across different resolutions, with an RMSE fluctuation of <= 0.15 between 128x128 and 480x640 simulations. In real scenario experiments, MTU-SEDD outperformed other single-frame models, achieving the highest SSIM (0.9885), PSNR (54.64 dB), and the lowest NRMSE (0.0019), with an inference speed of 75.1 ms/frame. Ablation experiments further validated the necessity of each module: removing the multi-task balancing strategy (Exp-1) reduced SSIM by 0.72% and increased edge errors due to the marginalization of the fringe order task; Independent training of dual branches (Exp-2) led to a 131 % increase in runtime and accuracy degradation due to the lack of shared feature learning and potential misalignment between branch outputs; replacing multi-branch dilated convolution with ordinary convolution (Exp-3) caused severe detail loss, dropping SSIM to 0.8847 as the model failed to capture multi-scale features. Specifically, the CSHA module reduced edge region errors by 68%, while the dynamic gradient balancing strategy decreased inference time by 40 %and avoided multi-frame registration errors. Conclusions This study successfully develops a multi-task learning-based deep learning framework for structured light phase unwrapping. The shared encoder-dual branch decoder structure enables joint optimization of wrapped phase regression and fringe order classification tasks, achieving high precision and real-time performance. The channel-spatial hybrid attention module effectively suppresses spectral aliasing by enhancing phase jump region features. The dynamic gradient balancing strategy ensures stable model performance across different resolutions, demonstrating strong generalization. Future work will focus on integrating topology repair algorithms with 3D attention mechanisms and achieving model lightweighting via knowledge distillation to further accelerate training and inference.
更多