Abstract:
Foreign objects such as plastics and paper scraps mixed into cut tobacco during the cigarette manufacturing process seriously affect product safety. Traditional deep learning-based detection models perform well on closed-set datasets but struggle with the "open-set" problem, where impurity categories dynamically change in industrial scenarios. This paper proposes an Open-Set Foreign Object Detection framework (OS-FOD) for tobacco impurities. Built upon Faster R-CNN, OS-FOD integrates a Class Contrastive Learning (CCL) network and an Uncertainty-Aware Labeling Network (UAN). By structuring the feature space and dynamically mining pseudo-unknown samples, the model learns to identify unknown impurities. Furthermore, to address the complex background and small, low-contrast target characteristics, a Feature Self-Adaptive Enhancement module (FSFA) is designed to suppress background noise and enhance impurity features via an attention mechanism. The main conclusions are as follows: 1) the Feature Self-Adaptive Enhancement (FSFA) module suppresses background noise and enhances fine-grained impurity features through dual channel and spatial attention mechanisms, enabling the model to maintain high closed-set detection accuracy while acquiring open-set recognition capability; 2)the Class Contrastive Learning (CCL) network pulls intra-class samples together and pushes inter-class samples apart, constructing a compact known-class feature space with clear boundary regions and reducing the risk of unknown samples being misclassified as known categories; 3)the Uncertainty-Aware Labeling Network (UAN) dynamically mines high-quality pseudo-unknown samples, enabling the model to explicitly learn the "unknown" concept and achieving an unknown-class recall of 82.42%; 4)the open-set decision fusion module calibrates the classification confidence with multi-source uncertainty, improving the reliability of open-set discrimination. This provides an effective solution for reliable impurity detection in dynamic industrial environments. This provides an effective solution for reliable impurity detection in dynamic industrial environments.