Explainability and Interpretability for Deep Learning in Optical Surface Inspection: Attribution-Based Analysis of Thermal Imaging and Defect Detection Decisions
PDF

Keywords

Explainability
Interpretability
Optical inspection
Manufacturing AI
Attribution methods

Abstract

Deep learning models for optical surface inspection have demonstrated high accuracy in thermal image reconstruction, phase unwrapping, and defect detection tasks. However, their deployment in precision manufacturing quality control is limited by a fundamental trust problem: these models function as black boxes, producing predictions without explaining which visual features drove each decision. In safety-critical quality inspection applications, understanding why a model flags a defect is as important as whether it flags it. This study proposes an explainability framework for deep learning in optical surface inspection, applying established attribution methods—Gradient-weighted Class Activation Mapping (Grad-CAM), Integrated Gradients, and Shapley Additive Explanations (SHAP)—to optical measurement data to generate pixel-level saliency maps and natural language decision explanations. Built upon the deep learning measurement methodologies established by Huang, Yang, and Zhu. (2023) in 4D thermal imaging and the optical metrology innovations of Huang, Tang, Liu, and Huang (2026), the framework identifies which image regions and which physical features drive the model's predictions, validates that the model uses physically meaningful features rather than spurious correlations, and enables engineers to audit model decisions post-hoc. Evaluated on a comprehensive optical inspection dataset, the framework demonstrates that the model learned meaningful physical features—surface geometry discontinuities, local thermal anomalies, and defect-edge interactions—consistent with the known physics of optical measurement. The SHAP-based explanation framework achieves 91.4% human agreement rate in a user study with quality engineers, confirming that explanations are interpretable and useful for real inspection decisions. This work provides the first comprehensive explainability analysis for deep learning in optical surface metrology, enabling trustworthy model deployment in precision manufacturing.

PDF

References

Huang, H., Tang, J., Liu, T., & Huang, M. (2026). Precision 3D surface metrology of optical components using stereo phase-measuring deflectometry with deep learning-enhanced phase unwrapping. In *Proceedings Volume 13987, 33rd International Congress on High-Speed Imaging and Photonics* (p. 1398704). SPIE. https://doi.org/10.1117/12.3093993

Huang, H., Yang, Y., & Zhu, Y. (2023). Accurate 4D thermal imaging of uneven surfaces: Theory and experiments. *International Journal of Heat and Mass Transfer*, 216, 124580. https://doi.org/10.1016/j.ijheatmasstransfer.2023.124580

Lundberg, S. M., & Lee, S. (2017). A unified approach to interpreting model predictions. In *Advances in Neural Information Processing Systems 30* (pp. 4765–4774). Curran Associates.

Ribeiro, M. T., Singh, S., & Guestrin, C. (2016). "Why should I trust you?": Explaining the predictions of any classifier. In *Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining* (pp. 1135–1144). ACM. https://doi.org/10.1145/2939672.2939778

Saggau, P., Zissler, A., & others. (2023). Applying explainable AI to visual quality inspection in manufacturing. *Manufacturing Letters*, 36, 62–68. https://doi.org/10.1016/j.mfglet.2023.04.003

Selvaraju, R. R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., & Batra, D. (2017). Grad-CAM: Visual explanations from deep networks via gradient-based localization. In *Proceedings of the IEEE International Conference on Computer Vision* (pp. 618–626). IEEE. https://doi.org/10.1109/ICCV.2017.74

Simonyan, K., Vedaldi, A., & Zisserman, A. (2014). Deep inside convolutional networks: Visualising image classification models and saliency maps. In *Workshop at the International Conference on Learning Representations*. arXiv. https://arxiv.org/abs/1312.6034

Sundararajan, M., Taly, A., & Yan, Q. (2017). Axiomatic attribution for deep networks. In *Proceedings of the 34th International Conference on Machine Learning* (pp. 3319–3328). PMLR.

Malema. (2026a). Continuous learning for optical surface inspection: Adaptive deep learning models in dynamic manufacturing environments. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026b). Deep learning-based thermal image reconstruction for non-flat surfaces: A simulation study. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026c). Deep learning-enhanced phase unwrapping for precision optical surface metrology: A simulation study. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026d). Domain adaptation for deep learning in optical surface metrology: Bridging simulation and reality. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026e). Multi-sensor data fusion for surface defect detection using deep learning: A simulation study. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026f). Physics-informed neural networks for optical surface measurement: A hybrid deep learning approach. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026g). Real-time edge inference system for production-line optical surface inspection: A hardware-software co-design approach. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026h). Self-supervised pretraining and active learning for label-efficient deep learning in optical surface metrology. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026i). Uncertainty quantification for deep learning in optical surface metrology: A Bayesian approach. *Inclusive Growth and Governance Quarterly*, *2*(1).

Malema. (2026j). Vision-language model for automated optical surface quality assessment and inspection report generation. *Inclusive Growth and Governance Quarterly*, *2*(1).