Localization is a primary concern for wireless sensor networks as numerous applications rely on the precise position of nodes. This paper presents a precise deep learning (DL) approach for DV-Hop localization in the Internet of Things (IoT) using the whale optimization algorithm (WOA) to alleviate shortcomings of traditional DV-Hop. Our method leverages a deep neural network (DNN) to estimate distances between undetermined nodes (non-coordinated nodes) and anchor nodes (coordinated nodes) without imposing excessive costs on IoT infrastructure, while DL techniques require extensive training data for accuracy, we address this challenge by introducing a data augmentation strategy (DAS). The proposed algorithm involves creating virtual anchors strategically around real anchors, thereby generating additional training data and significantly enhancing dataset size, improving the efficacy of DNNs. Simulation findings suggest that the proposed deep learning model on DV-Hop localization outperforms other localization methods, particularly regarding positional accuracy.