DOI: 10.3390/s26216878 ISSN: 1424-8220

A Closed-Loop Active Vision and Reinforcement Learning Framework for Online Optical Lens Inspection in Computer-Integrated Manufacturing

Yikai Yang, Xuedong Jing

Automated defect inspection for transparent optical lenses remains challenging because specular reflections can obscure weak defects and produce glare-induced false responses. This paper presents a confidence-driven end-to-end active inspection framework for online quality control in computer-integrated manufacturing. The framework integrates a Transformer-enhanced You Only Look Once (YOLO) detector (TE-YOLO), a confidence-driven proximal policy optimization (PPO) controller (CDR-PPO), and a time-sequential camera viewpoint adjustment process. TE-YOLO introduces a C3 module with a Transformer encoder (C3TR) before the detection head to combine convolutional local feature extraction with global context modeling for scratch and foreign particle detection. In the proposed architecture, the detector outputs both visual features and defect confidence scores, and these outputs are converted into a threshold-aware reward signal that directly participates in PPO advantage estimation and policy optimization, thereby coupling visual perception with discrete camera pose control. Unlike active vision methods whose rewards are based on geometric coverage or model uncertainty, CDR-PPO trains the viewpoint policy against the same detector threshold that accepts an observation. The resulting closed loop repeatedly performs image acquisition, defect perception, reward construction, policy update, camera adjustment, and re-observation; the detector and the policy are trained separately. The lens images are acquired on a physical inspection apparatus with an industrial camera on an adjustable support. TE-YOLO is evaluated on 208 physical lens images, where it reaches an average precision at an intersection-over-union threshold of 0.50 (AP50) of 0.995 and an average precision averaged over thresholds from 0.50 to 0.95 (AP50:95) of 0.865 on a near-duplicate-grouped split, the same accuracy as that of a plain C3 variant without the Transformer encoder. Physical acquisition sequences on the apparatus show that changing the camera configuration shifts the glare relative to the lens and the defect. CDR-PPO is trained and evaluated in a simulated inspection environment that reproduces the geometry of the apparatus and generates the confidence and the state features. On held-out test scenarios, it reaches the confidence threshold in 87.3% of episodes with 5.1 observations per episode, compared with 42.4% for a fixed viewpoint and 22.1 observations per episode for a greedy confidence search. Within a budget of 10 observations, CDR-PPO recovers 77.8% of the episodes that start below the threshold, whereas the greedy search recovers none. These results support the integration of adaptive visual inspection into automated manufacturing quality control workflows.

More from our Archive