For satellite remote sensing image, ship detection is affected by factors such as cloud, weather and sea clutter, and there are problems such as high false alarm rate and missed detection rate. A deep neural network (DT-YOLO) for real-time detection of surface ships in unmanned aerial vehicle (UAV) aerial photography is proposed. DT-YOLO firstly improves the traditional YOLOv3 algorithm by constructing a deep neural network using densely connected modules and transition modules to extract ship features and designs five different scale convolution feature maps. After upsampling, they are merged with the corresponding scale feature maps to form a multi-scale feature pyramid to perform ship prediction tasks. Then the k-means algorithm is used to cluster the target frame dimensions, determine the target frame parameters, and improve the positioning accuracy of the model; In the detection network, the non-maximum suppression algorithm (NMS) is optimized by attenuating the confidence score linearly, which effectively mitigates the problem of mutual occlusion detection of ships. Finally, the self-constructed sea surface ship dataset is established to test the performance of the algorithm in different scenes by using multi-scale training and data enhancement strategies. The results show that the proposed method improves the detection accuracy under the premise of ensuring real-time performance, especially in the detection of larger targets and mutually occluded ships.