Abstract
Deep learning has revolutionized the identification of Chinese Medicinal Decoction Pieces (CMDP), yet the scarcity of labeled data for thousands of herb varieties remains a significant hurdle. This paper introduces Meta-YOLOv8, a few-shot object detection framework that integrates meta-learning with the anchor-free YOLOv8 architecture. By employing a Multi-Scale Class Feature Extraction Module (CFEM), Heterogeneous Graph Convolutional Networks (HGCN), and a Classification Auxiliary Module (CAM), the model learns to identify novel herb classes from as few as one to thirty examples. Experimental results on the CMDP4K dataset show that Meta-YOLOv8 improves mean average precision ($mAP_{0.5}$) by up to 20.4% over standard YOLOv8 with only a 6.6% increase in inference time, offering a robust solution for real-time pharmaceutical automation.
The Challenge of Herb Identification
Identifying Chinese Medicinal Decoction Pieces (CMDP)—the processed slices of herbs—is traditionally a labor-intensive task requiring significant expertise. While standard deep learning models can automate this, they typically require massive datasets. In the context of TCM, where thousands of species exist, collecting thousands of labeled images for every variety is impractical.
Few-Shot Object Detection (FSOD) addresses this by training models to recognize new categories from a limited "support set" of examples. However, traditional FSOD methods often struggle with the multi-scale nature of small herb slices or rely on slower, region-proposal-based architectures.
Methods: Meta-Learning Meets YOLOv8
Meta-YOLOv8 adapts the popular YOLOv8 pipeline into a meta-learning framework. The core innovation lies in how the model processes class-specific information across multiple scales to create robust "prototypes" for each herb.
Core Architecture Modules
- Multi-Scale Class Feature Extraction Module (CFEM): This module uses Task Alignment Learning to pinpoint the most representative features of an herb, ensuring that the extracted data captures the essential morphological traits rather than background noise.
- Heterogeneous Graph Convolutional Networks (HGCN): HGCN treats features as nodes in a graph. Intra-scale subgraphs share information between different samples of the same herb, while inter-scale subgraphs learn relationships across different resolutions. This creates scale-invariant class prototypes that help the model recognize a "Ginger" slice whether it appears large or small in the frame.
- Multi-Scale Classification Auxiliary Module (CAM): A lightweight branch that compares detected objects against learned prototypes. It acts as a "second opinion" for the main classification head, significantly boosting the recall of rare, novel classes.
Experimental Results and Insights
The researchers evaluated Meta-YOLOv8 on standard benchmarks (VOC and COCO) and a specialized CMDP4K dataset containing 38 common medicinal pieces.
- Performance Gains: Meta-YOLOv8 achieved a $mAP_{0.5}$ improvement ranging from 2.2% to 20.4% compared to the base YOLOv8 model, depending on the number of available samples (shots).
- Efficiency: Despite the added complexity of graph networks, the model maintains high-speed performance. On an NVIDIA RTX 3080 Ti, inference takes approximately 3.3ms, making it suitable for mobile deployment in hospitals or pharmacies.
- Scale Consistency: The use of inter-scale subgraphs proved critical. By forcing the model to maintain consistency across different image resolutions, the resulting class prototypes became much more reliable in low-data scenarios.
Conclusion
Meta-YOLOv8 demonstrates that meta-learning can be successfully integrated into high-speed, anchor-free detectors like YOLOv8. While the model still faces challenges in distinguishing between extremely similar-looking species (fine-grained differentiation), it provides a powerful technical foundation for the smart development of the Traditional Chinese Medicine industry. Future work will focus on integrating botanical taxonomic knowledge to further refine the model's discriminative capabilities.
Summary updated