Manuscript Offprint
arXiv:2611.07682DEQ-Det: Dual Evidence Queries for Few-Shot Analog IC Device Detection
Zidong Zhao, Rong Huang, Chengxing Fan, Jie Hu, Malik Haris, Ghazal A. Fahmy, Morteza Mousazadeh, Guoqiang Zhang
Zhejiang University, China, Donghua University, China, National Telecommunication Institute, Egypt, Urmia University, Iran, Ningbo Tech University, China
Abstract—Detecting analog integrated circuit (IC) devices in layout images supports circuit analysis and inspection. With only a few annotated examples, variation in device geometry and visual similarity to dummy or routing structures make reliable detection difficult. Foreground similarity alone can highlight plausible targets without distinguishing them from competing layout patterns. We propose Dual Evidence Queries for Detection (DEQ-Det), which constructs complementary foreground and background references from the same support images without additional annotations. Foreground references capture target morphology, while selected background references characterize surrounding layout patterns. Both sources guide query selection and region verification, combining target appearance with layout context. Across five held-out device categories and three random seeds, DEQ-Det achieves macro AP50 of 39.41 and 53.03 at 10 and 30 shots, exceeding the strongest listed baselines by 3.97 and 9.71 points, respectively. A matched 30-shot ablation further shows that RoI background evidence reduces pooled false positives at comparable recall, supporting its role in interference suppression.
Index Terms—few-shot object detection, analog IC layouts, background evidence, query selection, localization quality
I. INTRODUCTION
Integrated circuit (IC) device detection localizes resistors, capacitors, and transistors in layout images for circuit analysis, targeted inspection, and physical probing [1]. Layout representations can be reconstructed from optical microscopy or scanning electron microscopy (SEM) images [2]. Analog devices have customized geometries reflecting sizing and matching requirements [3], limiting the transferability of digital standard-cell templates to analog layouts. Dummy fills and repetitive routing patterns can resemble devices and cause false positives. Automated localization can focus manual inspection on candidate regions. Dense annotation for supervised detection is costly, with additional labeling often needed across fabrication processes.
Few-shot object detection (FSOD) adapts to targets defined by a small annotated support set [4], [5]. Existing approaches improve target representation through support-conditioned aggregation, contrastive learning, and prototype distillation [6]–[9]. DE-ViT and FSOD-VFM use transferable features for exemplar-based or cross-domain detection [10], [11]. For IC imagery, SSRNet combines few-shot segmentation and a

Fig. 1. Analog layout variability and ambiguity. Device geometries vary within categories; non-target dummy structures share outlines or repeated patterns with devices. Blue/green boxes indicate devices, and the red dashed region indicates dummies.
region classifier for packaged ICs in optical PCB images [12]. Detecting internal devices in analog layouts requires resolving customized geometries amid repeated, target-like structures.
Figure 1 illustrates device variability and resemblance to non-target structures. Foreground similarity can highlight plausible candidates while also responding to dummy fills or routing patterns. The same support images provide context that helps resolve this ambiguity: annotated devices specify the requested morphology, while selected background regions characterize competing layout patterns. Using both sources allows candidate selection and verification to account for the target and its surroundings.
We propose Dual Evidence Queries for Detection (DEQ-Det) to integrate device morphology and support-specific layout context throughout detection. Our contributions are twofold: (1) a dual-evidence framework that derives complementary foreground and background references without additional annotations and uses them in query selection and region verification to couple target selection with interference suppression; and (2) evaluation across five held-out device categories and three random seeds, demonstrating system-level AP50 gains. Matched controls establish the roles of support-guided allocation and quality-aware ranking, while a RoI background control shows fewer pooled false positives at comparable recall.
Corresponding author: Guoqiang Zhang (guoqiang_zhang@nbt.edu.cn).

