# Bridging Logic Programming and Deep Learning for Explainability through ILASP
**Authors**: Talissa Dreossi
## Bridging Deep Learning and Logic Programming for Explainability through ILP
## Talissa Dreossi
University of Udine Udine, Italy
talissa.dreossi@uniud.it
My research explores integrating deep learning and logic programming to set the basis for a new generation of AI systems. By combining neural networks with Inductive Logic Programming (ILP), the goal is to construct systems that make accurate predictions and generate comprehensible rules to validate these predictions. Deep learning models process and analyze complex data, while ILP techniques derive logical rules to prove the network's conclusions. Explainable AI methods, like eXplainable Answer Set Programming (XASP), elucidate the reasoning behind these rules and decisions. The focus is on applying ILP frameworks, specifically ILASP and FastLAS, to enhance explainability in various domains. My test cases span weather prediction, the legal field, and image recognition. In weather forecasting, the system will predict events and provides explanations using FastLAS, with plans to integrate recurrent neural networks in the future. In the legal domain, the research focuses on interpreting vague decisions and assisting legal professionals by encoding Italian legal articles and learning reasoning patterns from Court of Cassation decisions using ILASP. For biological laboratories, we will collaborate with a research group to automate spermatozoa morphology classification for Bull Breeding Soundness Evaluation using YOLO networks and ILP to explain classification outcomes. This hybrid approach aims to bridge the gap between the high performance of deep learning models and the transparency of symbolic reasoning, advancing AI by providing interpretable and trustworthy applications.
## 1 Introduction
The integration of deep learning and logic programming could be a promising approach to creating more interpretable and robust artificial intelligence systems. My research aims to explore and develop a hybrid framework that leverages the strengths of both paradigms. By combining neural networks with ILP [37, 7], the goal is to construct systems capable of not only making accurate predictions but also generating comprehensible rules that validate these predictions. The proposed framework begins with the application of deep learning models, such as neural networks, to process and analyze complex data. Once the neural network produces an output, ILP techniques will be employed to derive logical rules that substantiate the network's conclusions. We also try to apply ILP directly to the data even if often they are too complex or too wide and this limits the capabilities of ILP systems to learn accurate rules. To further enhance the interpretability and reliability of the system, explainable AI methods in logic programming [21], such as eXplainable Answer Set Programming (XASP) [2], are utilized to elucidate the reasoning behind the derived rules and the decision-making process. I am testing this idea on different fields: weather forecasting, legal judgements and image recognition.
In weather forecasting, accurate predictions are vital for mitigating severe weather impacts, protecting lives, and supporting agriculture, transportation, and disaster management. While traditional methods of weather prediction have greatly benefited from neural networks and deep learning techniques, which offer impressive accuracy, these methods often operate as black boxes, making their predictions hard to
understand. This lack of explainability can undermine user trust, impede validation by domain experts, and hinder model refinement. To address these challenges, the research I am pursuing aims to develop a reliable system capable of predicting weather events while also providing explanations. The idea, that was accepted in LPNMR [18], is to use FastLAS [30] which is able to generate an optimal subset of possible solutions. FastLAS can quickly identify the best-fitting hypotheses, so that we are then able to translate the learned rules in a human readable way, as a meteorologist would do.
Similarly, in the legal domain, AI can address complex issues such as the interpretation of vague legal decisions. In facts, legal argumentation often involves vagueness which originates from semantic indeterminacy even when information is available. This branch of my research, which had a recent publication [12], focuses on that while also trying to construct a tool able to assist judges and lawyers in giving an explanation of the final judgement. In particular, I am using some articles of Italian law to test the outcome. In fact, for instance, according to Italian law, street theft ("furto con strappo") can be classified as either an aggravated form of theft or as robbery ("rapina"), depending on factors such as the presence of violence. To tackle this ambiguity problem, we employ Answer Set Programming (ASP) and ILASP [33]. The relevant articles of the Italian legal code are encoded as a set of ASP rules, while decisions from the Court of Cassation are used to make ILASP learn judges' reasoning patterns.
Finally, AI can be employed to speed up human activities in biological laboratory. Indeed, morphological characteristics of bull spermatozoa are typically assessed visually using bright field microscopy following eosin-nigrosine staining, for the Bull Breeding Soundness Evaluation (BBSE). However, this process is time-consuming and demands experienced personnel to achieve reliable results. Given the increasing adoption of genomic selection schemes for young bulls, whose semen is destined for the artificial insemination industry, there is a growing need for a more standardized technique to analyze semen quality. This need is particularly pressing for evaluating spermatozoa abnormalities that impact semen freezing suitability and fertilizing capacity, which are critical due to the widespread use of frozenthawed semen. Therefore, I am currently developing an AI system for the automated classification of microscope-acquired images of spermatozoa (the study is at the beginning but we are going to present a poster at the European Federation of Animal Science (EEAP) in September). We will employ neural networks, specifically YOLO networks, which can learn and extract relevant features from complex visual data to perform object detection on spermatozoa. This approach will enable us to classify spermatozoa morphology, identifying normal spermatozoa as well as primary and secondary abnormalities. After this initial phase, the plan is to integrate ILP to learn how to identify different morphological characteristics, thereby providing explanations for why specific spermatozoa are classified as abnormal or not.
The contribution is organized as follows: in Section 2 we briefly introduce the concepts of ILP, focusing on ILASP and FastLAS, and of neural networks, deeply on CNNs, RNN and YOLO networks; an overview of the existing literature is reported in Section 3; Section 4 shows the goal of my research and is followed by Section 5 with an view on the current status and results accomplished of the research.
## 2 Background
In this section I am going to explain the main concept that concern my research interests.
## 2.1 Answer Set Programming
Answer Set Programming (ASP) is a declarative programming paradigm born for non-monotonic reasoning and, thanks to the efficiency of ASP solvers, widely used for modeling and solving difficult combinatorial problems. An ASP program is composed by:
- atoms, generally writings of the form p ( a 1 , . . . , an ) , where p is a predicate symbol and ai are constant or variable symbols with i ∈ [ 1 , n ] . Intuitively, such an atom states that the elements represented by a 1 , . . . , an enjoy the property denoted by p ;
- rules r of the form H ← A 1 , . . . , An , not B 1 , . . . , not Bm , where H , Ai , and Bj are atoms of the form p ( t 1 , . . . , tn ) where p is a predicate symbol, t i are constant or variable symbols, and n ≥ 0.
A literal is either an atom A or its default negation not A , i.e., a naf-literal . Rules with empty body are called facts, while rules without a head (corresponding to the case H = false ) are called constraints or denials. If a rule r has not variable symbols, it is said to be ground . Aset of ground atoms S is a stable model of a program P if it is the unique minimum model of the reduct P S of P . The reduct P S is obtained from P by removing all rules whose body is not satisfied by the atoms in S , and removing all naf-literals from the remaining rules [22]. An ASP solver can determine whether a program P has any stable models and, if so, compute the set AS ( P ) of all such models. A key property of stable models is that if an atom A belongs to a stable model S , there must be at least one rule r in the ground version of P whose body is satisfied by S and whose head is A . This rule r provides an explanation for the truth of A , meaning that we not only know A is true, but also the reason for its truth even if multiple alternative explanations exist.
̸
The ASP language supports various syntactic extensions. One notable extension introduces controlled forms of non-determinism in programs, such as choice rules and cardinality constraints . Additionally, built-in atoms of the form E 1 opE 2 (where E 1 and E 2 are expressions with numerical constants, variables, and arithmetic operators, while op ∈ { <, ≤ , = , = , >, ≥} ) can be used in rule bodies to model arithmetic comparisons between numerical expressions. During the grounding phase, the variables in these expressions are replaced by constants, and the expressions are evaluated and replaced by true/false .
## 2.2 Inductive Logic Programming
Inductive Logic Programming (ILP) [37] is a subfield of machine learning that focuses on learning logical rules from examples and background knowledge. The objective is to discover a hypothesis (a set of logical rules) that explains the given examples within the context of the provided background knowledge (a set of rules). Various ILP frameworks have been proposed in the literature [32]. My research is focused on Learning from Answer Sets (LAS), a state-of-the-art ILP framework designed for learning from noisy examples [32].
LAS [33] is a paradigm for learning answer set programs. It is known that in ASP there can be zero or many answer sets of a program. For this reason we can talk about brave entailment ( | = b ) and cautious entailment ( | = a ): an atom a is bravely entailed by a program P if and only if at least one answer set P contains a , while it is cautiously entailed if every answer set contains it. A learning problem in LAS is called a LAS task . Specifically, a LAS task is a tuple T = ⟨ B , SM , E ⟩ , where B is an ASP program known as the background knowledge , SM is a set of rules that form the hypothesis space , and E is the set of examples . To avoid the explicit introduction of a (huge) hypothesis space, it is defined through a mode bias , which consists of a pair of sets of mode declarations ⟨ Mh , Mb ⟩ . Here, Mh (head mode declarations) specify which predicates can appear in the head of a rule, and Mb (body mode declarations) specify which predicates can appear in the body of a rule. A mode declaration is a literal whose arguments are either var ( t ) or const ( t ) , where t is a type. Informally, a literal is compatible with a mode declaration m if it can be constructed by replacing every instance of var ( t ) in m with a variable of type t and every const ( t ) in m with a constant of type t .
Examples in LAS are based on the notion of a partial interpretation . A partial interpretation epi is a pair of sets of ground atoms ⟨ e inc , e exc ⟩ , where e inc and e exc are referred to as the inclusions and exclusions
sets respectively. An interpretation I is said to extend a partial interpretation epi if and only if e inc ⊆ I and e exc ∩ I = / 0. Unlike conventional ILP, the LAS framework allows for context-dependent examples. In real world setting, data are noisy . Noise can be captured by allowing examples to be weighted with a notion of penalty . A weighted context-dependent partial interpretation (WCDPI) e is a tuple ⟨ eid , epen , ecdpi ⟩ , where eid is an identifier for e , epen is a positive integer, called a penalty , ecdpi is a context-dependent partial interpretation. A task is called noisy LAS task when examples are WCDPIs. Formally, a Noisy LAS task is a tuple T noise = ⟨ B , M , E ⟩ where B is an ASP program, SM is the search space, and E is a finite set of WCDPIs. A hypothesis H ⊆ SM is an inductive solution of T noise iff ∀ e ∈ E , B ∪ H accepts e . We denote with T noise the set of all Noisy LAS tasks. If a hypothesis does not accept an example, it pays the penalty , which contributes to the overall cost of the hypothesis. A scoring function S assigns a positive real number as score to any ASP program and noisy task T noise . The goal of a noisy LAS tasks is to find an optimal hypothesis that minimizes the cost over a given hypothesis space and WCDPI examples. Precisely, a hypothesis H is considered the best answer to a noisy LAS task T noise according to S if H solves T noise and no other solution H ′ has a better score than H .
FastLAS [30] is a noisy LAS system. It supports user-defined scoring functions, allowing domainspecific optimisation criteria to be used to bias the search; for example, scoring functions can be used to bias towards the cheapest, least risky, safest or most secure set of rules. Furthermore, continuous data types (such as real numbers) are common in machine learning, but many ILP approaches are unable to deal with such data types (without discretisation). FastLAS supports numeric data types, together with binary comparisons over these types.
On the other hand, ILASP is also a framework designed to learn answer set programs from examples and background knowledge. One of its key features is the ability to handle both noise-free and noisy data, making it robust in real-world applications. It infer new rules forcing positive examples to be extended by at least one answer set, while negative examples have not to be extended by any answer set. ILASP uses a Conflict-Driven ILP (CDILP) process [29] and, unlike FastLAS, it is also able to learn recursive hypotheses, enabling the modeling of complex relationships within the data.
## 2.3 Artificial Neural Networks
Regarding Artificial Neural Networks (ANNs), there are numerous articles and books in the literature from which to retrieve information. Therefore, we will cite just the work of Lecun et al. [34] and the survey of Dong et al. [11]. ANN is a computational model inspired by biological neural networks. It is composed by interconnected neurons, functioning as processing units, and connections with adjustable weights. Through training algorithms, these weights are tuned based on input data, ending in a discriminating function capable of classifying various inputs. The network's structure, as its biological counterpart, evolves during training and recall phases to optimize classification performance. Every network is constructed by layers of neurons. While the basic concept of ANNs involves interconnected layers of neurons that process and learn from data, various specialized architectures have been developed to address specific types of tasks and data structures more effectively. In this section, we will give a brief description of Convolutional Neural Network (CNN), Recurrent Neural Network (RNN), and finally You Only Look Once Network (YOLO).
CNN Convolutional Neural Networks (CNNs) are primarily designed for processing structured grid data, such as images. They are particularly effective for image recognition, classification, and segmentation tasks. The convolutional layer is the core building block of a CNN. It applies a set of filters (or kernels ) to the input image, which slide across the width and height of the input. This operation produces a feature map that highlights the presence of certain features in the input, such as edges, textures, or pat-
terns. During this process, the filter performs element-wise multiplication with the pixel values within the patch.
Recurrent Neural Network Recurrent Neural Networks (RNNs) are particularly well-suited for sequence modeling tasks. Unlike traditional feedforward neural networks, which process inputs independently, RNNs have an internal memory that allows them to capture temporal dependencies in sequential data. Their basic architecture consists of three main components: input (at each time step t , the RNN layer receives an input vector x ( t ) , representing the input at that time step); hidden State (the RNN layer maintains a hidden state vector h ( t ) that encapsulates the network's memory of past inputs up to time step t ); recurrent connection (at each time step, the RNN computes the hidden state h ( t ) based on the current input x ( t ) and the previous hidden state h ( t -1 ) ); output (the RNN layer may produce an output y ( t ) at each time step).
YOLO You Only Look Once (YOLO) is a state-of-the-art, real-time object detection algorithm introduced in 2015 by Redmon et al. [40]. Unlike traditional object detection methods that use a sliding window approach or region proposal networks, YOLO treats object detection as a single regression problem, directly predicting class probabilities and bounding box coordinates from the entire image in one evaluation. Mathematically, YOLO divides an input image into an S × S grid. Each grid cell is responsible for predicting B bounding boxes and their corresponding confidence scores. Each bounding box prediction consists of five components: ( x , y , w , h , confidence ) . x , y , w and h correspond to the coordinates and dimensions of the box, while confidence score [25] indicates how likely the box contains an object and how accurate the box is.
## 3 Related Works
In this section, it is explored the state-of-art and the related works in each field relevant to my research.
Concerning weather prediction, traditional methods such as numerical weather prediction models [26], supplemented by statistical and machine learning models [39, 36, 42, 43, 35], achieve high accuracy. However, understanding models like neural networks remains challenging. Explainable AI (XAI) techniques are being developed to address this issue. For instance, Labe et al. [28] used XAI with ANNs to explain rising summer temperatures in the USA. The idea of my research is, instead, to use ILP since it is able to give explainable results. I am specifically interested in ILASP, which have been already exploited in many study [31] and FastLAS [3, 8]. FastLAS, effective in prioritizing specific rules over general ones [20], has also been integrated with neural networks [9]. Within methods providing explainability, Alviano et al. [2] and Cabalar et al. [4] contributed with some methods such as XASP.
In the legal field, Allen [1] pioneered legal document interpretation using symbolic logic. Then, Kowalski and Sergot [27] classified legal rules, applying logic programming to model British laws. Golshani [23] emphasized argument construction in automated legal reasoning while a more recent work by Sartor et al. [41] utilized Logical English and top-down ASP solvers for legal encoding.
In image recognition, the YOLO network [40] excels in real-time object detection, such as applied in autonomous driving [24]. Of particular interest are instead, the study by Chen et al. [6] and the work by Yang et al. [44] where YOLO is applyed for cell and cancer detection.
Summing up, the usage of ILP in weather prediction provides significant advantages over other methods. Specifically, ILP allows learning concepts that can be interpretable and adaptable to changing conditions. Moreover, unlike related works in the legal and image recognition domains, which primarily focus on statistical and deep learning approaches, our application of ILP introduces a level of trans-
parency and interpretability that these other techniques lack. For example, in the legal domain, ILP can model complex rules and account for vagueness, while in image recognition, it complements neural networks by providing explainable reasons behind classification results, a feature rarely seen in standard approaches.
## 4 Research goals
The main goal of my research is to integrate deep learning with logic programming to create explainable AI systems. This involves leveraging logic programming, particularly Inductive Logic Programming (ILP), to model complex systems and achieve results that exhibit both high accuracy and explainability. When ILP is not able to reach high levels of accuracy, I want to employ deep learning system for the prediction tasks, due to its superior performance, followed by the application of logic programming to develop systems that can explain their decisions.
In weather prediction, we are employing a hybrid learning approach, where sub-symbolic models (such as RNNs) will handle pattern recognition and time-series forecasting, while ILP will apply symbolic reasoning to provide post-hoc explanations for the RNN predictions. This approach falls under the 'Post-hoc Explainability' category of the taxonomy [5]. The objective is to develop a system that can analyze meteorological data and generate logic rules that explain them and then use them to explain the outcome of the RNN model (which has an higher accuracy). In the future, we do not exclude the possibility to integrate a third system that will use Natural Language Processing to generate text-based explanations of weather forecasts, similar to those provided by professional meteorologists.
In the legal field, I am employing ILASP to model and reason about complex legal rules and cases. This project aims to develop systems that offer transparent and understandable logic behind automated decisions, thus enhancing trust and transparency in legal AI applications. The final model should assist legal professionals by basing its outcomes on numerous criminal records and providing explanations for the reasoning behind the final judgement. In this field, deep learning techniques would likely be used not to predict outcomes (since laws can be easily translated into logic rules) but to automatically encode articles of the legal code, given the vast amount of data.
For image recognition of bull's spermatozoa, my current focus is on using the YOLO (You Only Look Once) network for object detection. Future work will involve integrating ILP to improve the explainability of these systems, ensuring that the AI not only identifies objects accurately but also provides understandable reasons for its classifications.
## 5 Current status of research
Myongoing research and current work in each area of interest will be outlined in this section, along with citations of our publications that have shown promising results.
In the domain of weather prediction, we have successfully developed a neural network capable of predicting the number of lightning strikes in the Friuli Venezia Giulia (IT) region with good accuracy. Initially, we used CNNs for this task and have now begun exploring recurrent neural networks to further enhance predictive performance. Our first results [18] indicate that the neural network performs well, though it requires some modifications to improve its robustness. Additionally, we have created a model using FastLAS that allows us to explain the predicted rainfall levels for the upcoming hours. Data was collected for two sets of three months each. Key atmospheric variables recorded include rain, temperature, humidity, wind speed, and pressure. The training process uses a 10-fold cross-validation approach,
with each fold containing four days of training data and the remaining days used for validation. The hypothesis space is designed to include rules referencing past conditions to predict future states. This approach encourages the use of predicates indicating changes over time, while limiting the complexity of rules to maintain efficiency. In facts, we prioritizes rules that incorporate past information, using a scoring function to penalize predicates that do not reference multiple timestamps. The results of the experiments using FastLAS have been compared to other models such as SVM, RandomForest, and Decision Tree: although the accuracy of this system is not yet optimal, our initial findings indicate that FastLAS can be effectively used for this purpose since it can often reach the same accuracy as the other systems. The application of xASP is shown in Fig. 1.
Figure 1: Full explanation of the answer set and zoomed-in view of a predicate explanation by xASP
<details>
<summary>Image 1 Details</summary>

### Visual Description
## Diagram: Network of Temperature Explanations
### Overview
The image presents a network diagram illustrating relationships between temperature increases and related factors. The diagram is split into two main sections: a broader network on the left and a zoomed-in view on the right, focusing on the explanation of increased temperature. Nodes represent temperature-related events or states, and edges (arrows) indicate causal or explanatory relationships.
### Components/Axes
* **Nodes:** Represented by circles, with labels indicating the type of temperature event and associated numerical identifiers (likely coordinates or IDs). Node color varies in shades of green, possibly indicating a degree of severity or importance.
* **Edges:** Represented by arrows, indicating the direction of influence or explanation.
* **Header:** Contains the title "XASP NAVIGATOR", a search bar, and controls labeled "Aa", "PANEL 52%", and "3.6x ADS".
### Detailed Analysis
**Left Side (Broader Network):**
* The left side shows a network of interconnected nodes.
* Nodes are labeled with terms like "increased temperature", "temperature", and other related concepts.
* Node colors vary from light green to dark green.
* Arrows connect the nodes, indicating relationships between them.
**Right Side (Zoomed-In View):**
* The right side provides a detailed view of the "increased\_temperature(7941600, 7945200)" node.
* This node is labeled as "explained by support increased\_temperature(T1, T2) :- temperature(T1, B1), temperature(T2, B2), previous(T1, T2), B1 == 85, B2 == 86, T1, T2 == 48, 7941600, 7945200".
* Arrows point from this node to two other nodes:
* "temperature(7941600, 48) explained by fact"
* "temperature(7945200, 49) explained by fact"
* The arrows are labeled with conditions such as "B1 == 85, B2 == 86, T1, T2 == 48, 7941600, 7945200" and "B1 == 85, B2 == 86, T1, T2 == 49, 7941600, 7945200".
### Key Observations
* The diagram illustrates a hierarchical explanation of temperature increases, with a central "increased\_temperature" event being explained by supporting facts related to individual temperature readings.
* The numerical identifiers associated with the nodes likely represent specific locations or timestamps.
* The conditions on the arrows suggest that certain temperature thresholds or relationships between temperature readings are necessary for the "increased\_temperature" event to occur.
### Interpretation
The diagram appears to be a visualization of a knowledge base or reasoning system related to temperature monitoring. It shows how a high-level event ("increased\_temperature") can be explained by lower-level facts ("temperature" readings) and logical rules. The system uses numerical identifiers to track specific temperature events and locations. The zoomed-in view on the right provides a detailed explanation of how the "increased\_temperature" event is derived from the supporting facts and conditions. The network on the left shows how this specific explanation fits into a broader context of temperature-related events and relationships.
</details>
In the legal field, we have made significant progress by modeling four articles of the Italian Constitution and more or less a hundred precedent cases. This progress ensures that our system can adapt and improve its reasoning capabilities letting ILASP learn from historical legal cases. While the application of ILASP has not been wide so far, it provides a solid basis for further exploration for explainability [10]. Additionally, we are addressing the inherent challenge of vagueness. This involves developing methods to handle ambiguous and context-dependent terms within legal texts, ensuring that our models can reason accurately despite these complexities. To address this issue we construct a model that enables the user to get all the different combination a vague concept can led to, exploiting choices rules. The evaluation of this model showed that it was successfully able to capture the legal distinctions and provide accurate classifications of cases. The results were validated against a set of real-world legal cases, demonstrating the model's ability to interpret complex legal scenarios and make decisions aligned with legal reasoning. Moreover, some incoherence and discrepancies in previous cases were discovered thanks to the system. The ASP model's output included detailed explanations for each classification, highlighting the rules and criteria applied. We presented our preliminary results in [16, 19, 12].
In both weather and legal domain, we are integrating explainability systems, specifically the one developed by Alviano et al. [2], to ensure that our models provide transparent and understandable outputs. Indeed xASP is able to generate directed acyclic graphs which are particularly useful for representing dependencies and causal relationships within a logic program. This could be used in the future as a base to generate text that explain the outcomes.
The image recognition in our research is still at the beginning stages, but you can see an example of detection our system is currently able to perform in Fig.2. We have developed a basic
Figure 2: YOLO result on bull's spermatozoa image
<details>
<summary>Image 2 Details</summary>

### Visual Description
## Object Detection: Sperm Cell Analysis
### Overview
The image shows a microscopic view of sperm cells, with bounding boxes and confidence scores overlaid, indicating an object detection analysis. The bounding boxes are color-coded, likely representing different categories or classes of objects detected.
### Components/Axes
* **Bounding Boxes:** Rectangular boxes surrounding detected objects (sperm cells).
* **Confidence Scores:** Numerical values (e.g., 0.93, 0.86) associated with each bounding box, indicating the model's certainty about the object's classification.
* **Color Coding:** The bounding boxes are colored differently (red, orange, yellow, green), potentially representing different classes or categories of sperm cells or other objects.
* **Object IDs:** Numbers (0, 1, 2, 4, 5) are associated with each bounding box, likely representing the object's class or category.
### Detailed Analysis or ### Content Details
Here's a breakdown of the detected objects and their associated data:
* **Red Bounding Boxes:**
* Object ID 0, Confidence 0.90 (top-center)
* Object ID 0, Confidence 0.86 (center-right)
* Object ID 0, Confidence 0.92 (center-right)
* Object ID 0, Confidence 0.95 (bottom-left)
* Object ID 0, Confidence 0.94 (bottom-left)
* Confidence 0.26 (top-left)
* **Orange Bounding Box:**
* Object ID 2, Confidence 0.93 (center)
* **Yellow Bounding Boxes:**
* Object ID 4, Confidence 0.94 (left)
* Object ID 4, Confidence 0.89 (right)
* **Green Bounding Box:**
* Object ID 5, Confidence 2.87 (bottom-center)
* **Pink Bounding Box:**
* Object ID 1, Confidence 0.89 (top-right)
### Key Observations
* The majority of detected objects are classified with high confidence (above 0.85).
* Different colors of bounding boxes suggest different categories or classes of objects are being detected.
* Object ID 0 (red boxes) appears to be the most frequent classification.
* The green bounding box has a confidence score of 2.87, which is significantly higher than the other scores. This could indicate a different scale or a potential anomaly.
### Interpretation
The image demonstrates an object detection model applied to a microscopic image of sperm cells. The model identifies and classifies individual cells, providing confidence scores for each detection. The color-coded bounding boxes likely represent different categories of sperm cells (e.g., normal, abnormal, damaged) or other objects present in the image. The high confidence scores suggest the model is performing well in identifying these objects. The green bounding box with the high confidence score could indicate a specific type of cell or artifact that the model is particularly confident in identifying. Further information about the object IDs and their corresponding categories would be needed to fully interpret the results.
</details>
neural network (using YOLO) that, despite its simplicity, is yielding good results (the accuracy of the current model reached 68%). Our next step is to make these systems more reliable by integrating ILASP, as we already explored how it works [17]. This integration aims to enhance the explainability and robustness of our image recognition systems.
## 6 Conclusions
This research project investigates the integration of deep learning and logic programming to develop AI systems that combine accuracy with explainability. By leveraging the strengths of neural networks for predictive tasks and ILP tools like FastLAS and ILASP for logical reasoning, the study aims to create interpretable models across various domains.
In weather prediction, the hybrid approach of combining FastLAS with recurrent neural networks aims to deliver accurate forecasts and clear, human-readable explanations, thus enhancing trust in the predictions. In the legal domain, ILASP is employed to model and reason about complex legal rules, providing transparent logic behind decisions and aiding legal professionals by offering understandable explanations for judgments. Finally, for image recognition, integrating YOLO networks with ILP improves AI interpretability, ensuring accurate object detection with clear reasoning.
Additionally, we are working towards making FastLAS compatible with GPU acceleration [38, 15, 14, 13] to enhance computational efficiency and scalability in AI applications. The pursuing of the research will hopefully bring advance in the field of AI and explainable AI.
Acknowledgments. This research is partially supported by Interdepartment Project on AI (Strategic Plan UniUD-202225), by NextGenerationEU-PNRR project MaPSART -'Future Artificial Intelligence Research', and by INdAM-GNCS 2024 project LCXAI: Logica Computazionale per eXplainable Artificial Intelligence.
## References
- [1] Layman E. Allen (1957): Symbolic Logic: a Razor-Edged Tool For Drafting and Interpreting Legal Documents . The Yale Law Journal 66(6), pp. 933-879, doi:10.2307/794073.
- [2] Mario Alviano, Ly Ly T. Trieu, Tran Cao Son & Marcello Balduccini (2023): Advancements in xASP, an XAI System for Answer Set Programming . In: Proceedings of the 38th Italian Conference on Computational Logic, Udine, Italy, June 21-23, 2023 , CEUR Workshop Proceedings 3428, CEUR-WS.org. Available at https://ceur-ws.org/Vol-3428/paper2.pdf .
- [3] Kexin Gu Baugh, Nuri Cingillioglu & Alessandra Russo (2023): Neuro-symbolic Rule Learning in Realworld Classification Tasks . In: Proc. of AAAI-MAKE 2023 , CEUR Workshop Proceedings 3433, CEURWS.org, doi:10.48550/arXiv.2303.16674.
- [4] Pedro Cabalar, Jorge Fandinno & Michael Fink (2014): Causal graph justifications of logic programs . Theory and Practice of Logic Programming 14(4-5), pp. 603-618, doi:10.48550/arXiv.1409.7281.
- [5] Roberta Calegari, Giovanni Ciatto & Andrea Omicini (2020): On the integration of symbolic and subsymbolic techniques for XAI: A survey . Intelligenza Artificiale 14(1), pp. 7-32, doi:10.3233/IA-190036.
- [6] Xi Chen, Haoyue Zheng, Haodong Tang & Fan Li (2024): Multi-scale perceptual YOLO for automatic detection of clue cells and trichomonas in fluorescence microscopic images . Computers in Biology and Medicine 175, p. 108500, doi:10.1016/j.compbiomed.2024.108500.
- [7] Andrew Cropper & Sebastijan Dumanˇ ci´ c (2022): Inductive logic programming at 30: a new introduction . Journal of Artificial Intelligence Research 74, pp. 765-850, doi:10.48550/arXiv.2008.07912.
- [8] Daniel Cunnington, Flaviu Cipcigan, Rodrigo Neumann Barros Ferreira & Jonathan Booth (2023): Symbolic Learning for Material Discovery . arXiv preprint arXiv:2312.11487 , doi:10.48550/arXiv.2312.11487.
- [9] Daniel Cunnington, Mark Law, Jorge Lobo & Alessandra Russo (2023): FFNSL: Feed-forward neuralsymbolic learner . Machine Learning 112(2), pp. 515-569, doi:10.48550/arXiv.2106.13103.
- [10] Fabio A D'Asaro, Matteo Spezialetti, Luca Raggioli & Silvia Rossi (2020): Towards an inductive logic programming approach for explaining black-box preference learning systems . In: Proceedings of the International Conference on Principles of Knowledge Representation and Reasoning , pp. 855-859, doi:10.24963/kr.2020/88.
- [11] Shi Dong, Ping Wang & Khushnood Abbas (2021): Asurvey on deep learning and its applications . Computer Science Review 40, p. 100379, doi:10.1016/j.cosrev.2021.100379.
- [12] Agostino Dovier, Talissa Dreossi & Andrea Formisano (2024): XAI-LAW Towards a Logic Programming Tool for Taking and Explaining Legal Decisions . In: Proceedings of the 39th Italian Conference on Computational Logic, Rome, Italy, June 26-28, 2024 , CEUR Workshop Proceedings 3733, CEUR-WS.org. Available at https://ceur-ws.org/Vol-3733/short3.pdf .
- [13] Agostino Dovier, Andrea Formisano, Gopal Gupta, Manuel V. Hermenegildo, Enrico Pontelli & Ricardo Rocha (2022): Parallel Logic Programming: A Sequel . Theory Pract. Log. Program. 22(6), pp. 905-973, doi:10.1017/S1471068422000059.
- [14] Agostino Dovier, Andrea Formisano & Enrico Pontelli (2018): Parallel Answer Set Programming . In: Handbook of Parallel Constraint Reasoning , Springer, pp. 237-282, doi:10.1007/978-3-319-63516-3\_7.
- [15] Agostino Dovier, Andrea Formisano, Enrico Pontelli & Flavio Vella (2016): A GPU Implementation of the ASP Computation . In: Practical Aspects of Declarative Languages - 18th International Symposium, PADL 2016, St. Petersburg, FL, USA, January 18-19, 2016. Proceedings , Lecture Notes in Computer Science 9585, Springer, pp. 30-47, doi:10.1007/978-3-319-28228-2\_3.
- [16] Manuele Dozzi, Talissa Dreossi, Federico Costantini, Agostino Dovier & Andrea Formisano (2023): Semiautomatic knowledge representation and reasoning on vagueness crime concepts . Workshop at Jurix 2023.
- [17] Talissa Dreossi (2023): Exploring ILASP Through Logic Puzzles Modelling . In: CEUR Workshop Proceedings , 3428, CEUR-WS. Available at https://ceur-ws.org/Vol-3428/paper14.pdf .
- [18] Talissa Dreossi, Agostino Dovier, Andrea Formisano, Mark Law, Agostino Manzato, Alessandra Russo & Matthew Tait (2024): Towards Explainable Weather Forecasting Through FastLAS . In: Logic Programming and Nonmonotonic Reasoning - 17th International Conference, LPNMR 2024, Dallas, Texas, USA, October 11-14, 2024, Proceedings , Springer.
- [19] Talissa Dreossi, Manuele Dozzi, Luca Baron, Agostino Dovier, Andrea Formisano & Federico Costantini (2024): Semi-automatic knowledge representation and reasoning on vague crime concepts . In: Book of Abstracts, ESCIM 2024, Krakow , p. 31. Available at http://escim2024.uca.es/wp-content/uploads/ Book\_of\_abstracts\_ESCIM\_2024.pdf#page=45 .
- [20] Arthur Drozdov, Mark Law, Jorge Lobo, Alessandra Russo & Mercion Wilathgamuwage Don (2021): Online Symbolic Learning of Policies for Explainable Security . In: 2021 Third IEEE International Conference on Trust, Privacy and Security in Intelligent Systems and Applications (TPS-ISA) , pp. 269-278, doi:10.1109/TPSISA52974.2021.00030.
- [21] Jorge Fandinno & Claudia Schulz (2019): Answering the 'why' in answer set programming - A survey of explanation approaches . Theory and Practice of Logic Programming 19(2), p. 114-203, doi:10.1017/S1471068418000534.
- [22] Michael Gelfond & Vladimir Lifschitz (1988): The stable model semantics for logic programming. In: ICLP/SLP , 88, Cambridge, MA, pp. 1070-1080, doi:10.2307/2275201.
- [23] Forouzan Golshani (1991): Automated construction of legal arguments . Int. J. Intell. Syst. 6(6), pp. 673-685, doi:10.1002/INT.4550060605.
- [24] Lei Huang & Wenzhun Huang (2022): RD-YOLO: An effective and efficient object detector for roadside perception system . Sensors 22(21), p. 8097, doi:10.3390/s22218097.
- [25] Peiyuan Jiang, Daji Ergu, Fangyao Liu, Ying Cai & Bo Ma (2022): A Review of Yolo algorithm developments . Procedia computer science 199, pp. 1066-1073, doi:10.1016/j.procs.2022.01.135.
- [26] Eugenia Kalnay (2002): Atmospheric Modeling, Data Assimilation and Predictability . Cambridge University Press, doi:10.1017/CBO9780511802270.
- [27] Robert A. Kowalski & Marek J. Sergot (1985): Computer Representation of the Law . In: Proceedings of the 9th IJCAI. Los Angeles, CA, USA, August 1985 , Morgan Kaufmann, pp. 1269-1270. Available at http://ijcai.org/Proceedings/85-2/Papers/114.pdf .
- [28] Zachary M Labe, Nathaniel Johnson & Thomas L Delworth (2023): Changes in United States summer temperatures revealed by explainable neural networks . Authorea Preprints .
- [29] Mark Law (2023): Conflict-driven inductive logic programming . Theory and Practice of Logic Programming 23(2), pp. 387-414, doi:10.48550/arXiv.2101.00058.
- [30] Mark Law, Alessandra Russo, Elisa Bertino, Krysia Broda & Jorge Lobo (2020): Fastlas: Scalable inductive logic programming incorporating domain-specific optimisation criteria . In: Proc. of the AAAI conference on artificial intelligence , 34, pp. 2877-2885, doi:10.1609/aaai.v34i03.5678.
- [31] Mark Law, Alessandra Russo & Krysia Broda (2014): Inductive learning of answer set programs . In: Logics in Artificial Intelligence, JELIA 2014 , Springer, pp. 311-325, doi:10.1007/978-3-319-11558-0\_22.
- [32] Mark Law, Alessandra Russo & Krysia Broda (2018): Inductive learning of answer set programs from noisy examples . arXiv preprint arXiv:1808.08441 , doi:10.48550/arXiv.1808.08441.
- [33] Mark Law, Alessandra Russo & Krysia Broda (2020): The ILASP system for inductive learning of answer set programs . arXiv preprint arXiv:2005.00904 , doi:10.48550/arXiv.2005.00904.
- [34] Yann LeCun, Yoshua Bengio & Geoffrey Hinton (2015): Deep learning . nature 521(7553), pp. 436-444, doi:10.1038/nature14539.
- [35] Lizao Li, Robert Carver, Ignacio Lopez-Gomez, Fei Sha & John Anderson (2024): Generative emulation of weather forecast ensembles with diffusion models . Science Advances 10(13), doi:10.1126/sciadv.adk4489.
- [36] Amy McGovern (2017): Using artificial intelligence to improve real-time decision-making for high-impact weather . Bulletin of the American Meteorological Society 98(10), pp. 2073-2090, doi:10.1175/BAMS-D16-0123.1.
- [37] Stephen H. Muggleton (1991): Inductive Logic Programming . New Gener. Comput. 8(4), pp. 295-318, doi:10.1007/BF03037089.
- [38] Alessandro Dal Palù, Agostino Dovier, Andrea Formisano & Enrico Pontelli (2015): CUD@SAT: SAT solving on GPUs . J. Exp. Theor. Artif. Intell. 27(3), pp. 293-316, doi:10.1080/0952813X.2014.954274.
- [39] Stephan Rasp, Michael S Pritchard & Pierre Gentine (2018): Deep learning to represent subgrid processes in climate models . Proceedings of the national academy of sciences 115(39), pp. 9684-9689, doi:10.1073/pnas.1810286115.
- [40] Joseph Redmon, Santosh Divvala, Ross Girshick & Ali Farhadi (2016): You only look once: Unified, realtime object detection . In: Proceedings of the IEEE conference on computer vision and pattern recognition , pp. 779-788, doi:10.1109/CVPR.2016.91.
- [41] Galileo Sartor, Jacinto A. Dávila, Marco Billi, Giuseppe Contissa, Giuseppe Pisano & Robert A. Kowalski (2022): Integration of Logical English and s(CASP) . In: Proceedings of the ICLP 2022 Workshops colocated with the 38th International Conference on Logic Programming (ICLP) 2022, Haifa, Israel, July 31st - August 1st, 2022 , CEUR Workshop Proceedings 3193, CEUR-WS.org. Available at https://ceur-ws. org/Vol-3193/paper5GDE.pdf .
- [42] Jonathan A Weyn, Dale R Durran & Rich Caruana (2019): Can machines learn to predict weather? Using deep learning to predict gridded 500-hPa geopotential height from historical weather data . J. of Advances in Modeling Earth Systems 11(8), pp. 2680-2693, doi:10.1029/2019MS001705.
- [43] Jonathan A Weyn, Dale R Durran & Rich Caruana (2020): Improving data-driven global weather prediction using deep convolutional neural networks on a cubed sphere . J. of Advances in Modeling Earth Systems 12(9), doi:10.1029/2020MS002109.
- [44] Yunfeng Yang & Jiaqi Wang (2024): Research on breast cancer pathological image classification method based on wavelet transform and YOLOv8 . Journal of X-Ray Science and Technology , pp. 1-11, doi:10.3233/XST-230296.