# Thermal imaging for sealing defect detection in pharmaceutical bags using a temporal fusion network

**Authors:** Liqiang Wang, Ziyang Leng, Cunmin Jiang, Rui Hua

PMC · DOI: 10.1371/journal.pone.0343395 · PLOS One · 2026-03-09

## TL;DR

This paper introduces a thermal imaging framework with a novel neural network to detect sealing defects in pharmaceutical bags, improving drug safety and inspection efficiency.

## Contribution

A Temporal Multi-Feature Fusion Network (TMFFNet) and physics-guided data augmentation method for sealing defect detection in pharmaceutical packaging.

## Key findings

- Thermal imaging reveals sealing defects through localized temperature elevations.
- The physics-guided augmentation method generated 2104 synthetic defective samples from 28 real ones.
- TMFFNet achieved a test set accuracy of 0.9809, outperforming traditional methods.

## Abstract

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.

## Full-text entities

- **Diseases:** fatigue (MESH:D005221), Leather Defect (MESH:D000013)
- **Chemicals:** aluminum (MESH:D000535), vanadium oxide (-)

## Full text

_Full body text omitted from this summary view._ Fetch the complete paper as Markdown: https://tomesphere.com/paper/PMC12970890/full.md

## Figures

7 figures with captions in the complete paper: https://tomesphere.com/paper/PMC12970890/full.md

## References

34 references — full list in the complete paper: https://tomesphere.com/paper/PMC12970890/full.md

---
Source: https://tomesphere.com/paper/PMC12970890