The precise interpolation of oceanic temperature and salinity is crucial for comprehending the dynamics of marine systems and the implications of global climate change. Prior neural network-based interpolation methods face constraints related to their capacity to delineate the intricate spatio-temporal patterns that are intrinsic to ocean data. This research presents an innovative approach, known as the Discretized Spatial Encoding Neural Network (DSE-NN), comprising an encoder–decoder model designed on the basis of deep supervision, network visualization, and hyperparameter optimization. Through the discretization of input latitude and longitude data into specialized vectors, the DSE-NN adeptly captures temporal trends and augments the precision of reconstruction, concurrently addressing the complexity and fragmentation characteristic of oceanic data sets. Employing the North Atlantic as a case study, this investigation shows that the DSE-NN presents enhanced interpolation accuracy in comparison with a traditional neural network. The outcomes demonstrate its quicker convergence and lower loss function values, as well as the ability of the model to reflect the spatial and temporal distribution characteristics and physical laws of temperature and salinity. This research emphasizes the potential of the DSE-NN in providing a robust tool for three-dimensional ocean temperature and salinity reconstruction.