High-precision automated detection of metal welding defects is critical to ensuring structural safety and reliability in modern manufacturing. However, existing methods often struggle with insufficient fine-grained feature retention, low efficiency in multi-scale information fusion, and vulnerability to complex background interference, resulting in low detection accuracy. This work addresses the limitations by introducing the DEIM-SFA, a novel detection framework designed for automated visual inspection in industrial machine vision sensors. The model introduces a novel structure-aware dynamic convolution (SPD-Conv), effectively focusing on the fine-grained structure of defects while suppressing background noise interference; an innovative multi-scale dynamic fusion pyramid (FTPN) architecture is designed to achieve efficient and adaptive aggregation of feature information from different receptive fields, ensuring consistent detection of multi-scale targets; combined with a lightweight and efficient multi-scale attention module (EMA), this further enhances the model’s ability to locate salient regions in complex scenarios. The network is evaluated on a self-built welding defect dataset. Experimental results show that DEIM-SFA achieves a 3.9% improvement in mAP50 compared to the baseline model, mAP75 by 4.3%, mAP50–95 by 3.7%, and Recall by 1.4%. The model exhibits consistently significant superiority in detection accuracy across targets of various sizes, while maintaining well-balanced model complexity and inference efficiency, comprehensively surpassing existing state-of-the-art (SOTA) methods.
Accurate body-weight measurement is important for precision pig farming, but conventional weighing methods are labor-intensive and may disturb normal animal activity. Although three-dimensional sensing systems can provide reliable geometric information, their deployment cost limits large-scale application in commercial farms. This study proposes a non-contact pig weight estimation framework based on standard RGB images. The framework combines SAM 2 foreground extraction with a transformer-based dorsal segmentation network to obtain stable body contours under complex farm conditions. Cross-covariance attention and local patch interaction modules are introduced to preserve both global body structure and local boundary details during segmentation. A hybrid loss function combining focal loss and label-distribution-aware margin loss is further adopted to address foreground-background imbalance. After segmentation, 17 morphometric features are extracted from the dorsal region and used for weight prediction with XGBoost regression. Experiments were conducted on the public PIGRGB-Weight dataset containing 12,476 RGB images from 124 pigs. The proposed method achieved a mean absolute error of 2.983 kg and an value of 0.9891. Compared with a DeepLabV3+-based baseline under the same regression protocol, the proposed framework reduced the prediction error by 24.1%. The results indicate that improving dorsal segmentation quality can substantially enhance the stability of morphometric feature extraction from low-cost RGB images.
10 August 2026 in PFG – Journal of Photogrammetry, Remote Sensing and Geoinformation Science