LogicNet: A Logical Consistency Embedded Face Attribute Learning Network

Haiyu Wu, Sicong Tian, Huayu Li, Kevin W. Bowyer

Abstract

Ensuring logical consistency in predictions is a crucial yet overlooked aspect in multi-attribute classification. We explore the potential reasons for this oversight and introduce two pressing challenges to the field: 1) How can we ensure that a model, when trained with data checked for logical consistency, yields predictions that are logically consistent? 2) How can we achieve the same with data that hasn't undergone logical consistency checks? Minimizing manual effort is also essential for enhancing automation. To address these challenges, we introduce two datasets, FH41K and CelebA-logic, and propose LogicNet, an adversarial training framework that learns the logical relationships between attributes. Accuracy of LogicNet surpasses that of the next-best approach by 23.05%, 9.96%, and 1.71% on FH37K, FH41K, and CelebA-logic, respectively. In real-world case analysis, our approach can achieve a reduction of more than 50% in the average number of failed cases compared to other methods.

Introduction

In multi-attribute facial classification, models are typically trained to predict labels such as "Mustache," "No Beard," or "Wearing Hat" independently. However, these attributes possess inherent logical relationships. For instance, if a model predicts "No Beard" as true, it is logically impossible for "Goatee" or "Mustache" to also be true.

Existing models often ignore these constraints, leading to logically inconsistent results. This creates an "illusion of accuracy" where standard metrics are misleading; a model might achieve high standard accuracy while producing nonsensical attribute combinations. When inconsistent predictions are counted as incorrect, the performance of standard state-of-the-art models often plummets.

Figure 1: Comparison of regular accuracy versus logical consistency-checked accuracy for two models.

Methodology: The LogicNet Framework

LogicNet addresses these challenges by embedding logic directly into the learning process through an adversarial training framework, rather than relying on post-processing "fixes."

Adversarial Training

The system employs a classifier and a discriminator. The classifier predicts attributes, while the discriminator acts as a "logic judge," distinguishing between logically consistent and inconsistent label sets. This competition forces the classifier to internalize the underlying relationships between attributes to successfully "fool" the discriminator.

Figure 4: The LogicNet architecture, featuring a classifier, a discriminator, and the Bag of Labels (BoL) poisoning module.

Bag of Labels (BoL) Poisoning

To train the discriminator effectively, it requires examples of logically impossible combinations. The BoL algorithm automatically "poisons" ground truth labels—for example, by adding a "mustache" label to a "clean-shaven" face—to provide a diverse set of negative examples. This "negative teaching" is vital for the model to learn the boundaries of physical and logical possibility.

Datasets

The research introduces and utilizes several key benchmarks:

  • FH37K: A dataset with manually verified logical consistency.
  • FH41K: An extension of FH37K adding 3,712 images to bolster minority classes (e.g., rare facial hair types), ensuring the model learns more than just common attributes.
  • CelebA-logic: A "cleaned" version of the standard CelebA validation and test sets, manually corrected to follow strict logical rules for more rigorous testing.

Results and Discussion

LogicNet demonstrates a significant leap in performance when logical consistency is enforced. It outperformed the next-best approach by 13.36% on FH37K, 9.96% on FH41K, and 1.01% on CelebA-logic. Furthermore, real-world case analysis showed a reduction in the average number of "failed cases" (logically inconsistent sets) by more than 50% compared to other methods.

Despite the adversarial setup, LogicNet is computationally efficient, requiring less training time than alternative methods like "Semantic Loss" or "Constrained Loss."

Conclusion

LogicNet proves that embedding logical constraints into a network's weights is more effective and computationally cheaper at inference time than traditional post-processing. While a gap remains between raw and consistency-checked accuracy, this framework provides a robust foundation for teaching AI "common sense" in attribute classification. Future work may focus on models that can autonomously discover these logical rules from raw data.

Summary updated

Abstract

Ensuring logical consistency in predictions is a crucial yet overlooked aspect in multi-attribute classification. We explore the potential reasons for this oversight and introduce two pressing challenges to the field: 1) How can we ensure that a model, when trained with data checked for logical consistency, yields predictions that are logically consistent? 2) How can we achieve the same with data that hasn't undergone logical consistency checks? Minimizing manual effort is also essential for enhancing automation. To address these challenges, we introduce two datasets, FH41K and CelebA-logic, and propose LogicNet, an adversarial training framework that learns the logical relationships between attributes. Accuracy of LogicNet surpasses that of the next-best approach by 23.05%, 9.96%, and 1.71% on FH37K, FH41K, and CelebA-logic, respectively. In real-world case analysis, our approach can achieve a reduction of more than 50% in the average number of failed cases compared to other methods.
BibTeX
@inproceedings{wu2025logicnet,
  author = {Haiyu Wu and Sicong Tian and Huayu Li and Kevin W. Bowyer},
  title = {{LogicNet: A Logical Consistency Embedded Face Attribute Learning Network}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2025},
  url = {https://openreview.net/forum?id=zt1pZ35hFu},
}
Figure