Abstract: In the current field of face recognition, learning facial features with small intra-class variations and large interclass differences is crucial. Recent research has predominantly focused on enhancing the discriminative power of face models by incorporating fixed margin penalties into commonly used classification losses such as softmax loss, as seen in methods like Cosface and Arcface. However, when confronted with the challenges posed by noise and uncertainties in real-world data, conventional fixed-margin penalty methods may prove inadequate. Therefore, this paper introduces a novel loss named AwmFace, which uniquely addresses the effective learning of challenging samples encountered in face recognition tasks. AwmFace leverages the cosine angles between deep features and their corresponding weights to dynamically adjust margin penalties, allowing the model to capture complex features in the data more sensitively. By imposing additional strengthened margin penalties on challenging samples, AwmFace significantly enhances the model’s discriminative capacity towards these samples, thereby improving robustness and performance in real-world datasets. Our experiments on 9 mainstream benchmark tests have shown that our AwmFace performs significantly on 6 of the test sets. These results showcase the substantial improvement of our proposed AwmFace over fixed-margin penalty methods, consequently achieving state-of-the-art face recognition performance.