[Paper Review] Real-time Mask Detection on Google Edge TPU
This paper presents a lightweight, real-time mask detection system deployed on Google Edge TPU using a MobileNetV2-SSD architecture with post-training quantization. The model achieves 6.4ms inference latency on Edge TPU while maintaining 58.4% mAP, enabling low-latency, privacy-preserving deployment on edge devices without significant accuracy loss compared to floating-point models.
After the COVID-19 outbreak, it has become important to automatically detect whether people are wearing masks in order to reduce risk of front-line workers. In addition, processing user data locally is a great way to address both privacy and network bandwidth issues. In this paper, we present a light-weighted model for detecting whether people in a particular area wear masks, which can also be deployed on Coral Dev Board, a commercially available development board containing Google Edge TPU. Our approach combines the object detecting network based on MobileNetV2 plus SSD and the quantization scheme for integer-only hardware. As a result, the lighter model in the Edge TPU has a significantly lower latency which is more appropriate for real-time execution while maintaining accuracy comparable to a floating point device.
Motivation & Objective
- To develop a low-latency, privacy-preserving mask detection system suitable for real-world deployment in public spaces.
- To address privacy and bandwidth concerns by processing data locally on edge devices instead of transmitting video to the cloud.
- To reduce model size and inference latency while maintaining high accuracy for deployment on low-power hardware like the Coral Dev Board.
- To demonstrate that quantized, integer-only inference on Edge TPU can achieve performance comparable to floating-point models.
Proposed method
- The model uses a single-stage object detection architecture combining MobileNetV2 as the backbone and SSD for predicting bounding boxes and class scores.
- Transfer learning is applied by initializing the model with a pre-trained face detection model from TensorFlow Model Zoo and fine-tuning it for mask/no-mask classification.
- Post-training quantization is applied to convert the 32-bit floating-point model into an 8-bit integer-only model suitable for deployment on Edge TPU.
- The model is compiled for Edge TPU using the Edge TPU compiler to further optimize inference speed.
- Two model variants are evaluated: a two-stage 2NN model (face detection followed by classification) and a unified 1NN model combining both tasks into a single network.
- Evaluation is conducted on both CPU and Edge TPU platforms using a test set of 425 images, including diverse mask colors and augmented face-mask combinations.
Experimental results
Research questions
- RQ1Can a lightweight, real-time mask detection model be effectively deployed on low-power edge hardware like the Coral Dev Board with Google Edge TPU?
- RQ2How does post-training quantization affect the accuracy and latency of a mask detection model when running on integer-only hardware?
- RQ3What is the performance gap between floating-point and quantized models in terms of mAP and inference latency on Edge TPU?
- RQ4Does a unified 1NN model outperform a two-stage 2NN model in both speed and accuracy for real-time mask detection?
- RQ5To what extent can local on-device inference reduce privacy and bandwidth concerns in public surveillance applications?
Key findings
- The 1NN model achieved 6.4ms average inference latency on Edge TPU, a 90% reduction compared to the 2NN model’s 26ms latency.
- The 1NN model achieved 58.4% mAP on Edge TPU, with only a 0.4% drop from the 32-bit floating-point CPU model (64.7%) and a 6.3% drop from the 8-bit CPU model (58.8%).
- The 1NN model outperformed the 2NN model in both latency and accuracy, with 455ms latency on CPU (vs. 1267ms for 2NN) and 58.8% mAP (vs. 55.0% for 2NN).
- Quantization reduced model size and latency significantly, with the 1NN model achieving 455ms latency on CPU and 6.4ms on Edge TPU, demonstrating strong efficiency on integer-only hardware.
- The Edge TPU version of the 1NN model maintained 58.4% mAP, showing minimal accuracy degradation (0.4% loss) compared to the 32-bit CPU version, proving the viability of quantized models on edge devices.
- The unified 1NN architecture is more efficient than the two-stage 2NN approach, as it eliminates the need for sequential inference and reduces overall latency.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.