Fig. 2. DEQ-Det. Foreground references guide target selection, and filtered background references supply layout context for interference suppression. Their means guide query selection, while individual bank records enter the RoI relation head. Foreground probability and predicted localization quality jointly rank candidate detections.
A. Support-Derived Foreground and Background
Given selected boxes of one novel category, DEQ-Det constructs two evidence banks (Fig. 2). A shared DINOv2 ViT-L/14 encoder [13], with a frozen IC reconstruction adapter, produces 1,024-dimensional features. Each support box is enlarged by 20%, cropped, resized while preserving its aspect ratio, and padded to before encoding in its original orientation. Masked pooling over the annotated region yields one morphology record per instance, giving .
Background extraction summarizes the surroundings of annotated devices in full support images, using spatial exclusion and residual filtering to favor stable layout interiors. Valid feature patches outside a two-cell dilation of the selected boxes form a candidate mask . The channel-averaged absolute difference between the image and its Gaussian-blurred version ( kernel, ) measures local texture variation, providing a visual heuristic for background selection. Quantiles are computed over : patches in its lowest residual quintile are retained, excluding a three-cell neighborhood of its highest residual quintile. If this intersection is empty, the lowest-residual candidate patches provide a fallback; annotated and padded patches remain excluded.
The retained features are pooled into image-level and patch-chunk records. The background bank has 360 records, repeating valid pooled records when necessary. Its mean summarizes support-specific layout context for
query selection, while individual records remain available for region classification.
B. Dual-Evidence Query Selection
Query selection directs the decoder toward locations that resemble the support devices while discounting similarity to support context. After trainable feature processing, let denote a query token in the selector embedding space and the foreground mean; hats denote normalization. The token ranking is
Up to 600 highest-ranked valid tokens initialize a two-layer decoder, which predicts boxes from their spatial references. This allocates the query budget according to support relevance. A shared residual MLP adjusts selector query features with scale 0.1; .
During adaptation, a selector loss uses feature-token centers inside selected boxes as positives and other valid centers as negatives. Sets and contain up to 128 lowest-scoring positives and 512 highest-scoring negatives, respectively:
C. Region Evidence and Localization Quality
Region verification compares each decoded candidate with both evidence banks. RoIAlign [14] extracts a feature grid at each decoded box. The relation head combines similarity to bank means, similarity to individual records, and learned pairwise relations with weights 0.5, 0.5, and 1.0. It uses 256 hidden dimensions, eight region tokens, and the three best-matching support records. Foreground/background logits are normalized jointly:
RoI classification labels are determined by the maximum IoU between each pooled region and annotated targets: regions with IoU 0.5 are foreground, those with IoU < 0.4 are background, and the intermediate range is ignored. Multiple RoIs can therefore be positive for one target, while box regression uses one-to-one Hungarian matching [15].
An IoU-supervised quality head predicts from region features for localization-aware detection ranking. Binary cross entropy and Smooth L1 anchor predictions to detached IoU targets for assigned or overlapping regions, with zero targets for non-overlapping background regions. A complementary IoU-gap hinge encourages a minimum quality separation between foreground boxes on the same normalized scale. For target , let contain ordered pairs assigned to that target by maximum IoU, where is the IoU of region with , , and . Then
where includes targets with eligible pairs. Equal target weighting prevents crowded proposal groups from dominating. Box coordinates are detached when constructing targets for the ordering loss.
D. Training Objective and Detection Ranking
The novel-stage objective combines region cross entropy, box /GIoU regression, a foreground/background logit margin, selector supervision, and quality losses:
The margin is 0.2 on foreground/background logits, and cross entropy uses background weight 0.2. Quality supervision assigns weight 0.25 to zero-overlap background RoIs and unit weight otherwise. Intermediate decoder predictions receive corresponding Hungarian classification, margin and regression losses, denoted . The final 100-step continuation activates to refine quality ordering after the initial adaptation.
At inference, candidates satisfy . The score used for NMS and reported confidence is
(6)
The conditional exponent further downweights regions favoring background according to their predicted localization quality. Here discounts redundant boxes. Within same-class overlap components at IoU 0.6, the highest- box is the owner. A lower-confidence box overlapping its owner by at least 0.6 is multiplied by when ; otherwise . NMS uses IoU 0.5 and retains at most 100 detections. All categories share these settings.

