Underwater object detection and classification pose significant challenges due to environmental factors such as water turbidity and variable lighting conditions. This research proposes a novel approach that integrates advanced imaging techniques with diffusion models to address these challenges effectively, aligning with Sustainable Development Goal (SDG) 14: Life Below Water. The methodology leverages the Convolutional Block Attention Module (CBAM), Modified Swin Transformer Block (MSTB), and Diffusion model to enhance the quality of underwater images, thereby improving the accuracy of object detection and classification tasks. This study utilizes the TrashCan dataset, comprising diverse underwater scenes and objects, to validate the proposed method’s efficacy. This study proposes an advanced imaging technique YOLO (you only look once) network (AIT-YOLOv7) for detecting objects in underwater images. This network uses a modified U-Net, which focuses on informative features using a convolutional block channel and spatial attentions for color correction and a modified swin transformer block for resolution enhancement. A novel diffusion model proposed using modified U-Net with ResNet understands the intricate structures in images with underwater objects, which enhances detection capabilities under challenging visual conditions. Thus, AIT-YOLOv7 net precisely detects and classifies different classes of objects present in this dataset. These improvements are crucial for applications in marine ecology research, underwater archeology, and environmental monitoring, where precise identification of marine debris, biological organisms, and submerged artifacts is essential. The proposed framework advances underwater imaging technology and supports the sustainable management of marine resources and conservation efforts. The experimental results demonstrate that state-of-the-art object detection methods, namely SSD, YOLOv3, YOLOv4, and YOLOTrashCan, achieve mean accuracies (
[email protected]) of 57.19%, 58.12%, 59.78%, and 65.01%, respectively, whereas the proposed AIT-YOLOv7 net reaches a mean accuracy (
[email protected]) of 81.4% on the TrashCan dataset, showing a 16.39% improvement. Due to this improvement in the accuracy and efficiency of underwater object detection, this research contributes to broader marine science and technology efforts, promoting the better understanding and management of aquatic ecosystems and helping to prevent and reduce the marine pollution, as emphasized in SDG 14.