ABSTRACT The intricacy of the underwater setting makes it difficult for optical lenses to capture clear underwater photos without haze and colour distortion. Some studies use domain adaptation and transfer learning to address this issue, they aim to reduce the latent mismatch between composition and real-world data, making the space of latent data difficult to read and impractical to control. The background light is a crucial component of the decaying paradigm that directly impacts how well images are enhanced. Thus, to improve the quality of the images over the underwater, new deep-learning techniques are being designed in this paper. Here, the Adaptive Trans-ResUnet++ with Attention Mechanism-based model performs the real-time underwater image enhancement process. In addition, a novel Random Enhanced Artificial Gorilla Troops Optimizer algorithm model is used for optimising the parameters over the given model to further enhance the given model’s performance. A diverse quantitative and qualitative validation is also carried out to learn the enhancement of underwater image quality. The enhanced underwater image may be also useful in the underwater object detection process. Thus, the enhanced images obtained from the developed model are compared with the existing techniques to confirm the efficacy of the suggested underwater image enhancement process.