Constraint-Based Visual Generation

Giuseppe Marra, Francesco Giannini, Michelangelo Diligenti, Marco GoriICANN 2018 · DOI

Abstract

In the last few years the systematic adoption of deep learning to visual generation has produced impressive results that, amongst others, definitely benefit from the massive exploration of convolutional architectures. In this paper, we propose a general approach to visual generation that combines learning capabilities with logic descriptions of the target to be generated. The process of generation is regarded as a constrained satisfaction problem, where the constraints describe a set of properties that characterize the target. Interestingly, the constraints can also involve logic variables, while all of them are converted into real-valued functions by means of the t-norm theory. We use deep architectures to model the involved variables, and propose a computational scheme where the learning process carries out a satisfaction of the constraints. We propose some examples in which the theory can naturally be used, including the modeling of GAN and auto-encoders, and report promising results in problems with the generation of handwritten characters and face transformations.

Introduction

Unsupervised Image-to-Image Translation (UNIT) remains a significant challenge in computer vision. Learning to map one domain to another without paired examples—such as transforming a male face to a female face—is inherently ill-posed due to the infinite number of possible mappings. While Generative Adversarial Networks (GANs) have made strides, they often rely on complex, hand-crafted loss functions to maintain realism and consistency.

This research introduces LYRICS, a framework that bridges high-level logical reasoning and deep learning. By treating visual generation as a constraint satisfaction problem, researchers can use First-Order Logic (FOL) to "program" complex behaviors directly into the training loss, providing a general interface for incorporating prior domain knowledge.

The LYRICS Framework

The core contribution is the LYRICS environment, which allows developers to write high-level logic formulas that are automatically converted into differentiable computational graphs.

Logic as Differentiable Loss

To integrate logic with neural networks, the authors utilize T-Norm Fuzzy Logic (specifically Gödel, Łukasiewicz, and Product t-norms). These map logical connectives like AND ($\wedge$), OR ($\vee$), and IF-THEN ($\Rightarrow$) to algebraic operations producing values between 0 and 1. Logical formulas are treated as constraints, and the training process minimizes a cost function that penalizes violations.

Declarative Cycle Consistency

Instead of manually engineering a "Cycle Loss," LYRICS allows for declarative rules. For instance, cycle consistency can be expressed as: $$\forall x \, Si(x) \Rightarrow gi(gj(x)) = x$$ This states that for any image $x$ in domain $i$, translating it to domain $j$ and back should return the original $x$.

Experimental Results

The approach was evaluated on two primary tasks: MNIST digit translation and CelebA face attribute manipulation.

MNIST Circular Translation

The model learned a circular translation task (0 $\to$ 1 $\to$ 2 $\to$ 0) without direct supervision. Given a digit, logical predicates defined the "next" and "previous" digits in the sequence.

Generated digit '0' under logical constraints.
Generated digit '2' as part of a circular translation sequence.

Face Attribute Translation

On the CelebA dataset, the framework produced high-quality face translations, such as gender swapping and adding eyeglasses. By adding rules specifying that gender translation should not affect other attributes (like eyeglasses), the model achieved stable multi-attribute generation through a shared latent space.

Conclusion

LYRICS shifts the focus from engineering complex loss functions to programming desired behaviors using human-readable logic. While the paper focuses on expressiveness rather than benchmark-breaking quantitative metrics, it demonstrates a powerful method for multi-domain extension and attribute composition. Future work will explore more complex logical structures and applications in non-visual domains like text.

Summary updated

BibTeX
@inproceedings{marra2018constraint,
  author = {Giuseppe Marra and Francesco Giannini and Michelangelo Diligenti and Marco Gori},
  title = {{Constraint-Based Visual Generation}},
  booktitle = {ICANN},
  year = {2018},
  doi = {10.1007/978-3-030-30508-6\_45},
}
Figure