Abstract:Complex background interference, edge blurring, and high computational costs of high-precision models in tongue image segmentation limit the deployment of automated tongue diagnosis systems. To address these issues, a lightweight tongue image segmentation model named THA-UNet is proposed based on a complementary gating mechanism. A dual-layer complementary gating framework is constructed in the encoder-decoder architecture. In the encoder, a three-branch spatial-channel attention module is designed, which fuses coordinate attention, improved channel attention, and an identity mapping branch. Multi-source information is dynamically aggregated through learnable parameter weighting, thereby compensating for the insufficient feature representation of the lightweight backbone. In the decoder, a complementary gating context attention module is designed. The normalized gating fusion of local saliency attention and lightweight positional attention is employed to collaboratively model local details and global dependencies. Additionally, a cascaded cross-layer progressive fusion mechanism is introduced, and multi-scale semantic information is injected layer by layer through a cascaded transmission strategy. ShuffleNetV2 is adopted as the encoding backbone, and the parameter count is only 5.82 M. Experiments on the BioHit and Tongue-1 datasets demonstrate that the Dice coefficients of THA-UNet reach 98.87% and 98.61%, respectively, and the IoU values are 97.77% and 97.26%, respectively. Accurate segmentation is achieved while maintaining lightweight properties.