Chinese Traditional and Herbal Drugs
|
2026, 57(17): 6878-6886
DWG-CA-YOLOv8 algorithm for real-time detection of capsule defect
Full
PENG Xulong, WANG Shengsheng, YAO Tian, WAN Qingzhao, MAO Zhixiong, WU Zhenfeng, YANG Ming, PENG Changchun, WANG Yaqi
Affiliations
doi: 10.7501/j.issn.0253-2670.2026.17.019
Outline
Objective To address the challenges of difficult detection of tiny tangential defects, strong background noise interference, and the difficulties in deploying general detection models on low-computing-power edge devices in pharmaceutical capsule production lines, an improved lightweight object detection algorithm is proposed. Methods Using YOLOv8n as the baseline architecture, targeted optimizations are performed through a three-pronged strategy. A coordinate attention (CA) mechanism is embedded in the backbone network to enhance the model’s spatial perception capability for tiny tangential defects and edge micro-defects of capsules. A C2f_GhostConv module is designed to reconstruct the neck network, utilizing Ghost convolution (“primary convolution + cheap operations”) to enhance fine-grained feature representation. Depthwise separable convolution (DWConv) is comprehensively adopted to replace the standard convolution in the backbone, decoupling spatial convolution and channel fusion into two independent steps, thereby achieving deep compression of parameter count and computational load. Results On an industrial dataset containing 1 204 images of various capsule defects, DWG-CA-YOLOv8 achieves a mean Average Precision (mAP@0.5) of 90.5%, demonstrating high-precision localization and accurate classification for six defect types and normal capsules, meeting the reliability required for industrial real-time detection. The model’s parameter count is reduced to 2.10 M, and the floating-point operations (FLOPs) to 5.9 G, representing reductions of 30.2% and 28.1%, respectively, significantly improving lightweight performance. Conclusion This study successfully achieves synergistic optimization of detection accuracy and model complexity, providing a scalable and low-cost lightweight solution for real-time online quality control of pharmaceutical production lines.
machine vision
/
capsule defect detection
/
YOLOv8
/
Ghost convolution
/
lightweight network
彭旭龙, 王生生, 姚添, 万倾兆, 毛志雄, 伍振峰, 杨明, 彭常春, 王雅琪.
胶囊缺陷实时检测的DWG-CA-YOLOv8算法.
中草药,
2026
, 57
(17)
: 6878
-6886
.
DOI: 10.7501/j.issn.0253-2670.2026.17.019
PENG Xulong, WANG Shengsheng, YAO Tian, WAN Qingzhao, MAO Zhixiong, WU Zhenfeng, YANG Ming, PENG Changchun, WANG Yaqi.
DWG-CA-YOLOv8 algorithm for real-time detection of capsule defect[J].
Chinese Traditional and Herbal Drugs,
2026
, 57
(17)
: 6878
-6886
.
DOI: 10.7501/j.issn.0253-2670.2026.17.019
Year 2026 volume 57 Issue 17
30
5
Cite this Article
BibTeX
Article Info
doi: 10.7501/j.issn.0253-2670.2026.17.019
- Receive Date:2026-06-10
- Online Date:2026-10-29