Considering light absorbing and scattering problems in connection with wavelength can decrease the visibility, contrast and color distortion of images, we propose a new type of convolutional neural network with two training phases. Firstly, the coordinate attention module is integrated into the residual block of the residual group in the backbone network, which is used to strengthen the feature extraction capability of the network. Secondly, since the unrealistic image colors may degrade the image details, an unsupervised method that combines the physical prior knowledge and the real underwater images is proposed to finetune the backbone network. Furthermore, a model protection mechanism is designed to guarantee the successful execution of the training. The experimental results indicate the proposed model can effectively optimize the contrast, color and image quality of the underwater image. Compared with relevant algorithms, our UCIQE and NIQE are respectively 0.525 and 4.149, which further verifies the superiority of the proposed model.