Cyan dashed: ground truth in the first column Green: correct prediction Red: incorrect prediction
Fig. 3. Qualitative comparison at 30 shots on Diode and NPN/PNP examples. Columns show ground truth, TFA, DE-ViT, FSOD-VFM, and DEQ-Det. Cyan dashed boxes denote ground truth; green/red boxes denote matched/unmatched predictions at IoU 0.5.
III. EXPERIMENTS
A. Data and Evaluation Protocol
Our dataset comprises image windows cropped from electron micrographs of integrated circuits. It contains 907 training and 282 test windows (3,118/760 instances) from 329/94 source images, respectively. All windows from the same source image remain in a single partition. Each of five fixed splits holds out one novel category—Capacitor, Diode, MOS, NPN/PNP, or Resistor—with the remaining categories used for base training. The novel test subsets contain 35/40/29/31/90 windows and 44/46/55/88/152 target instances, respectively. Their union has 195 distinct windows from 76 test source images; category subsets can overlap in images. All compared methods use these same test manifests.
One shot is one selected novel box, with at most one selected box per support image. At 10 and 30 shots, the novel training data and support banks use exactly those K boxes; locations of other same-class instances are not supplied as ignore regions. All compared methods share the selected support instances. Base/refinement initialization is fixed within each held-out-category split.
Following PASCAL-style few-shot detection [5], [7], our primary metric is novel-category AP50, computed with COCO evaluation [16]. We additionally report AP75 for the quality ablation. For each seed, we average the five category scores equally, then compute the mean and sample standard deviation over seeds 1/2/3. Support sampling and training randomness are paired; all results use fixed final checkpoints.
B. Implementation and Baselines
The shared encoder includes a frozen rank-4 LoRA adapter ( ) on query/value projections in its last six blocks [17]. The adapter is pretrained for image reconstruction without device labels and shared across splits and IC-adapted baselines. We retain each split's initialization from 8,000 base-training and 2,000 base-refinement steps. Novel adaptation uses AdamW, batch size two, learning rate , and cosine decay for 1,200 steps with 20 warmup steps. A fresh optimizer runs 100 further steps at the same initial learning rate without warmup, enabling Eq. (4). Adaptation and inference settings
TABLE I FIVE-CATEGORY MACRO AP50 AT 10 AND 30 SHOTS, MEAN±SAMPLE STANDARD DEVIATION OVER SEEDS 1/2/3.
| Method | 10-shot | 30-shot |
|---|---|---|
| Template matching | 13.20±2.00 | 17.17±2.75 |
| DINOv2 prototype | 12.92±1.43 | 20.80±3.28 |
| TFA [5] | 18.71±1.56 | 21.93±1.08 |
| Meta R-CNN [6] | 31.02±4.81 | 43.32±5.78 |
| FSCE [7] | 32.38±2.17 | 38.65±0.35 |
| VFA [8] | 32.89±1.98 | 38.01±2.18 |
| FPD [9] | 26.38±0.93 | 31.74±3.34 |
| DE-ViT [10] | 25.91±1.90 | 30.26±1.70 |
| DE-ViT + IC adapter | 23.90±0.60 | 28.98±5.44 |
| FSOD-VFM [11] | 31.97±1.50 | 34.82±0.07 |
| FSOD-VFM + IC adapter | 35.44±0.88 | 37.88±0.43 |
| DEQ-Det | 39.41±2.28 | 53.03±4.81 |
Bold and underlined results indicate the best and second-best mean AP50 in each column, respectively. R101: TFA, Meta R-CNN, FSCE, VFA, and FPD; ViT-L/14: the remaining learned methods. IC denotes the frozen IC reconstruction adapter; FSOD-VFM also uses UPN and SAM2-L.
are common across categories and support budgets. Images are resized to a maximum side of 1,024 pixels, normalized with ImageNet statistics, and padded to multiples of 14. Training augmentation uses horizontal flips and right-angle rotations. Training uses two RTX 4090 GPUs. At 30 shots, inference with batch size one averages 432 ms per window on an RTX 4090, including model preprocessing and postprocessing; data loading and offline bank construction are excluded.
Original and IC-adapted DE-ViT/FSOD-VFM are reported separately. The adapted variants share the frozen IC encoder with DEQ-Det, but retain their detection pipelines. In particular, IC-adapted DE-ViT retains released background prototypes, and FSOD-VFM retains UPN and SAM2-L. Backbones, pretraining and optimization budgets differ across systems; the comparison evaluates complete detection systems under shared support and test sets.
C. Main Results
DEQ-Det achieves macro AP50 of 39.41±2.28 and 53.03±4.81 at 10 and 30 shots, respectively (Table I). The gains over the strongest listed baselines, IC-adapted FSOD-VFM and Meta R-CNN, are 3.97 and 9.71 points, respectively. It also leads the IC-adapted foundation-model baselines sharing its frozen encoder. At 30 shots, category AP50 is 62.59/56.08/41.49/64.99/40.03 for Capacitor, Diode, MOS, NPN/PNP, and Resistor, respectively. All five category means improve from 10 to 30 shots. Figure 3 compares detections on shared Diode and NPN/PNP test images at 30 shots.
D. Component Ablations
All component ablations use paired support sets and seeds with identical initialization and training schedules. The selector control replaces support-guided selection with feature-norm ranking and removes selector supervision, while retaining RoI evidence and quality scoring. The quality control

