Improved U2Net-Based Surface Defect Detection Method for Blister Tablets
Abstract
:1. Introduction
- (1)
- Small target characteristics: defects on tablets are usually small and subtle, irregular in shape, and easily masked by information from other areas. This makes it more difficult to extract image features, resulting in lower accuracy of defect recognition.
- (2)
- Multi-scale detection problem: the size of the defect image is different, and the size of the defect is also very different, so it is difficult to detect defects of different sizes.
- (3)
- Edge detection problems: whether or not the defective edge of a blister tablet can be completely detected is an important indicator of whether or not the defect is completely detected.
- (1)
- The semantic segmentation model is used for the first time to detect the defects of blister tablets, which can not only detect the defects but also detect the size, shape, and position.
- (2)
- The U2Net model is improved, so that the model detection ability is improved and the fine defects can be clearly detected.
- (3)
- For the first time, the method of determining segmentation threshold by local mean and OTSU is proposed to determine the accuracy of segmentation.
2. Related Works
3. Experimental Data Acquisition
4. Proposed Methods
4.1. U2Net Detection Models
4.2. Large Kernel Attention Mechanism
4.3. Combination of U2Net and LKA
4.4. Loss Function Consisting of Gaussian Laplace Operator and Cross-Entropy Function
4.5. Segmentation Threshold Determination Based on Local Mean and OTSU Method
4.6. Overall Inspection Flowchart
5. Experiments and Analysis of Results
5.1. Experimental Environment
5.2. Evaluation Indicators
5.3. Training Parameter Settings
5.4. Comparison of Different Network Models
5.5. Ablation Experiment
5.6. Blister Tablets Visual Inspection Results
6. Conclusions
- (1)
- The fusion of U2Net and the large kernel attention mechanism improves the feature extraction ability of the model, enabling the model to extract defect features completely and enhancing the detection effect, with the highest index among the same type of detection models. The improved U2Net model can meet the requirements of rapid detection with a detection time of 0.05S; the accuracy rate is 99.8%; the precision rate is 96.3%; and the recall rate is 84.5%.
- (2)
- The loss function composed of Gaussian Laplacian and cross entropy can enhance the model’s attention to the defects at the edge of the blister sheet, and can reduce the noise, so that the model can segment the defect edges more smoothly.
- (3)
- Using OTSU and local average methods can improve the overall accuracy of the model.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- World Health Organization. Good Manufacturing Practices for Pharmaceutical Products: Main Principles; WHO Technical Report Series; World Health Organization: Geneva, Switzerland, 2019; pp. 1–50. [Google Scholar]
- International Conference on Harmonisation. ICH Harmonised Tripartite Guideline: Quality Risk Management (Q9); International Conference on Harmonisation of Technical Requirements for Pharmaceuticals for Human Use: Geneva, Switzerland, 2005; pp. 1–25. [Google Scholar]
- United States Pharmacopeia. USP 42, NF 37, 3rd ed.; United States Pharmacopeial Convention: Rockville, MD, USA, 2019; pp. 1–1200. [Google Scholar]
- Sugawara, K.; Suzuki, K.; Hirosawa, N. Blister packaging design for the protection and stability of pharmaceutical products. J. Pharm. Sci. Technol. 2010, 64, 123–130. [Google Scholar]
- Yao, X.; Li, Q.; Zhang, H. Detection techniques for tablet blister packaging: Ensuring pharmaceutical quality and safety. Int. J. Pharm. Qual. Assur. 2015, 5, 215–222. [Google Scholar]
- Liu, S. Study on Real-time Tablets Image Detection and Processing System Based on Image Processing and Its Application. Comput. Mod. 2013, 1, 66–69. [Google Scholar]
- Fang, L.; Lin, M. Discrimination of Varieties of Tablets Using Near-Infrared Spectroscopy by Wavelet Clustering. Spectrosc. Spectr. Anal. 2010, 30, 2958–2961. [Google Scholar]
- Qin, X.; Zhang, Z.; Huang, C.; Dehghan, M.; Zaiane, O.; Jagersand, M. U2-Net: Going deeper with nested U-structure for salient object detection. Pattern Recognit. 2020, 106, 107404. [Google Scholar] [CrossRef]
- Fang, W.; Wang, Y. Defect Detection Method for Drug Packaging with Aluminum Plastic Bubble Cap. Packag. Eng. 2019, 40, 133–139. [Google Scholar]
- Yu, H.; Wu, W.; Cheng, Y. Application of Improved Otsu Algorithm in the Defect Detection of Aluminium-plastic Blister Drugs. Packag. Eng. 2014, 35, 15–18. [Google Scholar]
- Wu, W.; Yu, H.; Cheng, Y. Edge Detection of Aluminum-Plastic Blister Drugs Based on Improved Canny Algorithm. J. Hunan Univ. Technol. 2014, 28, 67–70. [Google Scholar]
- Chen, Y.; Ge, B.; Wang, J.; Lu, J.; LI, C. Blister packaging drug defect identification based on integrated classifier. Packag. Eng. 2021, 42, 250–259. [Google Scholar]
- Duan, Z.; LI, S.; Hu, J.; Yang, J.; Wang, Z. Capsule Defect Detection Method Based on Mask R-CNN. Radio Eng. 2020, 50, 857–862. [Google Scholar]
- Huang, Z. Study on Tablet Surface Defect Detection Based on Improved YOLOv5; Chongqing University of Science and Technology: Chongqing, China, 2023. [Google Scholar]
- Jing, J.; Wang, Z.; Matthias, R.; Zhang, H. Mobile-Unet: An efficient convolutional neural network for fabric defect detection. Text. Res. J. 2020, 92, 004051752092860. [Google Scholar] [CrossRef]
- Zhu, X.; Cheng, Z.; Wang, S.; Chen, X.; Lu, G. Coronary angiography image segmentation based on PSPNet. Comput. Methods Programs Biomed. 2021, 200, 105897. [Google Scholar] [CrossRef] [PubMed]
- Vijay, B.; Alex, K.; Roberto, C. SegNet: A Deep Convolutional Encoder-Decoder Architecture for Image Segmentation. arXiv 2015, arXiv:1505.07293. [Google Scholar]
- Zhang, E.; Kang, X. Pixel-level pruning deep supervision UNet++ for detecting fabric defects. Text. Res. J. 2023, 93, 5416–5436. [Google Scholar] [CrossRef]
- Wu, Z.; Lan, Y.; Li, L.; Xiong, X.; Qiao, W.; Wang, w. Metal bar scratch defect detection based on improved U2Net. Modul. Mach. Tool Autom. Manuf. Tech. 2024, 157–160+167. [Google Scholar] [CrossRef]
- Wang, Y.; Ge, H. Metal surface defect detection algorithm based on U2-Net. Nanjing Univ. Nat. Sci. 2023, 59, 413–424. [Google Scholar]
- Cheng, H.; Li, Y.; Li, Y.; Hu, Q.; Wang, J. Surface crack detection of concrete structures based on improved U2Net model. Water Resour. Hydropower Eng. 2024, 55, 159–171. [Google Scholar]
- Guo, M.; Lu, C.; Liu, Z.; Cheng, M.; Hu, S. Visual attention network. Comput. Vis. Media 2023, 9, 733–752. [Google Scholar] [CrossRef]
- Wang, X. Laplacian operator-based edge detectors. IEEE Trans. Pattern Anal. Mach. Intell. 2007, 29, 886–890. [Google Scholar] [CrossRef]
- Rybakova, E.O.; Limonova, E.E.; Nikolaev, D.P. Fast Gaussian Filter Approximations Comparison on SIMD Computing Platforms. Appl. Sci. 2024, 14, 4664. [Google Scholar] [CrossRef]
- Senthilkumaran, N.; Vaithegi, S. Image Segmentation By Using Thresholding Techniques For Medical Images. Comput. Sci. Eng. Int. J. 2016, 6, 1–13. [Google Scholar]
- Misael, L.; Luis, M.L.; Francisco, M.G.; Jorge, M.; Eduardo, C.; Francisco, J.V. Automatic Early Broken-Rotor-Bar Detection and Classification Using Otsu Segmentation. IEEE Access 2020, 8, 112624–112632. [Google Scholar]
Model | Acc | P | R | IoU | Testing Time(s) | |
---|---|---|---|---|---|---|
Improved U2Net | 0.998 | 0.963 | 0.903 | 0.932 | 0.845 | 0.05 |
U2Net | 0.986 | 0.944 | 0.834 | 0.885 | 0.832 | 0.047 |
Pspnet | 0.942 | 0.578 | 0.67 | 0.621 | 0.581 | 0.07 |
Deeplabv3 | 0.981 | 0.934 | 0.851 | 0.891 | 0.792 | 0.06 |
RSLU | Gloss | Local Mean and OTSU | Acc | P | R | F1-Score | IoU |
---|---|---|---|---|---|---|---|
× | × | × | 0.986 | 0.944 | 0.834 | 0.885 | 0.832 |
√ | × | × | 0.994 | 0.953 | 0.899 | 0.925 | 0.843 |
√ | √ | × | 0.994 | 0.956 | 0.898 | 0.926 | 0.843 |
√ | √ | √ | 0.998 | 0.963 | 0.903 | 0.932 | 0.845 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Zhou, J.; Huang, J.; Liu, J.; Liu, J. Improved U2Net-Based Surface Defect Detection Method for Blister Tablets. Algorithms 2024, 17, 429. https://doi.org/10.3390/a17100429
Zhou J, Huang J, Liu J, Liu J. Improved U2Net-Based Surface Defect Detection Method for Blister Tablets. Algorithms. 2024; 17(10):429. https://doi.org/10.3390/a17100429
Chicago/Turabian StyleZhou, Jianmin, Jian Huang, Jikang Liu, and Jingbo Liu. 2024. "Improved U2Net-Based Surface Defect Detection Method for Blister Tablets" Algorithms 17, no. 10: 429. https://doi.org/10.3390/a17100429
APA StyleZhou, J., Huang, J., Liu, J., & Liu, J. (2024). Improved U2Net-Based Surface Defect Detection Method for Blister Tablets. Algorithms, 17(10), 429. https://doi.org/10.3390/a17100429