Detection of Floating Objects on Water Surface Using YOLOv5s in an Edge Computing Environment

He Li, Shuaipeng Yang, Rui Zhang, Peng Yu, Zhumu Fu, Xiangyang Wang, Michel KadochWater 2023 · DOI

TL;DR

This paper tackles the challenge of accurately detecting small floating objects in rivers, a crucial task for environmental monitoring. They achieve this by enhancing the YOLOv5s model with novel data augmentation, a specialized attention mechanism for small targets, and optimizations for edge computing, resulting in improved accuracy and real-time performance.

What Problem Does This Paper Address?

Rivers are vital natural resources, but they are increasingly threatened by pollution, including plastic waste and dead organic matter. Timely detection and removal of these floating objects are essential for maintaining water quality, protecting aquatic life, and ensuring human health. Traditional manual monitoring methods are inefficient and cannot provide continuous, real-time surveillance. Existing automated systems often struggle with detecting small floating objects due to their low pixel count and limited feature information, leading to false detections or missed targets. Furthermore, deploying complex deep learning models on resource-constrained edge devices for real-time processing presents a significant challenge.

Methods

The researchers propose an improved YOLOv5s architecture to address these issues. Key modifications include:

  • Small Target Data Augmentation (STDA): A novel data augmentation technique inspired by Mosaic, specifically designed to enrich the dataset with more small target instances and improve the model's robustness.
  • Coordinate Attention Mechanism (CA) with Max-Pooling (MCA): To better capture subtle features of small targets and reduce interference from complex backgrounds, they integrate a Coordinate Attention mechanism. This mechanism is adapted with max-pooling (MCA) to effectively process feature maps at different network depths, enhancing the extraction of both local and global information.
  • Optimized Feature Fusion Network: A new feature pyramid network is constructed by adding an extra shallow feature map and employing bilinear interpolation for up-sampling. This approach aims to retain more feature information and improve the network's ability to sense small targets.
  • Network Optimization for Edge Devices: To enable deployment on edge platforms, the computationally expensive Focus module in YOLOv5 is replaced with a standard convolutional layer with a stride of 2.
  • Model Pruning: Structured channel-level pruning is applied to reduce the model's size and computational complexity, making it suitable for resource-limited edge devices without significantly compromising accuracy.

Datasets

The dataset used in this study was collected from the internet and through personal photography, comprising 10,100 images of floating objects. These images are categorized into four classes: plastic bottles, plastic bags, planktonic algae, and dead fishes. The dataset was split into training, validation, and test sets in an 8:1:1 ratio.

Key Insights and Ideas

  • Attention for Small Targets is Crucial: The integration of a specialized attention mechanism (MCA) proved highly effective in improving the detection of small floating objects, which are notoriously difficult to capture.
  • Data Augmentation Matters for Small Objects: The STDA method highlights the importance of tailored data augmentation strategies to specifically address the challenges of small object detection.
  • Edge Optimization is Feasible: The paper demonstrates that it's possible to optimize complex deep learning models for edge deployment through techniques like replacing specific modules and model pruning, achieving a balance between performance and resource constraints.
  • Bilinear Interpolation Aids Small Target Sensing: Replacing nearest-neighbor interpolation with bilinear interpolation in the feature fusion network helped retain more feature information, enhancing the network's sensitivity to small targets.

Key Results

The improved YOLOv5s model achieved significant improvements:

  • Accuracy: The model achieved a detection accuracy of 92.01% on edge testing. Compared to the original YOLOv5, the accuracy improved by 15.7%.
  • Small Target Performance: The error detection rate for small targets was reduced by 83%.
  • Inference Speed: The model achieved an inference speed of 33 frames per second, meeting real-time requirements.
  • Model Size Reduction: Channel pruning compressed the model volume by 69%, enabling efficient deployment on edge devices.

Limitations and Future Work

The authors acknowledge that challenges remain, particularly with larger datasets and more complex water surface environments. Future work will focus on:

  • Improving Noise Handling: Enhancing the model's capacity to handle noise information and adapt to the dynamic nature of external environments.
  • Operator Optimization for Embedded Platforms: Tailoring operator optimizations specifically for designated embedded platforms to further elevate model performance.
  • Edge-Coordinated Target Detection: Developing an edge-coordinated target detection network by using the enhanced YOLOv5 as a foundational unit.

Summary updated

Abstract

Aiming to solve the problems with easy false detection of small targets in river floating object detection and deploying an overly large model, a new method is proposed based on improved YOLOv5s. A new data augmentation method for small objects is designed to enrich the dataset and improve the model’s robustness. Distinct feature extraction network levels incorporate different coordinate attention mechanism pooling methods to enhance the effective feature information extraction of small targets and improve small target detection accuracy. Then, a shallow feature map with 4-fold down-sampling is added, and feature fusion is performed using the Feature Pyramid Network. At the same time, bilinear interpolation replaces the up-sampling method to retain feature information and enhance the network’s ability to sense small targets. Network complex algorithms are optimized to better adapt to embedded platforms. Finally, the model is channel pruned to solve the problem of difficult deployment. The experimental results show that this method has a better feature extraction capability as well as a higher detection accuracy. Compared with the original YOLOv5 algorithm, the accuracy is improved by 15.7%, the error detection rate is reduced by 83% in small target task detection, the detection accuracy can reach 92.01% in edge testing, and the inference speed can reach 33 frames per second, which can meet the real-time requirements.
BibTeX
@inproceedings{li2023detection,
  author = {He Li and Shuaipeng Yang and Rui Zhang and Peng Yu and Zhumu Fu and Xiangyang Wang and Michel Kadoch and Yang Yang},
  title = {{Detection of Floating Objects on Water Surface Using YOLOv5s in an Edge Computing Environment}},
  booktitle = {Water},
  year = {2023},
  doi = {10.3390/w16010086},
}
Figure