In marine safety and security, the ability to rapidly, autonomously, and accurately detect and identify ships is the highest priority. This study presents a novel approach using deep learning to accurately identify ships based on their International Maritime Organisation (IMO) numbers. The performance of various sophisticated deep learning models, such as YOLOv8, RetinaNet, Faster R-CNN, EfficientDet, and DETR, was assessed in accurately identifying IMO numbers from images. The RetinaNet and Faster R-CNN models achieved the highest mAP50-95 scores of 70.0% and 64.1%, respectively, with inference times of low scale. On the other hand, YOLOv8, with a slightly better mAP50-95 of 65.1%, showed an exceptional balance between accuracy and speed (9.20 ms), making it well-suited for real-time applications. However, models like EfficientDet and DETR experienced difficulties achieving lower mAP50-95 values of 33.65% and 48.7%, respectively, especially when analysing low-resolution images. Following detection, the Enhanced Super-Resolution Generative Adversarial Network (ESRGAN) was used to improve the clarity of extracted IMO digits. It is followed by applying Easy Optical Character Recognition (EasyOCR) for accurate extraction. Despite the enhancements, minor identification errors continued, suggesting a requirement for additional refinement. These findings reveal the capacity of deep learning to significantly augment maritime security by enhancing the efficiency and precision of ship identification.