In order to solve the problems of false alarms,missed alarms and low confidence of SAR ship detection in complex back-grounds,small ship targets and large difference in the size of target ships,a SAR ship detection algorithm based on the improve-ment of the switchable null convolution is proposed.By improving the convolution in the ELAN layer to switchable null convolution and adding the channel attention mechanism to expand the sensory field of the convolution layer,the feature information of different layers in the network is efficiently aggregated;a fast weighted feature fusion AIFI module is added at the neck feature fusion to im-prove the efficiency and reduce the redundant computation of the model;and a focusing mechanism is introduced by the construc-tion of a gradient gain computation method at the loss function.The algorithm improves the model's ability to detect small targets.This algorithm improves the ability of the model to detect small targets and solves the problem of false and missed alarms in complex backgrounds.The improved switchable null convolutional model is validated by using the SSDD dataset,and compared with the benchmark YOLO-7 model before the improvement,the improved mAP value reaches 96.59%compared with the benchmark mod-el,which is an increase of 9.33%,while the accuracy and recall are increased by 3.81%and 16.36%,respectively.The experi-mental results show that the improved algorithm effectively improves the detection accuracy of ship targets and significantly improves the false alarm and missed alarm problems in small target detection.