| Literature DB >> 35271153 |
Ioannis Saradopoulos1, Ilyas Potamitis2, Stavros Ntalampiras3, Antonios I Konstantaras1, Emmanuel N Antonidakis1.
Abstract
Our aim is to promote the widespread use of electronic insect traps that report captured pests to a human-controlled agency. This work reports on edge-computing as applied to camera-based insect traps. We present a low-cost device with high power autonomy and an adequate picture quality that reports an internal image of the trap to a server and counts the insects it contains based on quantized and embedded deep-learning models. The paper compares different aspects of performance of three different edge devices, namely ESP32, Raspberry Pi Model 4 (RPi), and Google Coral, running a deep learning framework (TensorFlow Lite). All edge devices were able to process images and report accuracy in counting exceeding 95%, but at different rates and power consumption. Our findings suggest that ESP32 appears to be the best choice in the context of this application according to our policy for low-cost devices.Entities:
Keywords: e-traps; edge computing; image sensors; pest detection
Mesh:
Year: 2022 PMID: 35271153 PMCID: PMC8914644 DOI: 10.3390/s22052006
Source DB: PubMed Journal: Sensors (Basel) ISSN: 1424-8220 Impact factor: 3.576
Figure 1(a) The ESP32-CAM-based device, (b) the Coral-based device, and (c) the Raspberry Pi4 device.
Figure 2(a) A subsample of insects used to make the reference database. (b) A typical photo from a funnel trap in the field. (c) A photo from the internal space of the suggested device (ESP32-CAM).
Figure 3A customized DL model for counting insects that fits into a microprocessor.
The reference database. Numbers 0–6 denote how many insects are in an image.
| # Images | Training (70%) | Validation (30%) | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|---|---|
| 9800 | 4200 | 2000 | 2000 | 2000 | 2000 | 2000 | 2000 | 2000 | |
|
|
|
|
|
|
|
| |||
| 200 | 200 | 200 | 200 | 200 | 200 | 200 |
Accuracy and model size in MB for various backends.
| Software Back-End | Model Name | Acc. (α = 1 − |Μc − Ac|/Mc) | Model Size (MB) |
|---|---|---|---|
| TensorFlow | model_count_final.h5 | 0.951 | 5.9 |
| TensorFlow Lite | model_count_final.tflite | 0.951 | 2 |
| TensorFlow Lite Quantization | model_count_final_quant.tflite | 0.950 | 0.5 |
| TensorFlow Lite Quantization TPU (Coral) | model_count_final_quant_edgetpu.tflite | 0.950 | 0.55 |
Accuracy (α = 1 − |Μc − Ac|/Mc) as measured per class. Accuracy drops from 99% for the background class to 95% for the 6 insects class. The mean acc. is 0.950.
| Number of Insects Per Image | Accuracy (α = 1 − |Μc − Ac|/Mc) |
|---|---|
|
| 0.991 |
|
| 0.942 |
|
| 0.931 |
|
| 0.945 |
|
| 0.945 |
|
| 0.953 |
|
| 0.951 |
|
| 0.950 |
Processing time for all edge devices on the same quantized model: (a) load models and initialize the inference procedure, (b) process an image and derive a count of the insects inside.
| Edge Device | Model | Load Model and Initialize | Inference Time |
|---|---|---|---|
| ESP32-CAM | TensorFlow Lite Quant. Micro | 51 s | |
| Raspberry Pi4 | TensorFlow Lite Quant. | 70.550 μs | 88.868 μs |
| Coral mini Dev | TensorFlow Lite Quant. | 6.726 μs | 132.546 μs |
| Coral mini Dev | TensorFlow Lite Quant. TPU (Coral) | 385.854 μs | 31.531 μs |
Technical specifications of the hardware platforms compared in this work. The cost is indicative (30/12/21).
| ESP32 | Raspberry Pi 4 Model B | Coral Dev Board Mini Datasheet | |
|---|---|---|---|
| CPU | Xtensa® dual-core 32-bit LX6 microprocessor(s), up to 600 MIPS 160 MHz | Broadcom BCM2711, quad-core Cortex-A72 (ARM v8) | MediaTek 8167s SoC Quad-core ARM Cortex-A35 1.5 GHz |
| GPU | Imagination PowerVR GE8300 | ||
| TPU | Google Edge TPU ML accelerator | ||
| RAM | 520KB SRAM +4M PSRAM | 4 Gigabyte LPDDR4 RAM | 2 GB LPDDR3 |
| Flash | 4 MB Flash | 8 GB eMMC, | |
| WiFi | 802.11 b/g/n/ | 802.11 b/g/n/ac Wireless LAN | WiFi 5 |
| Ethernet | Gigabit Ethernet port (supports PoE with add-on PoE HAT) | ||
| Bluetooth | Bluetooth 4.2 BR/EDR BLE | Bluetooth 5.0 with BLE | Bluetooth 5.0 |
| SD Card | TFCard | SD Card | Meets SD/SDIO 3.0 standard |
| Camera | SCCB | 1× Raspberry Pi 2-lane MIPI CSI Camera and 1x Raspberry Pi 2-lane MIPI DSI Display connector | MIPI-CSI2 camera input |
| Operating System | Free RTOS | Raspbian | Mendel Linux |
| Turn off flash lamp 180 mA@5V | Typical 800 mA | Accelerator Module | |
| TurnOn flash lamp 310 mA@5V | Stress 1200 mA | TPU used 425 mA 212 mA@3,3 V | |
| Deep-sleep 6 mA@5V | Idling 600 mA | Typical idle 114–121 mA@3,3 V | |
| Halt current 23 mA | PMIC digital I/O power supply current (AON) 10 mA | ||
| Sources | Copyright© 2022 Shenzhen Ai-Thinker Technology Co., Ltd. All Rights Reserved | Raspberry Pi 4 Model B Datasheet Copyright Raspberry Pi (Trading) Ltd. 2019 | Dev Board Mini datasheet |
| US$7.99 | $55.00 | $110.95 | |
| OV2640 | Raspberry Pi Camera Module | Coral Camera | |
| Chip | OV2640 CAMERA CHIP | Sony IMX 219 PQ CMOS image sensor in a fixed-focus module. | 5-megapixel OmniVision sensor |
| Resolution | 2-megapixel | 8-megapixel | 5-megapixel |
| Max Resolution | 1600 × 1200 | 3280 × 2464 | 2582 × 1933 |
| Video | UXGA(1600 × 1200) 15fps | 1080p(1920 × 1080) 30fps | |
| SVGA(800 × 600) 30fps | 720p(1280 × 720) 60fps | ||
| CIF (352 × 288) 60fps | (640 × 480) 60/90 fps | ||
| Image area | 3.59 × 2.684 mm | 3.68 × 2.76 mm (4.6 mm diag.) | 2.5 mm |
| Pixel size | 2.2 μm × 2.2 μm | 1.12 µm × 1.12 µm | 1.4 × 1.4 μm pixel size |
| Picture formats | YUV(422/420) YCbCr422, RGB565/555, 8-bit Compressed data, 8~10 bit Raw RGB data | JPEG, JPEG + DNG (raw), BMP, PNG, YUV420, RGB888 | |
| Len Size | 1/4″ | 1/4″ | 1/4″ |
| Sensitivity | 600 mV /Lux-sec | 680 mV/lux-sec | |
| Cam Cost | $7.99 camera and board | $25.00 | $24.95 |
Power consumption for key tasks. First column: Standby and deep sleep Average current. This is the key consumption number that allows the ESP32 to be the suggested solution. Second column: Avg. current: the consumption to take a picture with flash and the time needed to carry out the task. Third column: Avg. current for inference, consumption, and time to run the model for 1 picture. Fourth column: current required to save a picture to the SD and upload it through the WiFi. Fifth column: Avg. current to carry out other functions such as: system initialization, setup WiFi, load model and initialize camera. Last column: Total consumption and time to carry out all tasks from waking up, performing all tasks till going back to standby mode.
| Edge Device | Stand By or Deep Sleep Avg. Current (mA) | Avg. Current | Avg. Current Inference | Avg. Current Store in SD Wifi Upload | Avg. Current Other Functions | mA in 63 s | ||||
|---|---|---|---|---|---|---|---|---|---|---|
| mA | Sec | mA | Sec | mA | Sec | mA | Sec | mA | mA | |
| ESP32-CAM TensorFlow Lite Micro | 6 | 2 | 180 | 51 | 85 | 3.5 | 150 | 6.5 | 70 | 5595 |
| Raspberry pi 4 B TensorFlow Lite | 410 | 0.914 | 470 | 0.174 | 560 | 0.918 | 490 | 60.994 | 410 | 25984.38 |
| Coral mini Dev TensorFlow Lite | 240 | 0.062 | 400 | 0.135 | 460 | 0.08 | 450 | 62.723 | 240 | 15176.42 |
| Coral mini Dev TensorFlow Lite TPU (Coral) | 240 | 0.062 | 400 | 0.036 | 460 | 0.076 | 450 | 62.826 | 240 | 15153.8 |
Figure 4(a) The camera-based trap in operational conditions. (b) The case of one insect at day T. (c) At day T + 1 there are three insects. The difference in inferred counts from day T to T + 1, triggered an alert. Counting does not require a high analysis picture as in an identification task. Note the low quality of the pictures in (b,c).