This study aims to explore source depth discrimination in shallow water waveguides using a vertical line array. Due to the similarity in physical characteristics of features and environmental parameters, the feature distributions of shallow and deep sources overlap in feature space. This overlap is further exacerbated by strong background noise, reducing detection reliability. Therefore, a deep learning-based source depth discrimination (DL-SDD) scheme is proposed. Specifically, this scheme is based on a residual structure, embedding channel attention mechanisms into the deep structure to eliminate noise-related information gradually. Furthermore, a specially designed loss function considers inter-class and intra-class distances to achieve compact and mutually distant distributions of source features. When this loss function is applied, the overlap of source feature distributions is suppressed in end-to-end feature learning, leading to a high detection probability. The numerical simulations demonstrate that the proposed DL-SDD outperforms traditional method, achieving a 7 % increase in detection probability and a 15 % decrease in false alarm rate, even near the discrimination depth. Furthermore, the discrimination depth is reduced by nearly half. Experimental results from the South China Sea validate the effectiveness of the proposed DL-SDD.