TL;DR
This paper introduces a novel "dual-teacher supervised decay" (DTSD) knowledge distillation approach to improve the accuracy and efficiency of Chinese herbal medicine recognition on mobile devices. By leveraging two sophisticated teacher models to guide a lightweight student model (MobileNet_v3_Small), they achieve state-of-the-art accuracy with a significantly smaller model size and faster inference times.
What Problem Does This Paper Address?
Traditional Chinese Medicine (TCM) relies heavily on the accurate identification of numerous herbal ingredients. However, the vast diversity of these herbs, coupled with the proliferation of counterfeit products, makes accurate identification a significant challenge for both consumers and practitioners. Existing deep learning approaches for image recognition often result in large, computationally expensive models that are unsuitable for deployment on resource-constrained mobile devices. This paper aims to bridge this gap by developing a highly accurate yet lightweight model for Chinese herbal medicine recognition that can be deployed on mobile applications.
Methods
The core of this work is the Dual-Teacher Supervised Decay (DTSD) knowledge distillation method. Unlike standard knowledge distillation that uses a single teacher model, DTSD employs two high-performance teacher models (ResNet50_vd and DenseNet121) to generate more robust and accurate "soft labels."
Key innovations in DTSD include:
- Dual-Teacher Supervision: Combining the predictions of two teacher models to create a richer and more accurate soft label distribution. This is achieved by taking the maximum value of predictions from each teacher for each class.
- Adaptive Decay Parameters: The temperature parameter (T) and the weighting factor (λ) that balances the teacher's soft labels and the ground truth hard labels are dynamically adjusted throughout training.
- Temperature (T): Initially low to help the student model quickly learn basic parameters, then gradually increases to incorporate more "dark knowledge" from the teachers. This is modeled using an S-shaped curve (sigmoid function).
- Weighting Factor (λ): Initially high to leverage the accuracy of pre-trained teacher models, then decreases to allow the student model to rely more on its own learning from hard labels. This is also modeled using an S-shaped curve.
- Jensen-Shannon (JS) Divergence Loss: Replaces standard cross-entropy loss for soft labels to better capture the similarity between probability distributions, facilitating more effective knowledge transfer.
- Lightweight Student Model: The DTSD method is applied to the MobileNet_v3_Small architecture, a known efficient model, to ensure a small footprint and fast inference.
Datasets
- Chinese Herbal Medicine Dataset: A custom dataset of 1000 images, comprising 10 distinct types of Chinese herbal medicines. Each type has 100 images, resized to 320x320 pixels. This dataset was split into training (70%), validation (20%), and testing (10%) sets.
- ImageNet2012: Used for pre-training the teacher and student models before fine-tuning on the Chinese herbal medicine dataset.
Key Insights and Ideas
- Dual Teachers are Better Than One: Combining knowledge from multiple sophisticated teacher models provides a more comprehensive and accurate "dark knowledge" for the student model to learn from, leading to improved performance.
- Dynamic Learning Rates Matter: The adaptive decay of temperature and weighting parameters is crucial. A static approach would either hinder early learning or prevent the student from fully leveraging teacher knowledge.
- Lightweight Models Can Be Highly Accurate: By employing advanced knowledge distillation techniques, even a small model like MobileNet_v3_Small can achieve accuracy comparable to much larger, more complex architectures.
- Pre-training is Essential: Transfer learning from ImageNet significantly boosts the performance of all models, including the student model, by providing a strong initial feature extraction capability.
Key Results
- High Accuracy: The proposed DTSD method achieved an average classification accuracy of 98.60% on the 10 types of Chinese herbal medicine images.
- Fast Inference: The model boasts an average detection time of 0.0172 seconds per image.
- Small Model Size: The compressed model size is only 10 MB, making it ideal for mobile deployment.
- Superior Performance: Comparative experiments showed that DTSD outperformed other models like DenseNet121, ResNet50_vd, Xception65, and EfficientNetB1 in terms of accuracy and/or efficiency metrics. It also outperformed a standard MobileNet_v3_Small with SSLD (semi-supervised label knowledge distillation) by 1.50%.
Limitations and Future Work
- Robustness in Complex Scenarios: The authors acknowledge that the model's robustness in dealing with complex scenes and varying lighting conditions needs further improvement to ensure high accuracy across a wider range of real-world scenarios.
- Dataset Expansion: Future work will focus on expanding and diversifying the dataset to include more herbal species and environmental variations.
- Adversarial Training: Introducing adversarial training techniques is suggested to enhance the model's robustness against noise and interference.
Summary updated