Typical maritime monitoring scenarios are usually constrained by factors such as multi-scale ship density, frequent motion overlap, and limited viewing angle of shore-based cameras. These challenges often lead to trajectory interruptions and identity mismatches in target detection and multi-target tracking tasks. In order to solve these problems, this study proposes a ship occlusion detection and tracking method based on the improved YOLOv8 model and further integrates an automatic identification system (AIS) trajectory reasoning. The method builds a unified perception framework with enhanced detection architecture, multi-source data fusion, and behavioral reasoning capabilities. First, in the target detection module, the improved SEConv structure is introduced into the YOLOv8 trunk network to address challenges caused by small-scale variations and severe occlusion in maritime scenes. The ReLU activation function in SEConv is replaced by the Swish activation function to enhance the nonlinear feature representation. In addition, the optimized SEConv is embedded in the C2f structure, and the convolutional block attention module (CBAM) attention mechanism is introduced to enhance the sensitivity of the model to the occlusion area. Next, for multi-target tracking, ByteTrack is used as the basic tracking framework. AIS trajectory data is introduced as auxiliary input to compensate for trajectory losses caused by occlusion. Finally, experimental results on the SeaShips public dataset and the self-built occlusion reference dataset show that the improved YOLOv8 detector achieves stable mAP gains in mild, moderate, and severe occlusion scenarios. The AIS enhanced tracking system improves the multi-target tracking accuracy (MOTA) and identification F1 score (IDF1) by about 6.3% and 8.1%, respectively, and the average occlusion reconstruction error is controlled within 1.4 seconds. The proposed method effectively enhances the perception ability of ships in complex occlusion environments and verifies the feasibility and superiority of the strategy of combining visual detection with AIS data assistance.