Fig. 4. Matched 30-shot component ablations: five-category macro AP50, mean and sample standard deviation over three seeds. Blue/orange bars denote full/ablated models.
removes quality supervision and quality-dependent scoring in the same intervention.
Figure 4 evaluates the contributions of query selection and detection ranking. Support-guided selection provides an 11.12-point macro AP50 gain over its matched control. Quality supervision together with quality-dependent scoring adds 9.80 points. Both gains are positive for all three paired seeds. These controls support allocating a fixed query budget to support-relevant candidates and ranking decoded regions with localization-aware confidence. The same quality configuration also improves AP75 by 9.59 points over its matched control.
Background evidence at comparable recall. To assess interference suppression, we zero the RoI support-background features during novel adaptation and inference, while retaining selector background evidence (). Using fixed final checkpoints and score-ordered one-to-one matching at IoU , we pool categories within each seed and use each arm's highest threshold reaching the prespecified recall targets of 50/60/70/80/85%. Across these comparable-recall points, retaining RoI background reduces false positives pooled over seeds by 3.5–9.8%. At 60% recall, false positives decrease from 1,004 to 906, with unchanged matched-target counts and reductions for all three paired seeds. RoI background references therefore improve device-background discrimination and reduce spurious candidates for targeted layout inspection. The same control also yields a 0.86-point mean AP50 gain.
IV. CONCLUSION
DEQ-Det combines device morphology and layout context for few-shot analog IC detection without additional background annotations. Support examples update task-specific references, allowing new target geometries to be specified without separate labels for dummy or routing structures. Macro AP50 exceeds the strongest listed baselines by 3.97 and 9.71 points at 10 and 30 shots. Matched controls show gains from support-guided query allocation and quality-aware ranking. RoI background evidence reduces false positives at comparable recall, yielding fewer distracting candidates for manual review. With annotated devices defining the inspection target, the predicted boxes can guide review toward localized regions in electron micrographs. These locations also provide spatial references for circuit analysis and selection of probing regions.
REFERENCES
[1] V. K. Ravikumar, J. M. Chin, W. Lua, N. Linarto, G. Ranganathan, J. Trisno, K. L. Pey, and J. K. W. Yang, "Super-resolution laser probing of integrated circuits using algorithmic methods," Nature Communications, vol. 13, no. 1, p. 5155, 2022.
[2] H.-C. Shao, C.-Y. Peng, J.-R. Wu, C.-W. Lin, S.-Y. Fang, P.-Y. Tsai, and Y.-H. Liu, "From IC layout to die photograph: A CNN-based data-driven approach," IEEE Transactions on Computer-Aided Design of Integrated Circuits and Systems, vol. 40, no. 5, pp. 957–970, 2021.
[3] J. Lienig and J. Scheible, Fundamentals of Layout Design for Electronic Circuits. Cham, Switzerland: Springer, 2020.
[4] B. Kang, Z. Liu, X. Wang, F. Yu, J. Feng, and T. Darrell, “Few-shot object detection via feature reweighting,” in Proc. IEEE/CVF Int. Conf. Comput. Vis. (ICCV), 2019, pp. 8420–8429.
[5] X. Wang, T. E. Huang, J. E. Gonzalez, T. Darrell, and F. Yu, “Frustratingly simple few-shot object detection,” in Proc. Int. Conf. Mach. Learn. (ICML), ser. Proceedings of Machine Learning Research, vol. 119, 2020, pp. 9919–9928.
[6] X. Yan, Z. Chen, A. Xu, X. Wang, X. Liang, and L. Lin, “Meta R-CNN: Towards general solver for instance-level low-shot learning,” in Proc. IEEE/CVF Int. Conf. Comput. Vis. (ICCV), 2019, pp. 9577–9586.
[7] B. Sun, B. Li, S. Cai, Y. Yuan, and C. Zhang, “FSCE: Few-shot object detection via contrastive proposal encoding,” in Proc. IEEE/CVF Conf. Comput. Vis. Pattern Recognit. (CVPR), 2021, pp. 7352–7362.
[8] J. Han, Y. Ren, J. Ding, K. Yan, and G.-S. Xia, “Few-shot object
detection via variational feature aggregation,” in Proc. AAAI Conf. Artif. Intell. (AAAI), vol. 37, no. 1, 2023, pp. 755–763.
[9] Z. Wang, B. Yang, H. Yue, and Z. Ma, “Fine-grained prototypes distillation for few-shot object detection,” in Proc. AAAI Conf. Artif. Intell. (AAAI), vol. 38, no. 6, 2024, pp. 5859–5866.
[10] X. Zhang, Y. Liu, Y. Wang, and A. Boularias, “Detect everything with few examples,” in Proc. Conf. Robot Learn. (CoRL), ser. Proceedings of Machine Learning Research, vol. 270, 2025, pp. 3986–4004.
[11] C.-B. Feng, Y. Sha, L. Liu, Y. Yu, C. M. Vong, X. Yu, and X. Shen, “FSOD-VFM: Few-shot object detection with vision foundation models and graph diffusion,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2026.
[12] Y. Wang, X. Wang, D. Cheng, T. Lin, F. Ji, Y. Shi, and B.-H. Gwee, “SSRNet: Few-shot IC segmentation in automated PCB image processing,” in Proc. IEEE Int. Symp. Circuits Syst. (ISCAS), 2025.
[13] M. Oquab et al., “DINov2: Learning robust visual features without supervision,” Transactions on Machine Learning Research, 2024.
[14] K. He, G. Gkioxari, P. Dollar, and R. Girshick, “Mask R-CNN,” in Proc. IEEE Int. Conf. Comput. Vis. (ICCV), 2017, pp. 2961–2969.
[15] N. Carion, F. Massa, G. Synnaeve, N. Usunier, A. Kirillov, and S. Zagoruyko, “End-to-end object detection with transformers,” in Proc. Eur. Conf. Comput. Vis. (ECCV), 2020, pp. 213–229.
[16] T.-Y. Lin et al., “Microsoft COCO: Common objects in context,” in Proc. Eur. Conf. Comput. Vis. (ECCV), 2014, pp. 740–755.
[17] E. J. Hu, Y. Shen, P. Wallis, Z. Allen-Zhu, Y. Li, S. Wang, L. Wang, and W. Chen, “LoRA: Low-rank adaptation of large language models,” in Proc. Int. Conf. Learn. Represent. (ICLR), 2022.