Deep embedding learning aims to learn discriminative feature representations through a deep convolutional neural network model. Commonly, such a model contains a network architecture and a loss function. The architecture is responsible for hierarchical feature extraction, while the loss function supervises the training procedure with the purpose of maximizing inter-class separability and intra-class compactness. By considering that loss function is crucial for the feature performance, in this paper we propose a new loss function called soft margin loss (SML) based on a classification framework for deep embedding learning. Specifically, we first normalize the learned features and the classification weights to map them into the hypersphere. After that, we construct our loss with the difference between the maximum intra-class distance and minimum inter-class distance. By constraining the distance difference with a soft margin that is inherent in the proposed loss, both the inter-class discrepancy and intra-class compactness of learned features can be effectively improved. Finally, under the joint training with an improved softmax loss, the model can learn features with strong discriminability. Toy experiments on MNIST dataset are conducted to show the effectiveness of the proposed method. Additionally, experiments on re-identification tasks are also provided to demonstrate the superior performance of embedding learning. Specifically, 65.48% / 62.68% mAP on CUHK03 labeled / detected dataset (person re-id) and 74.36% mAP on VeRi-776 dataset (vehicle re-id) are achieved respectively. INDEX TERMS Soft margin loss, deep embedding learning, feature representation, person re-identification, vehicle re-identification. JIEHAO LIU received a Bachelor's degree in Electronics and Information Engineering from Guangzhou University in 2019. He is currently a master degree candidate in the School of Electronics and Communication Engineering, Guangzhou University. His research interests include face recognition and person reidentification. LI WANG received a Bachelor's degree in Electronic Engineering from Southeast University, China, in 2009 and received a Ph. D. degree in Physical Electronics from Southeast University, China, in 2015. He is now working in the School of Electronics and Communication Engineering, Guangzhou University. His research interests include brain-computer interfaces, biomedical signal processing, pattern recognition, etc. SAI ZHAO received the Ph. D degree in communication and information system from Sun Yat-Sen University (SYSU), Guangzhou, China, in 2015, and the Master and Bachelor degrees in Communication Engineering from Central South University, Changsha, China, in 2006 and 2003, respectively. She is currently a lecture in the School of Electronics and Communication Engineering, Guangzhou University. Her current research interests include machine learning in wireless communication, convex optimization, physical layer security and non-orthogonal multiple access.