Unsupervised Structural Defect Classification via Real-Time and Noise-Robust Method in Smartphone Small Modules
Abstract
1. Introduction
2. Related Work
3. Algorithm
3.1. Background Knowledge for OIS Actuator
3.2. Proposed Algorithm
3.3. High-Noise Reduction Technique for Small Components
- Global Binarization: The input image (1280 × 960) is binarized to emphasize the lens holder region.
- Lens Holder Detection: Starting from the estimated initial coordinates of the lens holder (defined through experiments as (637, 350)), pixels are expanded upward, downward, leftward, and rightward. The first occurrence of consecutive black pixels in each direction is considered the boundary of the lens holder, enabling automatic detection of its region. The expected width and height of the lens holder are approximately 356 and 89 pixels, respectively, which are used as reference tolerances to validate the detected region. This detected region is then used for subsequent preprocessing steps.
- Initial Cropping and Scaling: To exclude unnecessary surrounding areas from the input image, the image is cropped based on the center of the detected lens holder region. A 4× magnification is then applied to obtain an enlarged image.
- Gap-Specific ROI Assignment: From the enlarged image, three ROIs corresponding to the three target gaps are defined and extracted. The final dimensions of each preprocessed ROI are as follows:
- (1)
- ROI for OIS cover–lens holder: 1410 × 90
- (2)
- ROI for lens holder–ball guide: 1410 × 130
- (3)
- ROI for ball guide–AF carrier: 1410 × 140
- Noise Removal: To effectively reduce noise while preserving edge structures, a combination of a median filter and a guided filter (both determined through experimental validation) is applied to the image. Specifically, a median filter with a kernel size of 5 is used to suppress salt-and-pepper noise, followed by a guided filter with a radius of 8 and a regularization parameter (ε) of 500 to further smooth the image while maintaining structural details.
- ROI Brightness Adjustment: To account for the unique visual characteristics of each ROI, brightness correction is performed individually per region. Specifically, only the pixels whose intensity values fall within a predefined brightness range (low_thresh to high_thresh) are selectively enhanced by a fixed increase_value. This targeted adjustment improves contrast and feature visibility while avoiding overexposure of already bright regions.
- ROI Binarization: Each ROI is binarized to compress the data and produce the final preprocessed images.
3.4. Real-Time Precision Defect Classification Based on Unsupervised Learning
- Each AE input image obtained from the step-by-step preprocessing procedure is fed into three customized AEs, each tailored to a specific gap region. The architectures of these AEs were optimized based on extensive experimentation: the AE for the OIS cover–lens holder gap uses a 256 × 256 input size with two layers and a latent dimension of 128; the AE for the lens holder–ball guide gap employs a 128 × 128 input with four layers and a latent space of 32; and the AE for the ball guide–AF carrier gap adopts a 128 × 128 input with four layers and a latent dimension of 64. These model configurations were selected to balance reconstruction accuracy and computational efficiency for each specific ROI.
- The reconstruction error between the reconstructed image and the original AE input image is calculated.
- Defect classification is performed based on a threshold value defined in advance through AUC-based experiments.
- Finally, an AND operation is applied to the three classification results from the AE models. The final output is classified as normal only if all three results are normal; otherwise, the final result is classified as defective.
4. Experiments and Results
4.1. Data Collection
4.2. Results of High-Noise Reduction for Small Components
4.3. Experimental Results of Unsupervised Learning-Based Defect Classification
5. Conclusions and Future Work
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
Abbreviations
OIS | Optical Image Stabilization |
AF | AutoFocus |
ROI | Region of Interest |
ROC | Receiver Operating Characteristic |
AUC | Area Under the Curve |
TPR | True Positive Rate |
FPR | False Positive Rate |
AE | AutoEncoder |
References
- Apple iPhone Website. Available online: https://www.apple.com/iphone/ (accessed on 25 July 2025).
- Samsung Galaxy Phone Website. Available online: https://www.samsung.com/sec/smartphones/all-smartphones/ (accessed on 25 July 2025).
- Google Pixel Phone Website. Available online: https://store.google.com/us/?hl=en-US®ionRedirect=true (accessed on 25 July 2025).
- Xiaomi Mi Phone Website. Available online: https://www.mi.com/global/mobile/ (accessed on 25 July 2025).
- OIS Market Insight. Available online: https://www.verifiedmarketreports.com/product/optical-image-stabilizer-ois-market-size-and-forecast/ (accessed on 25 July 2025).
- OIS Market Outlook. Available online: https://dataintelo.com/report/global-optical-image-stabilizer-ois-market (accessed on 25 July 2025).
- Camera Optical Image Stabilizer Market Opportunities 2025. Available online: https://www.linkedin.com/pulse/camera-optical-image-stabilizer-market-xzbif (accessed on 25 July 2025).
- Kramer, M.A. Nonlinear principal component analysis using autoassociative neural networks. AIChE J. 1991, 37, 233–243. [Google Scholar] [CrossRef]
- Sohl-Dickstein, J.; Weiss, E.; Maheswaranathan, N.; Ganguli, S. Deep Unsupervised Learning using Nonequilibrium Thermodynamics. PMLR 2015, 37, 2256–2265. [Google Scholar]
- Breitenbach, J.; Eckert, I.; Mahal, V.; Baumgartl, H.; Buettner, R. Automated Defect Detection of Screws in the Manufacturing Industry Using Convolutional Neural Networks. In Proceedings of the 55th Hawaii International Conference on System Sciences, HICSS 2022, Virtual Event/Maui, HI, USA, 4–7 January 2022. [Google Scholar]
- Zou, L.; Zhuang, K.J.; Zhou, A.; Hu, J. Bayesian optimization and channel-fusion-based convolutional autoencoder network for fault diagnosis of rotating machinery. Eng. Struct. 2023, 280, 115708. [Google Scholar] [CrossRef]
- Weiss, E.; Caplan, S.; Horn, K.; Sharabi, M. Real-Time Defect Detection in Electronic Components during Assembly through Deep Learning. Electronics 2024, 13, 1551. [Google Scholar] [CrossRef]
- Kozamernik, N.; Bračun, D. A novel FuseDecode Autoencoder for industrial visual inspection: Incremental anomaly detection improvement with gradual transition from unsupervised to mixed-supervision learning with reduced human effort. Comput. Ind. 2025, 164, 104198. [Google Scholar] [CrossRef]
- Lim, J.Y.; Lim, J.Y.; Baskaran, V.M.; Wang, X. A deep context learning based PCB defect detection model with anomalous trend alarming system. Results Eng. 2023, 17, 100968. [Google Scholar] [CrossRef]
- Li, Y.; Yuan, S.; Wang, H.; Li, Q.; Liu, M.; Xu, C.; Shi, G.; Zuo, W. Triad: Empowering LMM-based Anomaly Detection with Vision Expert-guided Visual Tokenizer and Manufacturing Process. arXiv 2025, arXiv:2503.13184. [Google Scholar] [CrossRef]
- Klarák, K.; Andok, R.; Malík, P.; Kuric, I.; Ritomský, M.; Ritomský, I.; Tsai, H.Y. From Anomaly Detection to Defect Classification. Sensors 2024, 24, 429. [Google Scholar] [CrossRef]
- Wang, Z.; Yuan, H.; Lv, J.; Liu, C.; Xu, H.; Li, J. Anomaly Detection and Fault Classification of Printed Circuit Boards Based on Multimodal Features of the Infrared Thermal Imaging. IEEE Trans. Instrum. Meas. 2024, 73, 1–13. [Google Scholar] [CrossRef]
- Song, Y.; Wang, W.; Wu, Y.; Fan, Y.; Zhao, X. Unsupervised anomaly detection in shearers via autoencoder networks and multi-scale correlation matrix reconstruction. Int. J. Coal Sci. Technol. 2024, 11, 79. [Google Scholar] [CrossRef]
- Chen, S.; Bandaru, S.; Marti, S.; Bekar, E.T.; Skoogh, A. Comparison of unsupervised image anomaly detection models for sheet metal glue lines. Eng. Appl. Artif. Intell. 2025, 153, 110740. [Google Scholar] [CrossRef]
- Song, S.; Baek, J.G. New Anomaly Detection in Semiconductor Manufacturing Process using Oversampling Method. ICAART 2020, 2, 926–932. [Google Scholar] [CrossRef]
- Ester, M.; Kriegel, H.P.; Sander, J.; Xu, X. Density based spatial clustering of applications with noise. KDD AAAI Press 1996, 240, 226–231. [Google Scholar]
- Cui, Y.; Liu, Z.; Lian, S. Patch-Wise Auto-Encoder for Visual Anomaly Detection. In Proceedings of the IEEE International Conference on Image Processing (ICIP), Kuala Lumpur, Malaysia, 8–11 October 2023; pp. 870–874. [Google Scholar] [CrossRef]
- Lee, Y.; Kang, P. AnoViT: Unsupervised Anomaly Detection and Localization with Vision Transformer-Based Encoder-Decoder. IEEE Access 2022, 10, 46717–46724. [Google Scholar] [CrossRef]
- Dosovitskiy, A.; Beyer, L.; Kolensnikov, A.; Weissenborn, D.; Zhai, X.; Unterthiner, T.; Dehghani, M.; Minderer, M.; Heigold, G.; Gelly, S.; et al. An Image is Worth 16x16 Words: Transformers for Image Recognition at Scale. arXiv 2020, arXiv:2010.11929. [Google Scholar] [CrossRef]
- Zhang, J.; Chen, X.; Wang, Y.; Wang, C.; Liu, Y.; Li, X.; Yang, M.-H.; Tao, D. Exploring Plain ViT Reconstruction for Multi-class Unsupervised Anomaly Detection. Comput. Vis. Image Underst. 2025, 253, 104308. [Google Scholar] [CrossRef]
- Yang, Q.; Guo, R. An Unsupervised Method for Industrial Image Anomaly Detection with Vision Transformer-Based Autoencoder. Sensors 2024, 24, 2440. [Google Scholar] [CrossRef]
- Lu, R.; Wu, Y.J.; Tian, L.; Wang, D.; Chen, B.; Liu, X. Hierarchical vector quantized transformer for multi-class unsupervised anomaly detection. Adv. Neural Inf. Process. Syst. 2023, 36, 8487–8500. [Google Scholar]
- Cai, X.; Xiao, R.; Zeng, Z.; Gong, P.; Ni, Y. ITran: A novel transformer-based approach for industrial anomaly detection and localization. Eng. Appl. Artif. Intell. 2023, 125, 106677. [Google Scholar] [CrossRef]
- Mehta, D.; Klarmann, N. Autoencoder-Based Visual Anomaly Localization for Manufacturing Quality Control. Mach. Learn. Knowl. Extr. 2023, 6, 1–17. [Google Scholar] [CrossRef]
- Chen, H.; Chen, P.; Mao, H.; Jiang, M. A Hierarchically Feature Reconstructed Autoencoder for Unsupervised Anomaly Detection. arXiv 2024, arXiv:2405.09148. [Google Scholar] [CrossRef]
- Shen, H.; Wei, B.; Ma, Y. Unsupervised anomaly detection for manufacturing product images by significant feature space distance measurement. Mech. Syst. Signal Process. 2024, 212, 111328. [Google Scholar] [CrossRef]
- Wang, Z.; Bovik, A.C.; Sheikh, H.R.; Simonceli, E.P. Image quality assessment: From error visibility to structural similarity. IEEE Trans. Image Process. 2004, 13, 600–612. [Google Scholar] [CrossRef]
- Getachew Shiferaw, T.; Yao, L. Autoencoder-Based Unsupervised Surface Defect Detection Using Two-Stage Training. J. Imaging 2024, 10, 111. [Google Scholar] [CrossRef] [PubMed]
- Hong, D.C.; Tan, P.X.; Nguyen, A.N.; Pham, M.K.; Duong, T.H.A.; Huynh, T.-M.; Bui, S.-A.; Nguyen, D.-M.; Ha, Q.-H.; Trinh, V.-A.; et al. Unsupervised industrial anomaly detection using paired well-lit and low-light images. J. Comput. Des. Eng. 2025, 12, 41–61. [Google Scholar] [CrossRef]
- McIntosh, D.; Albu, A.B. Unsupervised, Online and On-The-Fly Anomaly Detection for Non-stationary Image Distributions. In Proceedings of the European Conference on Computer Vision (ECCV), Milan, Italy, 29 September–4 October 2024; pp. 428–445. [Google Scholar] [CrossRef]
- Bergmann, P.; Fauser, M.; Sattlegger, D.; Steger, C. MVTec AD—A Comprehensive Real-World Dataset for Unsupervised Anomaly Detection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), Long Beach, CA, USA, 15–20 June 2019; pp. 9584–9592. [Google Scholar] [CrossRef]
- Park, J.H.; Kim, Y.S.; Seo, H.; Cho, Y.J. Analysis of Training Deep Learning Models for PCB Defect Detection. Sensors 2023, 23, 2766. [Google Scholar] [CrossRef]
- Zhang, H.; Wang, Z.; Zeng, D.; Wu, Z.; Jiang, Y.G. DiffusionAD: Norm-Guided One-Step Denoising Diffusion for Anomaly Detection. IEEE Trans. Pattern Anal. Mach. Intell. 2025, 47, 7140–7152. [Google Scholar] [CrossRef] [PubMed]
- Deng, S.; Sun, Z.; Zhuang, R.; Gong, J. Noise-to-Norm Reconstruction for Industrial Anomaly Detection and Localization. Appl. Sci. 2023, 13, 12436. [Google Scholar] [CrossRef]
- Liu, T.; Li, B.; Du, X.; Jiang, B.; Geng, L.; Wang, F.; Zhao, Z. FAIR: Frequency-aware Image Restoration for Industrial Visual Anomaly Detection. arXiv 2023, arXiv:2309.07068. [Google Scholar] [CrossRef]
- Jiang, X.; Liu, J.; Wang, J.; Nie, Q.; Wu, K.; Liu, Y.; Wang, C.; Zheng, F. SoftPatch: Unsupervised Anomaly Detection with Noisy Data. In Proceedings of the 36th Conference on Neural Information Processing Systems (NeurIPS 2022), New Orleans, LA, USA, 28 November–9 December 2022; Volume 1123, pp. 15433–15445. [Google Scholar] [CrossRef]
- Yan, S.; Shao, H.; Xiao, Y.; Liu, B.; Wan, J. Hybrid robust convolutional autoencoder for unsupervised anomaly detection of machine tools under noises. Robot Comput.-Integr. manuf. 2023, 79, 102441. [Google Scholar] [CrossRef]
- Lu, F.; Yao, X.; Fu, C.W.; Jia, J. Removing Anomalies as Noises for Industrial Defect Localization. In Proceedings of the 2023 IEEE/CVF International Conference on Computer Vision (ICCV), Paris, France, 1–6 October 2023; pp. 16120–16129. [Google Scholar] [CrossRef]
- Wei, S.; Jiang, J.; Xu, X. UniNet: A Contrastive Learning-Guided Unified Framework with Feature Selection for Anomaly Detection. In Proceedings of the Computer Vision and Pattern Recognition Conference (CVPR), Nashville, TN, USA, 11–15 June 2025; pp. 9994–10003. Available online: https://openaccess.thecvf.com/content/CVPR2025/html/Wei_UniNet_A_Contrastive_Learning-guided_Unified_Framework_with_Feature_Selection_for_CVPR_2025_paper.html (accessed on 25 July 2025).
- Li, A.; Qiu, C.; Kloft, M.; Smyth, P.; Rudolph, M.; Mandt, S. Zero-Shot Anomaly Detection via Batch Normalization. Adv. Neural Inf. Process. Syst. 2023, 36, 40963–40993. [Google Scholar] [CrossRef]
- Xu, H.; Wang, Y.; Wei, J.; Jian, S.; Li, Y.; Liu, N. Fascinating supervisory signals and where to find them: Deep anomaly detection with scale learning. In Proceedings of the 40th International Conference on Machine Learning (ICML), Honolulu, HI, USA, 23–29 July 2023; Volume 1611, pp. 38655–38673. Available online: https://dl.acm.org/doi/10.5555/3618408.3620019 (accessed on 25 July 2025).
- Deng, H.; Li, X. Anomaly Detection via Reverse Distillation from One-Class Embedding. In Proceedings of the 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, LA, USA, 18–24 June 2022; pp. 9727–9736. [Google Scholar] [CrossRef]
- Kingma, D.P.; Welling, M. Auto-Encoding Variational Bayes. arXiv 2013, arXiv:1312.6114. [Google Scholar] [CrossRef]
Algorithm | Dataset | Performance Metrics | Best Performance |
---|---|---|---|
UniNet [44] | MVTec AD | Image-level AUROC | 99.90 |
ACR-DSVDD [45] | MVTec AD | Pixel-level AUC | 92.5 ± 0.2 |
SLAD [46] | MVTec | AUC-ROC | 0.812 ± 0.009 |
RD4AD [47] | MVTec | AUROC | 98.5 |
Triad-ov [15] | MVTec AD | MFG Proc | 94.1 |
AnoViT [23] | MVTec AD | AUROC | 0.78 |
Patch AE [22] | MVTec | AUROC | 99.48 |
SoftPatch-lof [41] | MVTec AD (Noise = 0.1) | AUROC | 0.979 |
FAIR [40] | MVTec AD | Image-level AUROC | 98.6 |
DiffusionAD [38] | MVTec | Image-level AUROC | 99.7 |
Precision | Recall | Accuracy | F1 Score | ||
---|---|---|---|---|---|
51–255 | 1 | 0.7753 | 0.7757 | 0.8734 | |
102–255 | 1 | 0.9995 | 0.9995 | 0.9997 | |
153–255 | 1 | 0.8558 | 0.8562 | 0.9223 | |
204–255 | N/A | 0 | 0.0024 | N/A |
Img Size | Layer | Latent | Threshold | Normal | Defective | Overall | Wilson 95% CI | Time |
---|---|---|---|---|---|---|---|---|
64 × 64 | 2 | 32 | 0.00848 | 97.19% | 93.94% | 97.09% | [96.07, 97.98] | 0.256 ms |
64 | 0.00787 | 96.22% | 93.94% | 96.15% | [94.96, 97.17] | 0.306 ms | ||
128 | 0.00709 | 95.25% | 93.94% | 95.21% | [93.87, 96.33] | 0.358 ms | ||
3 | 32 | 0.00981 | 94.72% | 93.94% | 94.70% | [93.28, 95.87] | 0.187 ms | |
64 | 0.00859 | 92.70% | 93.94% | 92.74% | [91.05, 94.06] | 0.268 ms | ||
128 | 0.00851 | 93.32% | 93.94% | 93.33% | [91.72, 94.62] | 0.388 ms | ||
4 | 32 | 0.01203 | 97.63% | 87.88% | 97.35% | [96.58, 98.35] | 0.220 ms | |
64 | 0.01116 | 97.36% | 87.88% | 97.09% | [96.27, 98.13] | 0.211 ms | ||
128 | 0.01202 | 97.54% | 90.91% | 97.35% | [96.48, 98.28] | 0.192 ms | ||
128 × 128 | 2 | 32 | 0.01528 | 96.92% | 93.94% | 96.84% | [95.76, 97.76] | 3.062 ms |
64 | 0.01141 | 97.10% | 93.94% | 97.01% | [95.97, 97.91] | 2.925 ms | ||
128 | 0.01170 | 97.19% | 93.94% | 97.09% | [96.07, 97.98] | 2.650 ms | ||
3 | 32 | 0.01149 | 97.36% | 93.94% | 97.26% | [96.27, 98.13] | 1.812 ms | |
64 | 0.01078 | 97.01% | 93.94% | 96.92% | [95.86, 97.84] | 1.724 ms | ||
128 | 0.00932 | 95.95% | 93.94% | 95.90% | [94.66, 96.94] | 1.692 ms | ||
4 | 32 | 0.01059 | 95.25% | 93.94% | 95.21% | [93.87, 96.33] | 1.904 ms | |
64 | 0.01242 | 98.77% | 87.88% | 98.46% | [97.97, 99.24] | 1.486 ms | ||
128 | 0.00936 | 94.64% | 93.94% | 94.62% | [93.18, 95.79] | 2.006 ms | ||
256 × 256 | 2 | 32 | 0.01476 | 96.31% | 93.94% | 96.24% | [95.06, 97.24] | 2.576 ms |
64 | 0.01565 | 93.23% | 96.67% | 93.33% | [91.63, 94.54] | 2.442 ms | ||
128 | 0.01430 | 98.50% | 93.94% | 98.38% | [97.64, 99.04] | 2.092 ms | ||
3 | 32 | 0.01167 | 95.87% | 93.94%V | 95.81% | [94.56, 96.87] | 2.450 ms | |
64 | 0.01026 | 96.04% | 93.94% | 95.98% | [94.76, 97.02] | 3.213 ms | ||
128 | 0.01149 | 97.54% | 93.94% | 97.44% | [96.48, 98.28] | 3.147 ms | ||
4 | 32 | 0.01159 | 97.63% | 93.94% | 97.52% | [96.58, 98.35] | 2.541 ms | |
64 | 0.01233 | 98.33% | 90.91% | 98.12% | [97.42, 98.91] | 2.242 ms | ||
128 | 0.00872 | 94.11% | 93.94% | 94.10% | [92.59, 95.32] | 2.105 ms |
Algorithm | Accuracy | Precision | Recall | F1 Score | Time |
---|---|---|---|---|---|
UniNet [44] | 0.8361 | 0.0131 | 0.2400 | 0.0249 | 20.16 ms |
ACR-DSVDD [45] | 0.9918 | 1.0000 | 0.0600 | 0.1132 | 0.08 ms |
SLAD [46] | 0.9923 | 0.5750 | 0.4600 | 0.5111 | 30.31 ms |
RD4AD [47] | 0.8846 | 0.0553 | 0.7600 | 0.1031 | 9.21 ms |
AE [8] | 0.9682 | 0.1633 | 0.6400 | 0.2602 | 2.08 ms |
VAE [48] | 0.7729 | 0.0192 | 0.5000 | 0.0370 | 2.58 ms |
Our Algorithm | 0.9944 | 0.9943 | 1.0000 | 0.9971 | 2.79 ms |
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. |
© 2025 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
Lee, S.; Kim, T.; Kim, S.; Ahn, J.; Kim, N. Unsupervised Structural Defect Classification via Real-Time and Noise-Robust Method in Smartphone Small Modules. Electronics 2025, 14, 3455. https://doi.org/10.3390/electronics14173455
Lee S, Kim T, Kim S, Ahn J, Kim N. Unsupervised Structural Defect Classification via Real-Time and Noise-Robust Method in Smartphone Small Modules. Electronics. 2025; 14(17):3455. https://doi.org/10.3390/electronics14173455
Chicago/Turabian StyleLee, Sehun, Taehoon Kim, Sookyun Kim, Junho Ahn, and Namgi Kim. 2025. "Unsupervised Structural Defect Classification via Real-Time and Noise-Robust Method in Smartphone Small Modules" Electronics 14, no. 17: 3455. https://doi.org/10.3390/electronics14173455
APA StyleLee, S., Kim, T., Kim, S., Ahn, J., & Kim, N. (2025). Unsupervised Structural Defect Classification via Real-Time and Noise-Robust Method in Smartphone Small Modules. Electronics, 14(17), 3455. https://doi.org/10.3390/electronics14173455