CATR-Net: Cattle–Attentive transformer with adaptive and enhanced segmentation and recognition

Xiaopu Feng, Jiaying Zhang, Yongsheng Qi, Liqiang Liu, Yongting Li · Computers and Electronics in Agriculture · 2025

In open–range cattle–face analysis, conventional segmentation networks struggle to preserve fine–scale edge cues, and recognition networks weakly model salient regions and local–global context, yielding brittle performance under changing poses and illumination. We propose CATR–Net, an end–to–end framework that unifies segmentation and identification. In its segmentation branch, a Multiscale Edge–enhanced Upsampling Module (MEUM) is grafted onto the DA–TransUNet decoder to restore high–frequency boundaries and suppress up–sampling blur; in the recognition branch, a Dynamic Contextual Attention Module (DCAM) is inserted between the Stem and MaxViT blocks, and Dynamic Adaptive Interaction Normalization (DAIN) replaces the static Layer Normalization in LSRA (Local Region Self-Attention) with DyT (Dynamic tanh), together enabling pose– and scale–aware fusion of local priors with global dependencies. The recognition loss is further equipped with a confidence–gap regularizer that dynamically tunes the Dynamic–Tanh parameters, amplifying ambiguous features while stabilizing high–confidence activations. On a 57645–image multi–pose dataset, the segmentation branch achieves 93.35 % mIoU and 96.45 % mDSC with a 417 MB model, whereas the recognition branch attains 97.03 % accuracy and 95.19 % F1-score with a 457 MB footprint—both surpassing state–of–the–art baselines at comparable complexity.

Read the paper · More papers on PaperTik