Lightweight Tunnel Obstacle Detection Based on Improved YOLOv5

Yingjie Li, Chuanyi Ma, Liping Li, Rui Wang, Zhihui Liu, Zizheng Sun2024 · DOI

TL;DR

This paper tackles the challenge of real-time obstacle detection for robots in dimly lit, complex tunnel construction environments. They propose a lightweight, improved YOLOv5 model that significantly boosts inference speed and reduces model size while maintaining high accuracy, making it suitable for deployment on resource-constrained embedded systems.

What Problem Does This Paper Address?

Tunnel construction and maintenance are hazardous tasks, and robots are increasingly being deployed to replace human workers. However, these robots need robust autonomous obstacle avoidance capabilities to navigate safely. Existing obstacle detection methods often struggle in the dim, cluttered environments of tunnels, and many deep learning models are too computationally expensive for deployment on the limited hardware of robots. This paper addresses the need for a lightweight, accurate, and fast obstacle detection system specifically tailored for tunnel construction scenarios.

Methods

The authors build upon the YOLOv5n architecture, a lightweight variant of the YOLOv5 object detection model. Their improvements focus on several key areas:

  • Lightweight Backbone: The original CSPDarknet53 backbone is replaced with Shufflenet v2, known for its efficiency and reduced computational cost.
  • Attention Mechanism: A C3_CA module, combining the C3 module with a Coordinate Attention (CA) mechanism, is introduced in the backbone. This helps the model focus on crucial features and improves accuracy, especially in challenging lighting conditions.
  • Improved Neck Convolution Block: The standard convolutional modules in the neck of the network are replaced with GSConv. This hybrid approach combines depth-wise separable convolution with standard convolution to improve accuracy without significantly increasing computational load.
  • Enhanced Upsampling: The traditional upsampling method is replaced with the CARAFE (Content-Aware Reassembly of Features) operator. CARAFE provides more precise localization and better preservation of fine-grained details, crucial for detecting objects at various scales.
  • Low-Light Enhancement: To address the dim lighting in tunnels, the EnlightenGAN network is used as a preprocessing step to enhance image quality before detection.

Datasets

The authors created a custom dataset for tunnel construction scenarios due to the lack of publicly available ones. This dataset consists of 8000 images captured using a Xiaomi 11 smartphone. The images were augmented with horizontal flipping and brightness enhancement. The dataset is categorized into six classes: "people," "excavator," "mixer truck," "muck truck," "shovel car," and "traffic cone." The dataset was split into training, validation, and testing sets in an 8:1:1 ratio.

Key Insights and Ideas

  • Shufflenet v2's Efficiency: Replacing the backbone with Shufflenet v2 significantly boosts inference speed and reduces model size, demonstrating its suitability for embedded systems.
  • Attention for Robustness: Incorporating attention mechanisms, particularly the C3_CA module, is crucial for improving detection accuracy in complex and low-light tunnel environments by helping the model focus on relevant features.
  • GSConv Balances Accuracy and Efficiency: The GSConv module in the neck effectively bridges the gap between the accuracy limitations of purely depth-wise separable convolutions and the computational cost of standard convolutions.
  • CARAFE for Precise Localization: CARAFE's ability to improve upsampling and preserve fine details is key to accurately localizing objects of varying sizes in the challenging tunnel environment.
  • EnlightenGAN for Preprocessing: Using a dedicated low-light enhancement network as a preprocessing step is a practical solution to overcome the inherent challenges of dim tunnel lighting.

Key Results

The proposed improved YOLOv5 model demonstrates significant improvements:

  • Inference Speed: Approximately a 37% increase compared to the initial model.
  • Frame Rate: A 54% increase.
  • Parameter Count: Reduced by approximately 1.2 million (from ~7.2M for YOLOv5n to ~6.02M for the final model, though the paper states a reduction of 1.2M parameters from the initial model, which is likely YOLOv5n).
  • Model Size: Decreased by approximately 64% (from 12.3 MB for YOLOv7-tiny to 1.4 MB for the final model, though the paper states a decrease of 2.5 MB from the initial model, which is likely YOLOv5n).
  • Accuracy: A minimal accuracy reduction of 1.5% ([email protected]/% of 95.2% for the final model compared to 96.7% for YOLOv5n).

The authors highlight that while YOLOv7-tiny has higher accuracy, its computational complexity and parameter count make it unsuitable for embedded devices, reinforcing the value of their lightweight approach.

Limitations and Future Work

  • Dataset Availability: The authors acknowledge the lack of publicly available datasets for tunnel construction scenarios and had to create their own. This custom dataset might not fully represent the diversity of all tunnel environments.
  • Accuracy Trade-off: While the model achieves a good balance, there is a slight decrease in detection accuracy (1.5%) compared to the base YOLOv5n model.
  • Future Work: The paper implies that further optimization for embedded devices is always a goal, and the current work provides a strong foundation for such advancements. The focus on balancing speed and accuracy suggests future work might explore further trade-offs or explore even more efficient architectures.

Summary updated

BibTeX
@misc{li2024lightweight,
  author = {Yingjie Li and Chuanyi Ma and Liping Li and Rui Wang and Zhihui Liu and Zizheng Sun},
  title = {{Lightweight Tunnel Obstacle Detection Based on Improved YOLOv5}},
  year = {2024},
  doi = {10.3390/s24020395},
}
Figure