TL;DR
This paper demonstrates the feasibility of running advanced image-based pest detection directly on a novel, energy-efficient heterogeneous microcontroller (GAP9) equipped with a dedicated CNN accelerator. By comparing a traditional Viola-Jones detector with a MobileNetV3-SSDLite CNN, they show that the CNN achieves higher accuracy and significantly faster inference times on the GAP9, enabling long-lasting, low-power smart agriculture sensors.
What Problem Does This Paper Address?
The codling moth is a major agricultural pest, causing significant crop losses. Traditional methods for monitoring its presence are labor-intensive and costly. While camera-based sensor nodes can automate this, they face severe power constraints, as they often rely on battery power or energy harvesting. Transmitting raw images for analysis is power-prohibitive. Therefore, there's a critical need for efficient, on-device image processing that can accurately detect pests without draining the battery too quickly. Previous attempts often used less sophisticated algorithms or power-hungry processors. This paper addresses the challenge of deploying accurate, end-to-end computer vision models for pest detection on ultra-low-power microcontrollers, specifically leveraging a new generation of hardware with dedicated AI acceleration.
Methods
The core of this work lies in evaluating two distinct computer vision approaches for pest detection on the GreenWaves Technologies GAP9 System-on-Chip (SoC).
- Viola-Jones Detector: This is a classic, feature-based object detection algorithm. The authors implemented a latency-optimized version, utilizing parallel processing across the GAP9's general-purpose RISC-V cores. To handle memory limitations, they employed a tiling strategy for processing images.
- MobileNetV3-SSDLite CNN: This is a modern, deep learning-based object detector. The authors trained this model for codling moth detection and then deployed it on the GAP9. Crucially, they leveraged the GAP9's dedicated Neural Engine (NE16) hardware accelerator for CNN inference. This accelerator is designed to significantly speed up convolution operations, which are fundamental to CNNs.
- System Integration: The processing unit (GAP9) was integrated with a low-power image sensor and a LoRa module for wireless communication, forming a complete smart sensor node.
- Power Management: A duty-cycling strategy was implemented, where the system periodically wakes up from deep sleep to capture an image, perform detection, transmit results, and then return to sleep. This is key to achieving long battery life.
Datasets
The authors created a custom dataset for training and evaluating their models.
- Custom Dataset: This dataset consists of 158 images (320x240 pixels) captured under daylight conditions, containing a total of 1275 manually labeled codling moth targets.
- Test Sets: For evaluation, they used two specific test sets:
- near-ds: 11 samples with 196 target objects, representing insects closer to the camera.
- far-ds: 7 images with 158 target objects, representing insects further away.
- These datasets were downscaled to 320x240 pixels and augmented with greyscale transformation and additive Gaussian noise to mimic the quality of the target low-power camera sensor.
Key Insights and Ideas
- Hardware Acceleration is Crucial for CNNs: The paper strongly highlights the impact of dedicated hardware accelerators like the GAP9's NE16. Without it, running CNNs on general-purpose cores is significantly slower, making them impractical for real-time, low-power applications.
- CNNs Generalize Better for Distant Targets: While Viola-Jones is simpler, the CNN (MobileNetV3-SSDLite) demonstrated superior performance, especially on the "far-ds" dataset where targets are smaller and further away. This suggests that deep learning models are more robust to variations in scale and distance.
- End-to-End Detection on the Edge is Achievable: The study proves that complex tasks like object detection can be performed entirely on a low-power microcontroller, eliminating the need to transmit large image files and drastically reducing power consumption.
- Power Efficiency is Paramount: The work meticulously analyzes power consumption and battery life, demonstrating that the proposed system can operate for months on a small battery, making it viable for remote, unattended deployments.
- Trade-offs Between Accuracy and Efficiency: While the CNN offers higher accuracy, its computational cost is higher. However, the GAP9's accelerator effectively bridges this gap, making the CNN competitive in terms of both speed and energy efficiency with the simpler Viola-Jones algorithm.
Key Results
- Detection Accuracy:
- near-ds: Viola-Jones: 81.7%, MBNV3-SSD: 83.0%
- far-ds: Viola-Jones: 45.0%, MBNV3-SSD: 72.0%
- Inference Speed on GAP9:
- Viola-Jones: 221 ms
- MBNV3-SSD (with NE16 accelerator): 147 ms
- Speedup vs. GAP8 (without accelerator):
- Viola-Jones: 1.43x faster on GAP9
- MBNV3-SSD: 9.5x faster on GAP9 (using NE16)
- Energy Consumption per Inference:
- MBNV3-SSD on GAP9: 4.85 mJ (matching Viola-Jones efficiency)
- Estimated Battery Lifetime: Approximately 199 days (processing an image every 30 seconds with a 1000 mAh battery).
- Power Consumption Reduction: Up to 15x lower than previous methods.
Limitations and Future Work
- Dataset Limitations: The custom dataset, while useful, is relatively small (158 images). The authors acknowledge that the Viola-Jones algorithm's performance is heavily influenced by its training set's correlation with the test set. Future work could involve larger and more diverse datasets.
- CNN Quantization Impact: The post-training quantization to 8-bit for the CNN resulted in an accuracy drop, particularly on the "far-ds" dataset (-12.0%). While the GAP9's accelerator benefits from 8-bit operations, further research into quantization-aware training could mitigate this accuracy loss.
- NE16 Accelerator Limitations: The paper notes that the H-sigmoid function in MobileNetV3 is not natively supported by the NE16, requiring it to be run on general-purpose cores. Additionally, depthwise convolutions underuse the NE16's full capacity. Future work could explore models that better align with the accelerator's capabilities or investigate optimizations for these specific operations.
- Future Work Suggestions: The authors suggest exploring more advanced CNN architectures and further optimizing the system for even longer battery life, potentially through more sophisticated power management strategies and energy harvesting integration. They also imply that this platform is suitable for other AI-on-the-edge applications beyond pest detection.
Summary updated