Thermal imaging for sealing defect detection in pharmaceutical bags using a temporal fusion network - Liqiang Wang; Ziyang Leng; Cunmin Jiang; Rui Hua (PLoS ONE, 2026)
Sealing defects in pharmaceutical plastic bags pose significant risks to drug safety, as micro-leakages may remain undetected until transportation, causing economic losses and hazards. Traditional manual inspection and existing automated methods suffer from low efficiency, poor sensitivity to subtle defects, and difficulties in addressing class imbalance due to scarce defective samples. To address these issues, this study proposes a comprehensive detection framework that integrates thermal imaging analysis, physics-guided data augmentation, and a novel Temporal Multi-Feature Fusion Network (TMFFNet). Thermal imaging reveals defective areas with distinct localized temperature elevations, providing a reliable basis for defect identification. A physics-guided augmentation method is developed to synthesize realistic defects: it models defect contours via hybrid polynomials, simulates thermal diffusion using dual-Gaussian operators, and fuses synthetic defects into normal samples under geometric constraints. This method effectively mitigates class imbalance, expanding the number of defective samples from 28 real ones to 2104 synthetic ones, with a total of 4385 samples in the dataset. The proposed TMFFNet, a dual-branch temporal network, processes three consecutive thermal frames to capture temporal dynamics. Its global-local fusion module enhances sensitivity to small defects, while a channel-aware SE-Dense module suppresses background noise, reducing false alarms. Experimental results show that TMFFNet outperforms traditional networks with a test set accuracy of 0.9809, and other evaluation metrics also demonstrate favorable performance. This framework provides an efficient, non-destructive solution for full pharmaceutical packaging inspection, improving drug safety and production efficiency.