Few-shot detectors struggle to distinguish categories that look alike but differ in local components, because a few examples rarely reveal which differences determine category identity. Category descriptions specify components and relations but do not establish their presence in an image. We propose Struct2Det, which uses category structure to guide detection and verify candidates in three stages. Relational Structure Encoding maps category graphs to component embeddings and a global condition. Component-Grounded Detection uses component queries to retrieve multi-scale image evidence that, with the global condition, modulates category text embeddings for initial detection. Verification-Guided Refinement matches candidate regions with components expected by their top-scoring categories; when class scores are close and matches are reliable, matched pairs correct region features before the shared detector predicts again. Category structure informs both classification inputs: text embeddings integrate image-wide component evidence, while region features incorporate candidate-specific matches. We also construct InduSym, with 88,912 symbol instances across 275 categories from 674 engineering drawings and a structural graph per category. Struct2Det improves few-shot-category AP over the strongest baseline by 6.02 points on InduSym and 9.68 on Digitize-PID, with the highest base-category AP on both. InduSym ablations show few-shot gains from correct category structure, image-level retrieval, and candidate verification. Further tests show gains in few-shot natural-object detection and zero-shot Chinese character recognition.
Figures & tables
Figure 1: From appearance to structure. (a) Similar symbols with local differences highlighted in red; (b) instance-driven appearance representation; (c) vision-language semantic representation; and (d) our structure-guided representation with component matching and verification ( ✓ ).
Figure 2: Overall architecture of Struct2Det. (a) Relational Structure Encoding specifies what components to expect (category level). (b) Component-Grounded Detection retrieves evidence of where they appear to modulate text embeddings (image level). (c) Verification-Guided Refinement checks whether candidates contain expected components and corrects their region features (candidate level). Both classification inputs, category embeddings and region features, carry structural evidence. The detector is shared across rounds.
Detection metrics
Category-wise
Method
AP
AP 50
AP 75
AP s
AP m
AP l
AP base
AP few
AP zero
Hb,f
Hb,z
InduSym
RegionCLIP
23.05
32.67
26.25
6.87
18.28
30.53
27.20
20.15
0.00
23.15
0.01
CORA
3.69
9.20
2.36
0.18
1.53
8.88
4.50
2.65
0.00
3.34
0.00
YOLO-World
19.38
25.70
22.10
8.80
15.50
30.00
19.07
31.70
0.11
23.81
0.22
Grounding DINO
11.33
16.49
12.22
8.36
9.77
21.29
15.03
3.36
0.08
5.49
0.15
Table 1: Industrial-symbol detection on InduSym and Digitize-PID. Metrics follow Sec. 4.1 ; SSDPID’s overall AP excludes zero-shot categories. Best in bold , second best underlined ; – : unavailable; Δ : Struct2Det minus the best baseline.
Figure 3: Qualitative comparison on InduSym. Two regions randomly cropped from a large engineering drawing are enlarged, highlighting seven targets. Label colors match prediction boxes.
Table 2: Structure and grounding ablations on InduSym. ✓ : present; –: absent; △ : modified CSG (text-only, wrong edges, or no edges). Refine: up to two rounds. ΔAPfew : variant minus full model (points); bars show the drop magnitude.
Figure 4: Candidate verification on InduSym. (a) Refinement rounds and two-round ablations; open/filled: AP base /AP few . (b) AP few by MSQ/refinement setting; the cell with neither MSQ nor refinement is YOLO-World.
5-shot
Zero-shot
Method
Base
Novel
All †
Base
Novel
All †
RegionCLIP
–
–
–
57.10
31.40
50.38
CORA
–
–
–
44.50
41.70
43.77
YOLO-World
54.72
38.14
50.38
58.83
51.30
56.86
Grounding DINO
52.14
34.43
47.51
54.32
57.05
55.03
YOLOE
38.32
36.78
37.92
49.94
51.18
50.26
Table 3: Natural-object detection on OV-COCO (48 base/17 novel; AP 50 ). All † : category-count-weighted mean. – : not reported; RegionCLIP, CORA, and HD-OVD (Faster R-CNN) zero-shot results are from their papers.
Method
5-shot
Zero-shot
SLD
71.28
22.69
ACPM
78.66
3.59
Struct2Det (ours)
77.62
37.52
Table 4: Chinese character recognition on ICDAR2013 . Top-1 accuracy (%) under 5-shot and zero-shot settings.
Figure 5: Gains across tasks. Struct2Det versus the baseline (YOLO-World; SLD on ICDAR2013) in each task’s metric. Detection rows are 5-shot; ICDAR2013 is zero-shot.
Appendix figures & tables12 assets
Supplementary material from the paper’s appendix.
Appendix
SVG construct
Graph element
Stored attributes
svg, g
Root/group
ID, class, parent, child count
Primitive tag
Component
Type, normalized geometry, point count
text, tspan
Text node
Position, text length
Marked primitive
Extra anchor
Kind, position, primitive ID
Nesting
parent_child
Source and target
Shared parent
sibling
Source and target
Appendix
Table 6: Mapping rules from SVG elements to CSG nodes and edges. The supported SVG primitive types are path, rect, circle, ellipse, line, polygon, and polyline.
Figure 6: Category examples (a)–(d) in Table 5 order.
Figure 7: Overlapping-window cropping for InduSym.
Category group
Classes
Instances (train / val / test)
Source (total)
Positive supervision
Base
204
71,657 / 7,934 / 8,261
87,852
71,657
Few-shot
45
552 / 142 / 168
862
225
Zero-shot
26
0 / 112 / 86
198
0
Total
275
72,209 / 8,188 / 8,515
88,912
71,882
Appendix
Table 7: InduSym annotations and 5-shot training supervision.
Method
Struct. branch
Struct. update
Det. update
AP base
AP few
Hb,f
Baseline
–
–
✓
19.07
31.70
23.81
w/o Detector update
✓
✓
–
22.38
15.06
18.00
w/o Structure update
✓
–
✓
18.88
25.59
21.72
Struct2Det (ours)
✓
✓
✓
36.60
37.72
37.15
Appendix
Table 8: Structure and detector updates. ✓ : present/trainable.
InduSym
Digitize-PID
Shots
AP base
AP few
Hb,f
AP base
AP few
Hb,f
1
35.85
25.60
29.87
92.91
33.37
49.10
5
36.60
37.72
37.15
94.37
64.48
76.61
10
35.75
39.75
37.64
95.48
73.68
83.18
Appendix
Table 9: Effect of support-set size on InduSym and Digitize-PID, using 1, 5, and 10 instances per few-shot category.
Method
Params (M)
FLOPs (G)
Time (s)
RegionCLIP
120.268
2462.319
0.197
CORA
190.296
35547.379
0.383
YOLO-World
76.188
1319.376
0.141
Grounding DINO
172.840
360.749
1.225
SSDPID
26.790
10.353
0.015
YOLOE
11.232
28.966
0.009
Appendix
Table 10: Computational cost. Parameters, FLOPs, and per-image inference time at 640×640 resolution.
Figure 10: Qualitative example of few-shot detection Analysis. The insets highlight a double-diaphragm pump ( symbol_0214 ), a category with five labeled support instances, on a drawing from the InduSym. Struct2Det correctly classifies and localizes the pump with a detection score of 0.46 and an IoU of 0.92. FT-FSOD also detects the target (score 0.30), while several baselines miss it or predict a different class in the highlighted region.
Figure 11: Full qualitative comparison on InduSym. This figure provides the complete version of Fig. 3 , covering all compared methods. Red and green frames mark enlarged regions for comparing missed detections, extra detections, and category confusion. Struct2Det detects all seven highlighted targets, achieving the highest average confidence.
Figure 12: Qualitative comparison on Digitize-PID. The red and green boxes indicate the source regions of the enlarged crops. Colored labels mark the four ground-truth symbols (IDs 16, 08, 17, and 32), while check marks, crosses, and dashes denote correct classifications, misclassifications, and missed detections, respectively. Struct2Det correctly identifies all four symbols, demonstrating its robustness to dense piping and visually similar categories.
Figure 13: Qualitative comparison on OV-COCO. The two rows show COCO val2017 images 202339 and 491130 under the 48-base/17-novel split. RegionCLIP, CORA, and HD-OVD use released checkpoints. The HD-OVD panel uses AdaMixer. In the top row, Struct2Det detects both buses and the central pedestrian. In the bottom row, YOLO-World detects the snowboard (0.51) but misses the person in the background; Struct2Det detects both people and the snowboard.
Figure 14: Structural CAMs and recognition results on ICDAR2013. Heatmaps show independently normalized averages of ground-truth-conditioned structural-unit CAMs. Struct2Det CAMs are extracted from the graph branch before support fusion. Values indicate the percentage of CAM mass within the white boxes, in the order SLD, ACPM, and Struct2Det. Left: The highlighted components correspond to 威, 旬, and 渍. SLD and ACPM misclassify all three, whereas Struct2Det recognizes them correctly. Their in-box CAM percentages are (17.1, 42.6, 59.8), (21.2, 17.2, 60.9), and (35.0, 57.5, 43.8), respectively. Right: All methods correctly recognize 厦, 物, and 照. Their in-box CAM percentages are (28.9, 26.9, 45.2), (41.1, 20.4, 46.4), and (48.2, 38.4, 51.2), respectively.
Few-shot object detection aims to detect novel object categories from only a few labeled examples, avoiding costly large-scale annotation. Recent prototype-based similarity learning approaches enable training-free adaptation by matching query features with class prototypes. However, they suffer from two fundamental limitations: (i) class confusion arising from inter-class similarity margin collapse, and (ii) insufficient visual cues for precise localization, as similarity scores capture only class-level semantic affinity while providing limited spatial information. To address these issues, we introduce two complementary components. Text-Anchored Semantic Mask (TSMa) leverages class-level text features as semantic anchors to identify semantically aligned channels through channel-wise interaction between visual and text features. By suppressing style-induced spurious responses and emphasizing class-intrinsic signals, TSMa enlarges inter-class similarity margins and mitigates class confusion. We further propose Stage-Aligned Hierarchical Autoregressive Regression (SHARe), which reformulates localization as a hierarchical autoregressive process that progressively refines bounding boxes across multiple stages. SHARe leverages the layer-wise characteristics of ViT representations by aligning feature abstraction levels with regression stages: deeper layers guide early coarse localization, while shallower layers rich in edge and texture cues refine spatial details in later stages. Experiments on COCO demonstrate a new state of the art, outperforming the previous best by +10.1 nAP, with extensive analysis validating each component. The code is available at https://github.com/VisualScienceLab-KHU/ReSet.
Detecting defects in real-world industrial inspection often requires learning from only a few normal images per category. Recent few-shot anomaly detection methods have achieved strong performance by measuring feature differences between query images and normal references. However, visual differences do not always indicate genuine defects, as normal appearance variations can also produce high anomaly scores. Conversely, structural or logical anomalies may not produce strong local feature differences, making them difficult to detect. To address this limitation, we introduce VerdictAD, a training-free framework that refines existing anomaly detectors through visual decisions. Rather than replacing existing detectors, VerdictAD adopts a typed decision model to assess the query image and its local regions against a few normal references. By directly producing structured decision probabilities without text generation, the model provides complementary evidence for refining anomaly responses at different spatial scales. Building on this capability, we introduce two modules: Global Verdict Refinement (GVR) uses image-level decisions to refine the overall anomaly score, while Local Verdict Refinement (LVR) aggregates regional decisions to refine the anomaly map. Combined with a simple DINOv2-based detector, VerdictAD achieves competitive performance in one-shot and few-shot anomaly detection. More importantly, as a plug-and-play framework, it consistently improves existing anomaly detectors across MVTec AD, VisA, and MVTec LOCO AD, achieving strong results across one-shot and few-shot settings. Our code and experimental logs are publicly available at https://github.com/sgstq0811/VerdictAD-Jev-AD.
Shangquan Sun, Wenjun Luo, Yuanzhi Wang +4
Nanyang Technological University · Michigan State University · University of Michigan
Traditional one-shot detection methods have addressed the closed-set problem in object detection, but the high cost of data annotation remains a critical challenge. General unsupervised methods generate pseudo boxes without category labels, thus failing to achieve category-aware classification. To overcome these limitations, we propose Reference-based Category Discovery (RefCD), an unsupervised detector that enables category-aware\footnotemark[1] detection without any manually annotated labels. It leverages feature similarity between predicted objects and unlabeled reference images. Unlike previous unsupervised methods that lack category guidance and one-shot methods which require labeled data, RefCD introduces a carefully designed feature similarity loss to explicitly guide the learning of potential category-specific features. Additionally, RefCD supports category-agnostic detection without reference images, serving as a unified framework. Comprehensive quantitative and qualitative analysis of category-aware and category-agnostic detection results demonstrates its effectiveness, and RefCD can learn category information in an unsupervised paradigm even without category labels.
Yichen Li, Qiankun Liu, Ying Fu
Department of Computer Science Beijing Institute of Technology · University of Science and Technology Beijing