Distilled Large Language Model-Driven Dynamic Sparse Expert Activation Mechanism
Authors: Qinghui Chen, Zekai Zhang, Zaigui Zhang, Kai Zhang, Dagang Li, Wenmin Wang, Jinglin Zhang, Cong Liu
Organizations: School of Control Science and Engineering, Shandong University, Jinan, China · Laoshan Laboratory, Qingdao, China · Jinan Inspur Data Technology Co., Ltd, Jinan, China · School of Computer Science and Engineering, Macau University of Science and Technology, Macau SAR, China · NOVA Information Management School, Nova University of Lisbon, Lisbon, Portugal
High inter-class similarity, extreme scale variation, and limited computational budgets hinder reliable visual recognition across diverse real-world data. Existing vision-centric and cross-modal approaches often rely on rigid fusion mechanisms and heavy annotation pipelines, leading to sub-optimal generalization. We propose the Distilled Large Language Model (LLM)-Driven Sparse Mixture-of-Experts (DS-MoE) framework, which integrates text-guided dynamic routing and lightweight multi-scale comprehension. The DS-MoE framework dynamically aligns textual semantics with defect-specific visual patterns through a sparse MoE architecture, where task-relevant experts are adaptively activated based on semantic relevance, resolving inter-class ambiguity. A lightweight MobileSAM encoder enables real-time inference while preserving multi-scale defect details. Extensive experiments on PCB, aluminum foil, and mold defect datasets demonstrate that our framework achieves superior performance compared to existing pure vision models. DS-MoE surpasses YOLOv8/YOLOX with gains of +13.9, +1.4, and +2.0 pp mAP@ 0.5:0.95 on BBMP, aluminum, and PCB, respectively, while also improving precision and recall.
Figures & tables
Figure 1: Example of dataset for industrial detection. The first line and second line serve as the bottle-bottom mold point image and PCB defects image respectively. The aluminium defects image is shown in the third line. According to that, it is necessary to design an object detection in the industrial quality detection, especially for those with higher similarities and greater ranges of size.
Figure 2: DS-MoE Framework. DeepSeek-R1 generates defect-specific text prompts. MobileSAM encoder extracts multi-scale visual features. Hyperbolic manifold alignment fuses text and vision in curvature-aware space. Dynamic sparse MoE gates (top-k experts) activate task-relevant visual experts for fine-grained defect analysis. Dual-branch head outputs simultaneous classification and localization.
Figure 3: Hyperbolic Manifold Alignment. In the Poincaré ball, visual features are first lifted onto the manifold via the exponential map, while distilled text embeddings are anchored in the same space. Their logarithmic mappings are then fused with a learnable weight, preserving both the global defect taxonomy and local semantic nuances. The resulting geometrically aligned features enable downstream curvature-aware convolutional sampling.
Figure 4: A concise flowchart of Stages 8–10. Sparse MoE dynamically routes each input to only ⌊log2Ne⌋ experts: two task-specific modules (anisotropic local patterns and global structure) and selected cross-modal experts that fuse vision with replicated text embeddings. Their outputs are ensembled via dilated convolutions and reweighted by channel-wise attention, yielding a compact feature map.
Figure 5: The glass bottle bottom detection device collects images. During this process, the glass bottle will be suspended by the conveyor belts on both sides and sent to the photographing. The photoelectric gate receives the signal to trigger the light source and the camera at the bottom to take pictures.
Figure 6: Mold point images of different batches. Representative mold-point images from different production batches, illustrating the subtle height variations that make classification challenging.
Table 1: Contrast experiment on the BBMP dataset. Bold indicates best mean performance. DS-MoE statistics are reported as mean ± 95 % CI over five independent runs; p refers to a paired t -test against YOLOv8.
Figure 7: Real-time inspection interface on the glass-bottle production line. In the test system interface, the red box shows the detection accuracy and the time of reasoning a picture, and the blue box shows some detection results. After 30 samples, both precision and recall reach 100 %.
Table 2: Ablation study on BBMP. Incremental gains confirm the necessity of text guidance, MobileSAM backbone, hyperbolic alignment, dynamic experts and the QFocal+CIoU loss.
Figure 8: Sample aluminum-surface defect image. The small defect (zhen kong) and large defect (zang wu) co-exist, demonstrating extreme scale variation.
Table 3: Contrast experiment on the aluminum-defect dataset. Bold indicates best mean performance. DS-MoE statistics are reported as mean ± 95 % CI over five independent runs; p refers to a paired t -test versus YOLOv8.
Figure 9: Qualitative detection results on 16 aluminum-defect images. Bounding boxes and class labels are overlayed to show the model’s ability to localize multi-scale defects accurately.
Table 4: Ablation study on aluminum defects. Each component systematically improves robust detection of pinholes, scratches, contamination and creases.
Table 6: Experiments without tiny object detector. Class-wise results on aluminum defects without the tiny-object head, revealing recall deficits on sub-millimetre pinholes.
Table 7: Experiments with tiny object detector. Class-wise results on aluminum defects with the tiny-object head, showing consistent gains for pinhole detection.
Figure 10: Example PCB defects: (left) missing hole, (right) mouse bite. Both are sub-millimeter anomalies that require high-resolution feature preservation for reliable detection.
Table 8: Contrast experiment on the PCB surface-defect dataset. Bold indicates best mean performance. DS-MoE statistics are reported as mean ± 95 % CI over five independent runs; p refers to a paired t -test versus YOLOv8.