CAMRI Loss: Improving the Recall of a Specific Class without Sacrificing Accuracy

Daiki Nishiyama, Kazuto Fukuchi, Youhei Akimoto, Jun Sakuma

Abstract

In many high-stakes classification tasks, such as autonomous driving or medical diagnosis, the recall of specific critical classes is often more important than overall accuracy. Traditional methods like threshold tuning or Weighted Cross-Entropy (WCE) typically improve recall at the expense of general performance. This paper introduces Class-sensitive Additive Angular Margin (CAMRI) Loss, which applies an additive angular margin specifically to a target class. By geometrically compacting the feature space of the priority class, CAMRI increases its separation from others. Empirical evaluations on CIFAR-10, GTSRB, and AwA2 demonstrate that CAMRI significantly boosts target class recall without degrading overall model accuracy.

Introduction

Standard multiclass classification models usually treat every class as equally important. However, in real-world scenarios, misidentifying a "Stop" sign as another sign can have fatal consequences. When a model needs to be extra sensitive to a specific class, practitioners often turn to threshold tuning or Weighted Cross-Entropy (WCE). Threshold tuning is a zero-sum game where increasing recall for one class almost always reduces the accuracy of others. WCE, while helpful, simply shifts the decision boundary without making the underlying features more distinct.

Methods: The Geometry of CAMRI Loss

CAMRI Loss builds upon angular margin losses, such as ArcFace, which are widely used in face recognition. These methods evaluate the angle between a data point's feature vector and the "ideal" vector for that class.

The core innovation of CAMRI is applying an additive angular margin only to the important class. Geometrically, this forces the neural network to map examples of the target class into a much tighter, more compact "cone" in the feature space. This increased intraclass compactness naturally creates a larger margin between the target class and all other classes. Unlike WCE, which "shifts a fence" and risks encroaching on neighbors, CAMRI "shrinks the house," gaining safety margin without sacrificing the representational capacity of other classes.

Decision boundaries of various loss functions. CAMRI (d) creates a tighter, more distinct feature space for the target class compared to standard Cross-Entropy (a) or Weighted Cross-Entropy (b).

Experimental Results

The researchers evaluated CAMRI Loss across three benchmarks: CIFAR-10, the German Traffic Sign Recognition Benchmark (GTSRB), and Animals with Attributes 2 (AwA2).

Key Findings

  • GTSRB: Targeting the second-worst performing class, CAMRI improved recall by 9% compared to standard Cross-Entropy, with no loss in overall accuracy.
  • Superiority over WCE: In the majority of experimental cases, CAMRI achieved higher recall improvements than WCE while maintaining equivalent accuracy levels.
  • Class Difficulty: The benefits of CAMRI are most pronounced when the baseline recall is low. If a class is inherently difficult or confusing, the margin helps significantly more than for classes that are already easy to learn.
Performance comparison on the AwA2 dataset for "beaver" and "moose" classes. CAMRI demonstrates superior recall improvements while maintaining competitive accuracy compared to baseline methods.

Discussion and Limitations

While CAMRI is a powerful tool for the final layer of a network, some limitations remain. In the AwA2 dataset, certain classes like "mouse" remained difficult to improve due to inherent image quality issues (small, blurry subjects) rather than the loss function itself. Additionally, CAMRI requires tuning hyperparameters such as the margin ($m$) and temperature scale ($s$). Future work may explore how to design feature representations in deeper layers of the network to achieve even better separation.

Conclusion

CAMRI Loss provides a robust framework for prioritizing specific classes in multiclass classification. By focusing on intraclass compactness for target classes, it breaks the traditional trade-off between specific recall and overall accuracy, making it an ideal candidate for safety-critical machine learning applications.

Summary updated

Abstract

In real-world applications of multi-class classification models, misclassification in an important class (e.g., stop sign) can be significantly more harmful than in other classes (e.g., speed limit). In this paper, we propose a loss function that can improve the recall of an important class while maintaining the same level of accuracy as the case using cross-entropy loss. For our purpose, we need to make the separation of the important class better than the other classes. However, existing methods that give a class-sensitive penalty for cross-entropy loss do not improve the separation. On the other hand, the method that gives a margin to the angle between the feature vectors and the weight vectors of the last fully connected layer corresponding to each feature can improve the separation. Therefore, we propose a loss function that can improve the separation of the important class by setting the margin only for the important class, called Class-sensitive Additive Angular Margin Loss (CAMRI Loss). CAMRI loss is expected to reduce the variance of angles between features and weights of the important class relative to other classes due to the margin around the important class in the feature space by adding a penalty to the angle. In addition, concentrating the penalty only on the important classes hardly sacrifices the separation of the other classes. Experiments on CIFAR-10, GTSRB, and AwA2 showed that the proposed method could improve up to 9% recall improvement on cross-entropy loss without sacrificing accuracy.
BibTeX
@article{nishiyama2023camri,
  author = {Daiki Nishiyama and Kazuto Fukuchi and Youhei Akimoto and Jun Sakuma},
  title = {{CAMRI Loss: Improving the Recall of a Specific Class without Sacrificing Accuracy}},
  journal = {IEICE Trans. Information and Systems},
  year = {2023},
  doi = {10.1587/transinf.2022edp7200},
}
Figure