AI SIMILAR FEATURE DETECTION
Abstract
Automated identification of repeated visual components in electronic assemblies is an important task in computer vision, particularly for applications involving printed circuit boards (PCBs), surface-mount devices (SMDs), microcontrollers, and industrial component arrays. Conventional supervised object detection methods generally require labeled training data and task-specific model training. This paper presents an interactive, zero-shot visual similarity localization framework that uses pretrained DINOv2 Vision Transformer features to identify regions resembling a user-selected reference component.
The proposed system extracts dense patch-level representations from an input image while preserving its aspect ratio and aligning the resized dimensions with the model's patch size. A reference feature vector is constructed from the selected patch and its configurable spatial neighborhood. Cosine similarity is computed between this vector and the remaining patch embeddings to generate a two-dimensional similarity map. Thresholding and eight-connected component analysis are then applied to identify candidate regions, filter small clusters, estimate component counts, and generate bounding boxes. An optional MobileSAM module uses the detected boxes as prompts for pixel-level segmentation. The framework is implemented as an interactive Gradio web application with in-memory feature caching, similarity heatmaps, binary masks, annotated detections, and processing-time measurements.
The supplied documentation reports CPU-based feature extraction times of 68 seconds for a 1400 × 1400 image and 165 seconds for a 2100 × 2100 image on an AMD Ryzen 7 eight-core system. The corresponding interactive processing times are 17.0 ms and 32.2 ms per click. These measurements indicate that separating feature extraction from subsequent similarity queries can substantially reduce repeated computation. However, quantitative detection accuracy, segmentation quality, and generalization across electronic component datasets remain to be experimentally established.
References
Dosovitskiy, A., et al. (2021). “An Image is Worth 16×16 Words: Transformers for Image Recognition at Scale.” International Conference on Learning Representations (ICLR). https://arxiv.org/abs/2010.11929
Oquab, M., et al. (2024). “DINOv2: Learning Robust Visual Features without Supervision.” Transactions on Machine Learning Research (TMLR). https://arxiv.org/abs/2304.07193
Kirillov, A., et al. (2023). “Segment Anything.” Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), 4015–4026. https://doi.org/10.1109/ICCV51070.2023.00371
Zhang, C., et al. (2023). “Faster Segment Anything: Towards Lightweight SAM for Mobile Applications.” MobileSAM project and associated research resources. https://github.com/ChaoningZhang/MobileSAM
Sun, J., et al. (2021). “LoFTR: Detector-Free Local Feature Matching with Transformers.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR),8922–8931. https://doi.org/10.1109/CVPR46437.2021.00881
Sarlin, P.-E., DeTone, D., Malisiewicz, T., and Rabinovich, A. (2020). “SuperGlue: Learning Feature Matching with Graph Neural Networks.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 4938–4947. https://doi.org/10.1109/CVPR42600.2020.00499
Lowe, D. G. (2004). “Distinctive Image Features from Scale-Invariant Keypoints.” International Journal of Computer Vision, 60, 91–110. https://doi.org/10.1023/B:VISI.0000029664.99615.94
He, K., Gkioxari, G., Dollár, P., and Girshick, R. (2017). “Mask R-CNN.” Proceedings of the IEEE International Conference on Computer Vision (ICCV), 2961–2969. https://doi.org/10.1109/ICCV.2017.322
Long, J., Shelhamer, E., and Darrell, T. (2015). “Fully Convolutional Networks for Semantic Segmentation.” Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 3431–3440. https://doi.org/10.1109/CVPR.2015.7298965
Jose, C., et al. (2025). “DINOv2 Meets Text: A Unified Framework for Image- and Pixel-Level Vision-Language Alignment.” Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 24905–24916. https://doi.org/10.1109/CVPR52734.2025.02319.
Refbacks
- There are currently no refbacks.