Aiming at the problems of low contrast, heavy noise and color deviation in underwater images, using Generative Adversarial Network (GAN) model as the core framework, a new underwater image enhancement model was proposed based on GAN, namely SwinGAN (GAN based on Swin Transformer). Firstly, the generative network was designed according to the encoder-bottleneck-decoder structure, where the input feature maps were divided into multiple non-overlapping local windows at the bottleneck layer. Secondly, a Dual-path Window Multi-head Self-Attention mechanism(DWMSA) was introduced to enhance local attention while simultaneously capturing global information and long-range dependencies. Finally, the decoder recombined the multiple windows back into the original size feature maps, and the discriminator network employed a Markov discriminator. Compared to the URSCT-SESR model, SwinGAN model shows an improvement of 0.837 2 dB in Peak Signal-to-Noise Ratio (PSNR) and 0.003 6 in Structural SIMilarity index (SSIM) on the UFO-120 dataset. On the EUVP-515 dataset, SwinGAN model achieves more significant improvement, with a 0.843 9 dB boost in PSNR, an increase of 0.005 1 in SSIM, an enhancement of 0.112 4 in Underwater Image Quality Measure (UIQM), and a slight increase of 0.001 0 in Underwater Color Image Quality Evaluation (UCIQE). Experimental results demonstrate that the SwinGAN model excels in both subjective and objective evaluation metrics, achieving notable improvements in correcting color deviation in underwater images.