The intelligent perception ability of the close-range navigation environment is the basis of autonomous decision-making and control of unmanned ships. In order to realize real-time perception of the close-range environment of unmanned ships, an enhanced attention mechanism YOLOv4 (EA-YOLOv4) algorithm is proposed. First of all, on the basis of YOLOv4, the convolutional block attention module (CBAM) is used to search for features in channel and space dimensions, respectively, to improve the model’s feature perception of ship targets. Then, the improved-efficient intersection over union (EIoU) loss function is used to replace the complete intersection over union (CIoU) loss function of the YOLOv4 algorithm to improve the algorithm’s perception of ships of different sizes. Finally, in the post-processing of algorithm prediction, soft non-maximum suppression (Soft-NMS) is used to replace the non-maximum suppression (NMS) of YOLOv4 to reduce the missed detection of overlapping ships without affecting the efficiency. The proposed method is verified on the large data set SeaShips, and the average accuracy rate of mAP0.5–0.95 reaches 72.5%, which is 10.7% higher than the original network YOLOv4, and the FPS is 38 frames/s, which effectively improves the ship detection accuracy while ensuring real-time performance.
Aiming at the problem of high-precision detection of AtoN (Aids to Navigation, AtoN) in the complex inland river environment, in the absence of sufficient AtoN image types to train classifiers, this paper proposes an automatic AtoN detection algorithm Aids-to-Navigation-YOLOv4 (AN-YOLOv4) based on improved YOLOv4 (You Only Look Once, Yolo). Firstly, aiming at the problem of an insufficient number of existing AtoN datasets, the Deep Convolutional Generative Adversarial Networks (DCGAN) is used to expand and enhance the AtoN image dataset. Then, aiming at the problem of small target recognition accuracy, the image pyramid is used to multi-scale zoom the dataset. Finally, the K-means clustering algorithm is used to correct the candidate box of AN-YOLOv4. The test on the test dataset shows that the improvement effect of AN-YOLOv4 is obvious. The accuracy rate of small targets is 92%, and the average accuracy (mAP) of eight different types of AtoN is 92%, which is 14% and 13% higher than the original YOLOv4, respectively. This research has important theoretical significance and reference value for the intelligent perception of the navigation environment under the intelligent shipping system.