Detecting river crab and bait using improved YOLOv5s
-
Graphical Abstract
-
Abstract
An accurate and rapid detection is a high demand to identify the river crab and bait in underwater complex environments. In this study, an improved YOLOv5s was proposed to detect the river crab and bait for the high precision, speed and simple modeling. GhostNet and GhostBottleneck structure were used to rapidly extract the network features of the model. The inference and detection speed were improved with the less complexity and amount of model computation. The model was deployed on the Android, in order to meet the needs of mobile application scenarios for river crab detection. The BiFPN structure was applied in the neck network of YOLOv5s. The fusion ability of the model was enhanced for different scale targets, the robustness of the model, and especially the detection performance of the network for small targets. A lightweight attention mechanism was used in the backbone feature extraction of the YOLOv5s network. The CA attention mechanism module was employed to improve the detection probability of the target region. The relevant feature information was matched with the target channel. The invalid information was suppressed to strengthen the network attention to river crab and bait. The lightweight YOLOv5s-GhostNet model was compared with the YOLOv5s, ShuffleNetv2-YOLOv5s, and MobileNetV3-YOLOv5s models. The results showed that the target average precision of YOLOv5s-GhostNet model was reduced by only 4.6 percentage points, compared with YOLOv5s. The lightweight network was effectively maintained the detection precision of the model for the higher detection speed of river crabs and bait. Ablation experiments were carried out to verify the backbone feature extraction network, feature fusion network BiFPN, and CA attention mechanism. The computational amount was reduced by 48.7%, whereas, the detection speed increased by 27.2%, after improving the backbone feature extraction network with GhostNet. The model complexity was reduced to elevate the detection speed. The BiFPN structure was used to compensate for the loss of mAP that caused by the lightweight network, particularly for the detection rate of river crabs and bait. The addition of CA attention mechanism was improved the anti-interference and feature extraction, while the mAP also increased. River crab and bait datasets were established using laboratory and actual crab pond environments. The improved model was achieved in an average precision of 96.9% and a computational volume of 8.5 GFLOPs, which was higher in the detection precision and smaller in computational volume, compared with the current mainstream single-level target detection algorithms for anchor boxes (e.g., SSD and YOLOv3). The average precision of the model was improved by 2.2 percentage points, while the computation and model memory were reduced by more than 40%, compared with YOLOv5s. The model before and after improvement was deployed to Android phone for testing. It was found that the improved model shared the average detection speed of 148ms/frame on Android phone, which increased by 20.9%, and maintained the better detection, compared with the original. The detection rates of river crabs and bait in the improved model increased by 4.6 and 5.8 percentage points, respectively, which was effectively improved the detection rates than before. Therefore, the improved model can be expected to balance the performance requirements of Android phone for model detection precision and speed. The finding can provide the guidance for the precise determination of baiting amount in river crab culture.
-
-