The existing underwater image enhancement methods based on deep learning have achieved good results in synthetic underwater images. However,due to the large gap between the simplified synthetic image and the complicated real image,the performance of learning based methods will be significantly degraded when dealing with real images. To solve the problem,a joint underwater image generation and removal(JUIGR)method is proposed. This method adopts the decomposition idea to decompose the underwater image into a clean background layer and a degraded layer. The background is better restored through cyclic consistency loss and adversarial loss,and then the transformation between the real image and the synthetic image is realized,which not only corrects the color,but also improves the image contrast,so as to achieve a good enhancement effect. Extensive experimental results show that the proposed method is superior to the existing methods in terms of color,texture detail and clarity on the real underwater image dataset.