Abstract:
Modified atmosphere pillow bags have been widely used in the entire processing of various agricultural products during preservation, shipment, and consumption. However, the sealing defect, storage and shipment squeezing can result in the leakage or even flat containment of the modified atmosphere pillow bags. Furthermore, manual inspection cannot fully meet the modern machine packaging, leading to the inevitable leaking and deterioration of bag contents. In this study, a novel detection was proposed for the leaky-modified atmosphere pillow bags using computer vision and deep learning. The single-dimensional Vision Transformer (ViT) models were deployed to remove the unwanted features. A pre-processing BiSeNet model was applied to the conventional Vision Transformer for better performance. Multi-dimensional Vision Transformer (MdF-ViT) was fused to detect the leaky modified atmosphere pillow bags from different perspectives. MdF-ViT models were established in the featured fusion of front-, side-, and top-view, simultaneously. Firstly, more than 2160 images were collected from three views of samples A, B, and C in the pillow bags. Then, the visual feature of leaky bags was analyzed in the contour variation pattern using deep learning in machine vision scope. Secondly, the detection of leakage was carried out using various deep learning. The contour features of each bag were discovered practical to morphological learnings among neuron network models. Thirdly, the BiSeNet model was established to extract the contour features for each bag. Therefore, the morphological patterns were learnable by deep learning models. Finally, various models were trained and then validated using the MdF-ViT model. The experimental results showed that the accuracies of MdF-ViT models reached 97.5%, 97.5%, and 97.5%, respectively, which were higher than the averaged accuracies of 78.33%, 91.67%, and 85.83% acquired by original ViT models. The
F1-scores of MdF-ViT models were 97.6%, 97.6%, and 97.4%, respectively, which were higher than the averaged
F1-scores of 64.70%, 92.33%, and 87.67%, respectively, compared with the original ViT models. A comparison was made on the ViT and MdF-ViT models. The higher accuracy, stability and generalization of MdF-ViT models were achieved to detect the leaky pillow bags with the contour extraction. The average accuracies of the testing sample B and C with sample A trained models were 35.00% and 34.17% higher than those of the original ViT models, respectively. The average accuracies of sample B-trained models testing sample A and sample C were 31.67% and 30.83% higher, respectively, while there were 47.50% and 20.00% higher average accuracies in the sample C-trained models testing sample A and sample B. The averaged F1-Scores in the sample A trained models testing sample B and sample C were 43.57% and 78.13% higher, respectively, compared with the original ViT models. The averaged
F1-Scores of sample B-trained models testing sample A and sample C were 51.53% and 61.07% higher, respectively, while there were 51.43% and 28.30% higher averaged
F1-Scores in the sample C trained models testing sample A and sample B, respectively, compared with original ViT models. There were also better than accuracies of 87.50%, 62.50%, and 85.00% acquired by typical ResNet-18 networks, respectively, and better than
F1-scores of 86.50%, 72.70%, and 85.70%, respectively. The superior accuracies of 85.00%, 87.50%, and 90.00% were acquired by typical VGG-16 networks, respectively, and the superior
F1-scores of 87.50%, 87.80%, and 90.50%, respectively. Consequently, the final evidence supported that the recognition of leaked modified atmosphere pillow bags was feasible by the MdF-ViT model. Effective and economic detection was introduced into the leaky modified atmosphere pillow bags during production. The finding can also provide an alternative approach to reducing economic loss among manufacturers and consumers.