Deep learning with hard logical constraints
Keywords: requirements
logical constraints
deep learning
safe-AI
neuro-symbolic AI

Deep learning is becoming increasingly ubiquitous and thanks to its successes, it is likely to be applied in almost every aspect of our lives in the next few years. Its success stories however overshadow the dangers that come with its careless application in the real world. Indeed, even if deep learning models report astonishingly high-performance in terms of accuracy (or any other chosen metric), they do not give any guarantees that the model will not have any unintended behaviour when used in practice. This is particularly dangerous in safety-critical applications, where even a single unforeseen mistake can have severe consequences. Further, with each wrong move, human confidence in this technology falters, slowing down its adoption. Thus, it is extremely important to improve the trustworthiness of these models by reducing, if not completely ruling out, all unintended behaviors.
In this thesis, I address the problem of how to build deep learning based models able to (i) guarantee the satisfaction of a given set of requirements, which state the correct behaviour of the model, and (ii) learn from the background knowledge specified in the requirements themselves to improve performance. In particular, I focus on (i) deep learning models for multi-label classification problems, and (ii) requirements modelled as hard logical constraints. In order to achieve such a goal, I started by considering multi-label classification problems with hierarchical constraints, and then incrementally increased the expressivity of the constraints.
In the first phase of the project, I focused on hierarchical multi-label classification problems, which are multi-label classification problems with hierarchical constraints over the output space of the form A1→A expressing that A1 is a subclass of A. For such problems, I developed a novel model, C-HMCNN{h}, which, given a network h for the underlying multi-label classification problem, exploits the hierarchy information to produce predictions guaranteed to satisfy the hierarchy constraints and to improve over h's performance.
In the second phase of the project, I considered constraints expressed as normal logic rules, i.e., expressions of the form A1,…,Ak,¬Ak+1,…,¬An→A. This expression imposes that whenever the classes A1,…,Ak are predicted, while Ak+1,…,An are not, then the class A should be predicted. For this problem I developed CCN{h}, which is an extension of C-HMCNN{h}. This model, given a network h for the underlying multi-label classification problem, is able to (i) produce predictions guaranteed to satisfy the constraints, and (ii) exploit the information contained in the constraints to improve performance.
Finally, in order to demonstrate the significance of the problem tackled in this thesis, I created the ROad event Awareness Dataset with logical Requirements (ROAD-R), the first publicly available dataset for autonomous driving with requirements modelled as constraints over the output space and expressed as propositional logic formulas. By virtue of creating ROAD-R, I was able to show that the current state-of-the-art models do not learn the requirements from just the data points. My experimental results indicate that more than 90% of their predictions violate the constraints, and that it is possible to exploit the given requirements to create models that (i) have a better performance, and (ii) are guaranteed to be compliant with the given requirements.