An optimization method of multiscale storage tank target detection introducing an attention mechanism

Wenjia Sun,Chunchun Hu,Nianxue Luo,Qiansheng Zhao
DOI: https://doi.org/10.1080/10106049.2024.2339304
IF: 3.45
2024-06-02
Geocarto International
Abstract:Under the combined action of the expansion of the chemical industry zone and urban boundaries, urban areas exposed to danger are also increasing. As containers for chemical storage, storage tanks are potential sources of hazards. Conducting target detection for hazard risk analysis is essential. YOLOv5, a single-stage algorithm with good performance, accurately identifies most storage tanks with clear contours and evident positions; however, the identification effect is not good for storage tanks with small targets or unclear boundaries. This study proposes an optimized model based on the YOLOv5 model. First, the Coordinate Attention (CA) mechanism is introduced to make the model focus on the effective information of the target. Second, to improve the detection effect of small targets, the model adds a small target detection head and performs multiscale target detection. Finally, the EIOU loss function is employed instead of the CIOU loss function in the original model to improve the algorithm's accuracy and speed. Experimental results show that the optimized model significantly improves the detection effect on small targets compared with the original YOLOv5 model. The number of small targets detected by the optimized model is significantly increased compared with the original model, and the size of the smallest targets detected by the optimized model is reduced by about twice compared with the original model. The model's accuracy, recall rate, and mean average precision (mAP@0.5) are improved, which can be better applied to the detection of storage tanks.
geosciences, multidisciplinary,environmental sciences,remote sensing,imaging science & photographic technology
What problem does this paper attempt to address?
The problem that this paper attempts to solve is the poor recognition effect on small targets or targets with unclear boundaries in multi - scale storage tank object detection. Specifically, the paper points out that although YOLOv5 performs well in single - stage algorithms and can accurately identify most storage tanks with clear contours and obvious positions, the recognition effect on small targets or storage tanks with blurred boundaries is not ideal. Therefore, the paper proposes an optimization method based on the YOLOv5 model. By introducing the attention mechanism (especially the coordinate attention mechanism), adding a small - target detection head, and using the EIOU loss function to replace the CIOU loss function in the original model, the detection effect of these small targets or targets with blurred boundaries is improved. ### Main contributions of the paper 1. **Introduction of the coordinate attention mechanism (CA Mechanism)** - The coordinate attention mechanism (CA) is introduced, enabling the model to focus more on the effective information of the target. This helps to improve the detection ability of small targets or targets with blurred boundaries in complex scenes. - The formulas are as follows: \[ Z_h(c, h)=\frac{1}{w}\sum_{i = 0}^{w}X(c, h, i) \] \[ Z_w(c, w)=\frac{1}{H}\sum_{j = 0}^{H}X(c, j, w) \] \[ f = d(F_1(Z_h, Z_w)) \] \[ g_h=\sigma(F_h(f_h)) \] \[ g_w=\sigma(F_w(f_w)) \] \[ y(c, i, j)=x(c, i, j)\cdot g_h(c, i)\cdot g_w(c, j) \] 2. **Addition of a small - target detection head** - Based on the original YOLOv5 model, a small - target detection head is added to improve the detection effect on small targets. Through two up - sampling operations, a 160×160 feature map is obtained and fused with the second - layer feature map of the backbone network. Finally, four detection heads are formed for multi - scale object detection. 3. **Improvement of the loss function** - The EIOU loss function is used to replace the CIOU loss function in the original model to further improve the accuracy and speed of the model. The formula of the EIOU loss function is as follows: \[ L_{\text{EIOU}} = 1-\text{IOU}+\frac{q^2(b, b_{\text{gt}})}{c^2}+\frac{q^2(w, w_{\text{gt}})}{C_w^2}+\frac{q^2(h, h_{\text{gt}})}{C_h^2} \] where \( C_w \) and \( C_h \) represent the width and height of the minimum circumscribed rectangle covering the predicted box and the ground - truth box respectively. ### Experimental results The experimental results show that the optimized model is significantly superior to the original YOLOv5 model in small - target detection. This is specifically manifested in the following aspects: - **Increase in the number of small - target detections**: The number of small targets detected by the optimized model has increased significantly, and the size of the smallest target has been approximately reduced by half. - **Improvement in performance indicators**: The optimized model has improved in terms of precision, recall, and mean average precision (mAP@0.5), and can be better applied to the storage tank detection task. In summary, through the introduction of the coordinate attention mechanism, the addition of a small - target detection head, and the improvement of the loss function, this paper effectively solves the problem of poor recognition effect on small targets or targets with blurred boundaries in multi - scale storage tank object detection.