Use of the Knowledge-Based System LOG-IDEAH to Assess Failure Modes of Masonry Buildings, Damaged by L'Aquila Earthquake in 2009

This article, first, discusses the decision-making process, typically used by trained 
engineers to assess failure modes of masonry buildings, and then, presents the 
rule-based model, required to build a knowledge-based system for post-earthquake 
damage assessment. The acquisition of the engineering knowledge and implementation 
of the rule-based model lead to the developments of the knowledge-based system 
LOG-IDEAH (Logic trees for Identification of Damage due to Earthquakes for Architectural 
Heritage), a web-based tool, which assesses failure modes of masonry buildings 
by interpreting both crack pattern and damage severity, recorded on site by visual 
inspection. Assuming that failure modes detected by trained engineers for a sample 
of buildings are the correct ones, these are used to validate the predictions made by 
LOG-IDEAH. Prediction robustness of the proposed system is carried out by computing 
Precision and Recall measures for failure modes, predicted for a set of buildings selected 
in the city center of L’Aquila (Italy), damaged by an earthquake in 2009. To provide an 
independent meaning of verification for LOG-IDEAH, random generations of outputs are 
created to obtain baselines of failure modes for the same case study. For the baseline 
output to be compatible and consistent with the observations on site, failure modes are 
randomly generated with the same probability of occurrence as observed for the building 
samples inspected in the city center of L’Aquila. The comparison between Precision and 
Recall measures, calculated on the output, provided by LOG-IDEAH and predicted by 
random generations, underlines that the proposed knowledge-based system has a high 
ability to predict failure modes of masonry buildings, and has the potential to support 
surveyors in post-earthquake assessments.


INTRODUCTION
Visual investigation of failure modes of buildings, through interpretation of both crack patterns and damage severity, is an engineering activity, traditionally carried out on site and based on expert judgements, involving critical observation of buildings' features and deficiencies and a careful understanding of buildings' seismic response (D'Ayala and Speranza, 2003;Yates and Paquette, 2011;Zhai and Zeng, 2017;Sextos et al., 2018;Sisti et al., 2018). Only trained engineers, with substantial experience in post-earthquake assessment, have adequate knowledge and practice to provide valuable diagnosis concerning causes and effects of earthquake impacts on buildings. For this reason, when a catastrophic earthquake hits a region, only professional teams (e.g., academics and engineers specialized in assessing buildings) are called upon to determine building damage status and failure modes (Dolce and Di Bucci, 2017;Xu et al., 2018).
As post-earthquake assessments are carried out in condition of emergency, when the need to provide insight on building structural state is urgent, flight and vision technology (Pittore and Wieland, 2013;Geiß et al., 2014;Wieland et al., 2016;Stone et al., 2018) have incredibly shortened the timeframes and improved data quality in seismic damage recognition. Despite the remarkable enhancement achieved by these technologies, image and data collection interpretation are not yet supported by machine-based tools capable of detecting failure modes by replicating the same decision-making process, adopted by engineers trained in building assessments.
Detailing such a decision-making process, therefore getting specialized professionals to articulate problem-solving knowledge, is not an easy task, and Knowledge-Based Systems (KBS), a specific sector of Artificial Intelligence (AI) (Kiritsis, 1995) aimed at integrating engineering knowledge into software, can play a key role to gain engineering knowledge in postearthquake assessments (McDermott, 1982;Buchanan and Duda, 1983;Boose, 1985). The development of KBS is mainly based on direct interactions between domain experts (trained seismic engineers) and knowledge specialist (developers of KBS) (Yau and Sattar, 1994). The first ones provide the formulation of the advanced logic required to develop software, that simulates human decision-making processes and high-level cognitive tasks. The second ones convert the captured knowledge through rulebased models, built in a declarative logic programming language to detail the decision-making processes to KBS (Wick and Slagle, 1989;Yau and Sattar, 1994;Agarwal and Goel, 2014;Djamal et al., 2017;de Diego et al., 2019). For the implementation of a rule-based model, extensive manual work is required and this consists in constructing linguistic patterns based on ontologies, which are used to make inferences, to derive rules necessary for semantic interpretation, and to question and answer systems (Khoo et al., 1998;Girju, 2003;Chan and Lam, 2005;Inui et al., 2005;Ittoo and Bouma, 2011;Li and Mao, 2019).
The development of KBS relying on the engineers' knowledge, adopted for the interpretation of building damage to determine failure modes, has not yet been explored. The limited exploitation of KBS in this field underlines not only an absence of efforts made to deconstruct such engineers' knowledge, but also an absence of systems for assisting trained (or less experienced) engineers in the interpretation of building response. To explore the power of the KBS in post-earthquake assessment, LOG-IDEAH (LOGic trees for Identification of Damage from Earthquakes to Architectural Heritage) was developed for supporting surveyors in the assessment of failure modes of masonry buildings. This tool is the result of a collaboration between the authors  in the role of domain experts, and the Computer Science Department of the University of Bath  in the role of the knowledge specialists. LOG-IDEAH, delivered within the FP7 project PERPETUATE (Performancebased Approach to Earthquake Protection of Cultural Heritage in European and Mediterranean Countries), is accessible freely online at http://perpetuate.cs.bath.ac.uk/perpetuate-testing/. The proposed KBS is a web-platform that allows collecting seismic data, in terms of crack patterns, into multimedia sketches representative of masonry building's façades inspected on site and interpreting collected data in terms of failure modes delivered to assess response of buildings damaged by earthquakes. The interpretation of the collected data is carried out with a rulebased model, implemented for simulating the diagnostic process enacted in post-earthquake assessments. The rule-based model was programmed within an Answer Set Programming (ASP) computational environment Lifschitz, 1988, 1991), a form of declarative computing language, that offers an intuitive and declarative syntax for problem solving. Specifically, in the context of LOG-IDEAH, the ASP was adopted to define a syntax, introduced to create a correspondence between crack patterns and failure modes, basic knowledge required by trained engineers to interpret seismic damage and to recognize failure modes (Grünthal, 1998;D'Ayala and Speranza, 2003;Zuccaro et al., 2008;Andreotti et al., 2014;Spence, 2014). Due to incomplete dataset or impossibility of carrying out complete inspections of damaged buildings, the seismic data interpretation is not always a straightforward process, hence a fundamental characteristic of the rule-based model produced, is the exploitation of the synthetic logic used by professional to diagnose failure modes in conditions of modest confidence about the available information.
The aim of this study is to assess the performance of the proposed KBS by: (1) identifying and clarifying thought processes used by trained engineers to detect failure modes through observation and interpretation of crack patterns and damage severity; (2) discussing the ontology and logic behind the rule-based model of LOG-IDEAH implemented to replicate such thought processes; (3) presenting an effective validation to evaluate the robustness of LOG-IDEAH in predicting failure modes. In the remainder of the article, section Identification of Failure Modes by Trained Engineers describes the typical failure modes and related crack patterns for masonry buildings exposed to seismic actions, and proposes a classification system of diagnosis, for categorizing building responses, as a function of the confidence level of the input data. The decision-making process of trained engineers, for capturing building responses, is analyzed and deconstructed to outline the knowledge required to setup a KBS for post-earthquake assessment. section Identification of Failure Modes by The Expert Knowledge System Log-Ideah, firstly, defines the ontology for input data (e.g., crack types, severity and location) and output data (e.g., failure modes type) needed to determine the knowledge base. Then, the logic behind the correlation between observed cracks and failure modes, adopted to create inferences for the rule-based model is presented and possible solutions obtained from this model, are classified in terms of different probability levels of occurrence, in relation to the confidence level of the input data. section Validation of LOG-IDEAH details the system's validation, consisting in the calculation of Precision and Recall measures, in agreement with common evaluation standards (Zhu et al., 2011;German et al., 2012;Robinson et al., 2013;Fersini et al., 2017;Perol et al., 2018). These measures are calculated to quantify the correspondence between failure modes that are (a) predicted by LOG-IDEAH and (b) generated by random predictions with failure modes detected by trained engineers for a case study, where the latter are assumed as the target failure modes for an inspected building. In order to be compatible and consistent with the observations on site, the randomly generated set of failure modes have the same distribution, in terms of failure mode types and probability of occurrence, observed on site, by trained engineers, for a specific case study. Section Case Study: The Historic Centre of L'Aquila describes the application of LOG-IDEAH to a sample of buildings selected in the historic center of L'Aquila (Italy), damaged by the 2009 earthquake. A Venn diagram is produced to visualize the robustness of the LOG-IDEAH output, when compared with the predictions of trained engineers. Finally, strengths and weakness of the proposed KBS, as well as required future work, are summarized in section Conclusions and Future Developments.

Knowledge Base for Failure Mode Identification
Knowledge of failure modes of buildings in seismic prone regions is formed through direct field observation of post-earthquake damage site. Spence (2014) outlines how post-earthquake reconnaissance activity, from the 1980s onwards, has played a critical role in forming and evolving seismic engineering knowledge up to underpinning performance based seismic engineering design. For traditional masonry structures, site investigations play an important role to identify the prevalent geometric and structural features (i.e., height, plan dimensions, material type, floor/roof types, connections) and their deficiencies (i.e., decay, damage, defects, poor construction practices) as they might be very peculiar and specific to a particular site, and at the same time, they are critical to the response of each single structure. A trained engineer should be able to establish the correlation between construction features and local crack pattern, and also able to read the crack pattern in terms of failure modes. In the past twenty years, an increasing number of databases and classification of failure modes for masonry has been developed based on site observations, some of local validity or specific to a given typology (e.g., Doglioni et al., 1994;Lagomarsino et al., 1997) and some of more general applicability (Grünthal, 1998;D'Ayala and Speranza, 2003;Zuccaro et al., 2008;Andreotti et al., 2014). This knowledge is increasingly becoming part of structural and seismic engineering education, and it is commonly used in post-earthquake assessment (Wilkinson et al., 2011;Ioannou et al., 2012;Kaushik et al., 2016). In the following section, this correlation process is illustrated with reference to the failure mode catalog introduced by D' Ayala and Speranza (2003) and further developed in D'Ayala and Paganoni (2011) and .

Identification of Failure Modes by Trained Engineers
To conduct visual inspections, aimed at identifying failure modes of masonry buildings, engineers need to be trained and have experience in post-earthquake assessment field. This phase of investigation requires no equipment, and only trained naked eye is needed. Inspections are conducted on buildings from outside, observing damage levels and crack patterns on the external façades, where most of the seismic capacity of the buildings is concentrated (Anagnostopoulos and Moretti, 2008).
In the present study, damage levels are defined with relation to five damage levels: ND: No Damage, LD: Light Damage; SD: Significant Damage; NC: Near Collapse; and C: Collapse, in agreement with the European Macroseismic Scale EMS'98 (Grünthal, 1998). The investigation of the damage severity is performed at the level of the single observed crack, and is used to identify crack patterns, by grouping cracks with the same damage severity.
The identified failure modes are classified according to three classes (D'Ayala and Paganoni, 2011) differing in relation to construction deficiencies: (1) Out-of-plane failure modes; (2) In-plane failure modes; (3) Combined failure modes.
The Out-of-plane failure modes (OOP) class contain failure modes, which result in the overturning of the façade or some of its portions. Although all failure modes in this class are characterized by poor connections between a façade and the rest of its structure, being it walls or floors, they substantially differ by the layout of the crack patterns, as depicted in Figure 1.
The In-plane failure modes (IP) occur when there are sufficient connections among walls and the horizontal structures, and they are sufficiently stiff to redistribute the seismic action among piers. Two failure modes are identified in Figure 2, either with a distribution of X cracks in spandrels and/or piers, depending on their relative stiffness and strength, or with long diagonal cracks when openings are irregularly distributed.
Combined failure modes (COMB): occur in buildings characterized by good connections between intersecting façades and poor connections between façades and floors. Several factors, such as layout of the openings, spanning direction of floors/roof, presence of internal load bearing walls or strengthening elements restraining the façade from overturning influence the resulting failure mode. The common feature is that more than one wall is involved leading to the failure modes illustrated in Figure 3.

Evaluation of the Uncertainty Level of the Expert's Judgement
While a systematic correlation between idealized crack pattern and failure modes can be established, this is not always a straightforward process, especially when engineers have low confidence on the robustness of the information relating to the construction details of the inspected buildings, the damage pattern is chaotic, and cracks are characterized by different   damage severity. In such cases, the diagnosis arrived at is highly dependent on subjective expert judgement. According to Aspinall and Cooke (2013), the main distinction among decision-making processes based on expert judgements is whether the judgement is "structured" or "unstructured". Structured judgements are derived from a traceable and retrievable process, whereby the solution is arrived by answering questions with a clear operational meaning. So, for instance, if the answer to the question: "level of connection between walls, " is "poor, " and the answer to the question: "layout of cracks, " is "vertical at edges of façade, " these answers univocally identify failure mode type A of Figure 1. However, often decisions are taken on an "unstructured" judgement, whereby an expert is able to offer deliberate, thoughtful decisions based on deep experience and scientific knowledge, following a process with difficult traceability and retrievability (Aspinall and Cooke, 2013). "Unstructured" judgement is at the basis of the assessment of failure modes, when buildings have complex damage patterns, several deficiencies and different damage severity. While the use of "unstructured" expert judgements might suffice to recognize a failure mode, the identified failure mode and its occurrence is associated with substantial levels of uncertainty, which needs to be systematically quantified.
To take into consideration whether "structured" or "unstructured" judgements are adopted, in this work, identified failure modes are classified according to two sub-classes (1) CERTAIN events and (2) POSSIBLE events. A CERTAIN event occurs if: (i) a façade has cracks that can be associated directly to one crack pattern and, therefore to one failure mode, as the ones shown in Figures 1-3; or (ii) a façade has cracks which can be combined to form different failure modes in different portion of the façade, validated by the presence of specific deficiencies, hence, although coexisting, each identified failure modes can be classified as a CERTAIN event. By means of example, Figure 4 illustrates the case of a façade, where cracks with Near Collapse damage level show the occurrence of failure mode G, while cracks with Collapse damage level show the occurrence of failure mode D. The failure mode G is caused by the rafters of the roof pushing against the façade, while failure mode D is triggered by the lack of connection of the façade with the side wall. In this case, the interpretation of crack patterns and construction deficiencies are clearly traceable and directly associated to failure modes G and D, and therefore both are classified as CERTAIN events.
A POSSIBLE event occurs if a façade has cracks that can be associated only partially to the development of the classified crack pattern-failure modes of section Identification of Failure Modes by Trained Engineers and they correlate to some of the deficiencies observed on the building. By means of example, to illustrate how different POSSIBLE events can be identified, Figure 5 shows a building, located in L'Aquila city center, and damaged by a single crack pattern, which can be associated to different failure modes. In this case, the association of an observed crack pattern to multiple POSSIBLE failure modes is the result of a limited access to the building and, hence, a limited observation. The uncertainty, stemming from this situation, leads engineers to consider a number of assumptions, which would determine the occurrence of different failure modes. In the example, only one façade could be observed and, therefore, the knowledge of the connection of this one to other walls is uncertain and leaves the judgement open to the possibility of such connections being present or not. Starting from the hypothesis that the building is characterized by strong connections, the observed crack pattern, outlined by the red diagonal crack, might be associated to failure mode H2, reported in Figure 2, involving the In-plane failure mode of the entire façade. Furthermore, the same hypothesis on the connections, although the façade adjacent to the one inspected is not visible, would lead to the possibility of the blue crack pattern on the return wall in Figure 5, giving rise to other POSSIBLE failure modes: B or C of Figure 3. On the other hand, by changing the initial hypothesis and assuming that the damaged façade is not connected to the adjacent walls, the red crack pattern might also be associated to a partial development of failure mode D in Figure 1. In conclusion, H2, C, B1, B2, and D are considered all POSSIBLE failure modes and, therefore, POSSIBLE events. Although the identification of all these possibilities has followed the same "structured" process as outlined for the CERTAIN event, a decision on which of these POSSIBLE events is the most likely would be "unstructured" and fully dependent on the expert's personal knowledge and judgements.

IDENTIFICATION OF FAILURE MODES BY THE EXPERT KNOWLEDGE SYSTEM LOG-IDEAH Knowledge Base for Failure Mode Identification Defined in KBS
As stated in the introduction, the ambition of LOG-IDEAH is to replicate the decision-making process that underpins the engineers' knowledge base, guiding the reasoning to recognize a failure mode, given an observed crack pattern. The decisionmaking process developed to determine the logic correlation between crack patterns, constraint conditions and failure modes for LOG-IDEAH is detailed in  and . This decision-making process is constructed on an ontology that relates, according to a hierarchical structure, information pertaining to topology of urban blocks, typology of buildings, location of buildings within urban block, buildings' façade orientation and connection, construction elements defining the topology and layout of façades, and finally, seismic damage, categorized in terms of position, type and severity (see Figures 6, 7).
The use of the Answer Set Programming (ASP) declarative language (Gelfond and Lifschitz, 1991) allows the implementation of the rule-based model adopted to prose the captured engineers' knowledge, and to set the decision-making in phenomenological terms, for correlating a phenomenon (development of a failure mode) with an observed a set of evidences (distribution of cracks over a set of walls combined with specific construction details). The existence of a set of evidences is taken as proxy to detect the occurrence of the phenomenon (development of a failure mode). This is accomplished by linking sequentially in a logic flow, for each of the possible failure modes included in LOG-IDEAH's ontology (see Figure 6), a number of declarative statements, exemplifying the decision-making process of engineers. The cracks are acquired as knowledge of the seismic scenario, identified at the level of the individual pier or spandrel (see Figures 6, 7). Therefore, the capture of a failure mode is the result of the presence of horizontal, vertical and diagonal cracks, combined in relation to their damage severity and position on a single façade or on multiple adjacent façades, and related structural constraints.
To reflect the need to record the position of the damaged façade and its crack distribution and levels, illustrated in Figures 7A,B, the classification of the failure modes presented in Figure 7C is an expanded set of the failure modes shown in Figures 1-3, as this allows identifying, for the single building, not only the triggered failure mode types, but also the position of the façade or the portion of it, involved in the identified failure mode. For instance, a failure mode identified on site as a D, by a trained engineer, can correspond to a failure mode D-Left or failure mode D-Right, depending on whether the set of vertical and diagonal cracks are located on the left or the right corner of the façade, corresponding to a weak connection to the orthogonal wall. While for trained engineers the relative position of the cracks is a synthetic information, forming part of the knowledge acquired through observation, in LOG-IDEAH this needs to be included in declarative statements to become a resource of the expert knowledge system. Furthermore, the relative position of the cracks is an essential information, not only to define the most probable failure mode, but also to include/exclude the possibility of occurrence of other failure modes, that may occur in relation to the presence/absence of cracks on adjacent façades. For instance, if given crack patterns and constraints satisfy the declarative statements that identify A1, failure mode caused by a lack of connections between façades, then failure modes A2, Bs, Cs, Ds or Es are excluded, because they occur only if the inspected façade has, at least, one good connection with one of the façades on its left or right side. Similarly, the inclusion in a declarative statement of specific strengthening elements (ties, anchors and/or ring beams) will support the occurrence of failure modes, that are triggered by their presence, and they will exclude those failure modes, prevented by their presence.

Evaluation of the Uncertainty Level of the Solutions Provided by KBS
Although a KBS is developed to associate complex sets of evidence to increasingly sophisticated declarative statements, and knowledge domain is directly provided by a number of experts, a level of uncertainty in the failure modes estimated by the proposed KBS remains, because crack patterns cannot be always univocally associated to failure modes. Two types of uncertainties underlie the output produced by LOG-IDEAH: epistemological uncertainty caused by partial inspection and hence limited knowledge, and aleatory uncertainty inherent to different facts: cracks are naturally diverse from building to building, more than one crack patterns might co-exist on the same building, cracks may give rise to different failure modes. The first uncertainty is hereby defined through an UNCERTAINTY level, and the second one through a POSSIBILITY level of occurrence.
The UNCERTAINTY level measures, how complete is the set of information compared with the declarative statements. This will depend on how many façades have been inspected, whether structural constraints and connections conditions have been observed, and finally how complete is the identified crack pattern. Three UNCERTAINTY levels are considered: Low when all cracks are identified and connections among façades are also known, Medium when the crack pattern is known and the level of connection is unknown; High when observed cracks are not indicating the presence of a specific crack patterns, or cannot be observed, and the level of connection is unknown.
The POSSIBILITY level of occurrence has a more complex definition as it depends on two factors: (1) the level of match (total/partial) between observed crack pattern and failure modes estimated by LOG-IDEAH; (2) given a complete inspection, the absence of a certain type of cracks can be used as evidence of a given type of constraint, although this might not have been ascertained, hence it reduces, but does not exclude the possibility of occurrence of a given set of failure modes. To clarify this reasoning, the building in Table 1 shows a single vertical crack on the left edge of façade 1. A complete observation of façades 1 and 2 is possible, but the level of connection between these two façades remains unknown. This situation partially fulfills several declarative statements, corresponding to failure modes involving one or more façades. For the failure modes that can develop directly on façades 1 and 2, the UNCERTAINTY level is Medium for failure A1 and B1-Right (as they require information on level of connection between façade 1 and 2) or Low for failure D-Left (as this only requires observation of the crack pattern on the façade under inspection).
For failure modes which could develop on façade 4, as this and façade 3 have not been inspected, the UNCERTAINTY is High. As for the POSSIBILITY of occurrence level, when the UNCERTAINTY is Low, and the crack is not present the POSSIBILITY of occurrence level of the corresponding failure mode is also Low (failure mode D-Left). However, when the UNCERTAINTY level is Medium, cases A1 and B1-Right, the absence of a vertical crack at the intersection between façades 1 and 2, which could be formed even for small shaking, if the connection between the two façades was weak, is indicative of the fact that the connection is most likely to be strong, hence A1 has a Low POSSIBILITY of occurrence, while B1-Right has a Medium POSSIBILITY of occurrence, because it could be the one to be formed, if the connections were strong. On the other hand, for façades that are not fully inspected, cracks requiring less energy to be formed are more common, hence a failure mode such as A2, dependent on weak connections and vertical crack on façade 4, is more possible (Medium level) than one such as B1-Left dependent on a strong connection and diagonal crack on façade 3.
The reasoning expounded above is presented in Table 2, and generalized to apply to all possible crack layouts, including essential requirements for the occurrence of a given failure mode, and reasonable suppositions and assumptions, when information is missing. The chosen approach reflects the weighing of evidence and reasoning acted out by a trained engineer when confronted with limited or incomplete information. Using the possible combinations of level of UNCERTAINTY and level of POSSIBILITY of occurrence, a single indicator, the PROBABILITY level of occurrence, can be computed. This is defined according to 5 levels from DEFINITE to IMPROBABLE, corresponding to increasing uncertainty and decreasing possibility of occurrence. These different levels can be compared to the classification of events identified by trained engineers in CERTAIN, HIGHLY POSSIBLE, or LEAST POSSIBLE, as summarized in Table 2. It should be noted that "structured" judgement has been developed behind each step of the decision-making process, trying to rationalize and document the experts' elicitation.

Example of LOG-IDEAH Output
To exemplify the variety of possibilities, where LOG-IDEAH would be called to provide judgements, a building partially collapsed during the L'Aquila earthquake of 2009 is chosen as reference case. Figures 8A,B show its location within the urban grid and footprint, while the crack severity and patterns observed on site are color-coded in Figures 9A,B to illustrate their association to the failure modes diagnosed by trained engineers.
In Figure 9, the cracks in blue on façade 1.1e have a Near Collapse damage level, and indicate the loss of the upper spandrel ascertaining the CERTAIN occurrence of the failure mode G, triggered by the evidence of purlins punching the top façade 1.1e (visible in Figure 10A), one of the preeminent construction features causing this type of failure. The cracks in purple with a Near Collapse damage level on the façades 1.1e and a Collapse damage level on 1.1n, underline that each of them might be failing for failure mode H2, In-plane failure mode. The same diagonal cracks on 1.1n are also highlighted in yellow to indicate that they might be interpreted together with the yellow diagonal cracks on 1.1e with a Collapse damage level as failure mode C, corner failure mode. Both failure modes H2 and C require strong connections between adjacent walls and between walls and floors/roof, to develop. Conversely, if the hypothesis of bad connection between façades is assumed, the same diagonal cracks (green dash line) can be interpreted as failure mode D. However, Figure 10B, shows two main evidences supporting the hypothesis that failure mode C is occurring: (1) the good connection between walls is underlined by the compactness characterizing the masonry blocks of the façades; (2) the collapse of the roof is caused by the failure of the top corner of the inspected façades. Therefore, to summarize the diagnosis of the trained engineers, it can be concluded that only failure modes G (with a Near Collapse damage level on 1.1e) and C (with a Collapse damage level involving both observed façades) are identified as CERTAIN events, while H2 (with Near Collapse damage level on 1.1e and a Collapse damage level on 1.1n) as a HIGHLY possible event, and D (with a Near Collapse damage level on 1.1e) as LEAST possible event (or as rejected solution, since Figure 10 ascertains that façades are well connected).
Submitting the same observation of crack severity and pattern to LOG-IDEAH, this produces the results summarized in Table 3, consisting of seven failure modes for façade 1.1e and six failure modes for façade 1.1n, with different damage levels and PROBABILITY of occurrence level. These results show that a good correspondence exists between the failure modes with a DEFINITE Probability of occurrence level estimated by LOG-IDEAH and the failure modes observed on site as CERTAIN events, i.e., failure modes G (blue cracks) and C (yellow cracks). However, it is worth reviewing the other results produced by LOG-IDEAH to determine whether they might be considered valid estimates of the façade's failure modes. In Table 3, failure mode H2 (purple cracks) is captured as a failure mode with a RARE Probability of occurrence, because LOG-IDEAH, by identifying failure mode C (yellow cracks) with DEFINITE Probability of occurrence on crack patterns observed on two adjacent façades, cannot exclude but decreases the possibility of occurrence of failure mode H2. Similarly, the failure mode D (green crack) is identified with a SCARCE Probability of occurrence, because of the presence of good connection between the two façades, which leads to the assignment of a DEFINITE Probability of occurrence to failure mode C. However, LOG-IDEAH also identifies failure modes of class B (see Table 3) with an IMPROBABLE Probability of occurrence: the low level of expectation is a consequence of the fact that façade 1.1w has not been inspected (see Figure 10C), hence uncertainty is HIGH. Indeed, inspection of Figure 10C shows that, façade 1.1w is clearly damaged by the cracks in blue that together with the cracks in red on façade 1.1e, determine B2 as a POSSIBLE failure mode of façade 1.1n. Nevertheless, the fact that this façade is standing shows that the probability of occurrence of this failure mode is, indeed, lower, in comparison with failure mode G or C.

VALIDATION OF LOG-IDEAH
The validation step performed here has the purpose of showing that the proposed KBS has a comparable level of ability to identify the correct failure modes respect to the domain experts, and a superior ability respect to other elicitation methods, based on random predictions, proposed in this work. Within this context, the diagnosis provided by trained engineers is taken as the target failure mode expected for a building, although this diagnosis can be affected by biases of judgement inherent in the finite knowledge of any experts, and the intrinsic limited knowledge arising from the condition of the assessment in a post-earthquake environment. To account for this, and as already discussed in Section Identification of Failure Modes by the Expert Knowledge System LOG-IDEAH, the validation exercise compares not only whether the type of failure modes is correctly predicted, but also whether the predicted PROBABILITY of occurrence levels estimated by the proposed KBS correspond to the PROBABILITY of occurrence levels detected by trained engineers, according to the mapping shown in Table 2.
A confusion matrix (Han et al., 2012;de Oliveira et al., 2018) is used to evaluate the correlation between LOG-IDEAH inference outputs and the interpretation provided by the trained engineers, whereby the following four classes can be defined: By mean of example, considering that all possible failure modes, which can be identified for a masonry building, are the ones indicated in Figure 7 (from A1 to M2), and assuming that, for a general building, trained engineers detect failure modes G and C1-Left as CERTAIN events, and LOG-IDEAH estimates failure modes C1-Left with a DEFINITE Probability level of occurrence, the confusion matrix results as follow: • TP: C1-Left; Frontiers in Built Environment | www.frontiersin.org    Due to the rule-based model behind the KBS and its purpose, a high rate of TN compared to TP, FP and FN, will be generated by any inference exercise; hence measures, such as: specificity and accuracy, expressed as a function of TN, would become meaningless parameters for the scope of the present validation. Therefore, Precision and Recall, expressed as a function of TP, FP and FN, are selected to evaluate LOG-IDEAH's outputs. Precision and Recall are defined as: where, Precision measures the ratio between the number of failure modes correctly estimated by LOG-IDEAH over its total number of failure modes provided as solutions, and Recall measures the ratio between number of failure modes correctly estimated by LOG-IDEAH, over the total number of failure modes detected by trained engineers. Precision and Recall can vary from 0 (True Positive = 0, when LOG-IDEAH has not estimated any failure modes identified by trained engineers) to 1 (False Positive and False Negative = 0, when LOG-IDEAH has estimated all failure modes identified by trained engineers). By looking at the example above, therefore Precision and Recall have the following values: The Precision value, being equal to 1.0, underlines that all failure modes estimated by LOG-IDEAH are correctly predicted, as they were also identified by trained engineers. However, since the Precision is not a measurement, which provides information about whether all failure modes observed by trained engineers were estimated by LOG-IDEAH, thus, whether LOG-IDEAH has provided a smaller number of solutions than the ones observed on site, the Recall with a score of 0.5 provides this missing information, highlighting that only half of the failure modes observed on site were estimated by LOG-IDEAH. The Precision and Recall analysis are a well-established technique to measure information retrieval effectiveness (Van Rijsbergen, 1977) and it is commonly used for assessing KBS and prediction approaches (Powers, 2011). Its use in postearthquake data retrieval assessment is testified by applications in the fields of social media for emergency management (Sakaki et al., 2010;Caragea et al., 2011;Avvenuti et al., 2013;Wang et al., 2018), for retrieving damage conditions of reinforced concrete buildings (Zhu et al., 2011;German et al., 2012), and for detection of landslide conditions (Keyport et al., 2018;Konishi and Suga, 2018).
To complete the validation of LOG-IDEAH, and therefore to investigate the validity of the Precision and Recall values, a comparison with other predictive approaches is conducted to verify whether the proposed KBS has a better capability of estimation than other existing methods. To this aim, given the deterministic knowledge behind the proposed KBS for assessing failure modes, baseline elicitations are randomly generated for the same real case study adopted to validate LOG-IDEAH. For the baselines to be compatible and consistent with the observations on site, the fact that more than one failure mode can be associated with a given crack pattern on a façade, is also adhered to, by generating multiple failure modes for each building. The distribution probability, generated on 10,000 predictions, are used for the construction of the baseline elicitation models, whereby all possible failure modes have the same probability of occurrence as observed on site. The baseline output of failure modes is directly compared with the trained engineers' diagnosis, using the measure of Precision and Recall, which are then compared with the values of Precision and Recall calculated for LOG-IDEAH predictions.

CASE STUDY: THE HISTORIC CENTER OF L'AQUILA
The city of L'Aquila was hit by an earthquake of Mw 6.3 on 6th April 2009. Although this earthquake had a rather modest magnitude compared to worldwide events, it is still considered as one of the most catastrophic events in Europe for the widespread damage and collapse of masonry buildings in the historic center and its long-term evacuation (D'Ayala and Paganoni, 2011;Tertulliani et al., 2011;Rossetto et al., 2014;Bertelli et al., 2018).
L'Aquila is characterized by 68% of masonry buildings, according to Istituto Nazionale di Statistica (ISTAT, 2001). The large majority of these, seismically vulnerable due to their poor maintenance, improper strengthening/retrofitting, and unsuitable structural interventions, are concentrated in the historic city center. The authors visited the historic city centers of L'Aquila in several occasions between 2010 and 2013, to assess the building performance (D' Ayala and Paganoni, 2011) and to document the earthquake recovery process (Rossetto et al., 2014). During these visits, extensive data were collected to characterize masonry buildings with reference to structural details, constraints, and crack type/severity, with the intent to investigate the causes of the observed damage and identify failure modes. The inspection on site was focused on ninety buildings, located within the building blocks highlighted with gray color in the map of Figure 11, selected as representative building clusters because of their features and seismic responses. This section analyses the data collected in terms of failure mode diagnosis of the trained engineers that participated in the surveys and compare these with the LOGIDEAH output and the randomly generated outputs.

Failure Modes Observed on Site by Trained Engineers
As illustrated by the onsite observation carried out for the building in the example in section Example of LOG-IDEAH Output, the identification of damage severity helps engineers in the identification of cracks patterns, failure modes, and their probability of occurrences. Hence a statistical description of these characteristics within the chosen sample, sets the reference for better understanding the correlation between level of damage and types of failure modes, their occurrence and the level of confidence with which the expert had identified them. In Figure 12A, the inspected façades are classified with reference to the damage scale introduced in section Identification of Failure Modes by Trained Engineers. In a minority of cases, total collapse (C) of the façades was observed, and these were usually identified on buildings with substantial alterations or with additional stories on top of the original ones. The number of undamaged masonry buildings is also very modest (ND), the number of buildings partially collapsed (NC) or that suffered light damage (LD) is no greater than 20%, while the majority, 55%, suffered significant damage (SD). Such a classification of damage severity, particularly in those façades characterized by a chaotic crack patterns and cracks with different damage severity, was adopted to ease the identification of failure modes by grouping cracks of the same severity and identifying the crack patterns representative of the failure modes introduced in section Identification of Failure Modes by Trained Engineers. The results of the diagnosis of the observed damage severity and crack patterns is summarized in Figure 12B, showing the percentage of inspected façades failing for either Combined, Outof-plane, Arch (corresponding to the failure mode G in section Identification of Failure Modes by Trained Engineers), In-plane failure modes and No failure modes, whereby this represents undamaged buildings. Most of the inspected buildings (almost 60%) fail for Combined (COMB) or In-plane (IP) failure modes, seismic responses expected for buildings with well-connected walls and roof/floors. Less common failure modes belong to class of Out-of-plane (OOP), occurring on buildings with poor connections between walls (almost 20%).
Only a minor percentage of the inspected buildings fail with an Arch failure (10%), represented by overturning of the upper portion of the inspected façades. This failure mode, as discussed in section Identification of Failure Modes by Trained Engineers, can be classified as OOP, however, this has been extrapolated in the plot to underline buildings failing by overturning, although not caused by weak connections between walls.
The classification of the identified failure modes in CERTAIN, HIGHLY possible, or LEAST possible events is presented in Figure 12C. No failure modes and Arch failure modes (type G in section Identification of Failure Modes by Trained Engineers) are always defined as CERTAIN events. The absence of a failure mode on an inspected façade is identified not only by a lack of visible damage, but also by the evidence that the inspected façade is not affected by the presence of a crack pattern on its adjacent façades. The Arch failure mode, instead, is triggered by overturning of gables, or thrust of roof structures on walls, and hence its occurrence is identified by a crack pattern that clearly stands out from other distinctive failure modes. On the other hand, lack of detailed inspections or partial development of crack pattern, inherently leads to sets of evidences, which are difficult to associate to only one failure mode, as exemplified in section Example of LOG-IDEAH Output. A clear element of discrimination between COMB/IP and OOP failure mode is the presence of strong connections or poor connections, respectively, which were accurately investigated on site for each of the inspected buildings. Limited inspection and hence certainty about a specific failure mode is reflected in its classification as HIGHLY and LEAST possible event.
Furthermore, as discussed in the example in section Example of LOG-IDEAH Output, façades may develop one or more failure modes, and this is clearly highlighted in Figure 12D, showing the percentage of the number of failure modes per façade inspected on site. When only one failure mode is identified for a façade this event is classified as CERTAIN, since it means that the crack pattern observed can be univocally associated to it. Conversely, CERTAIN events can co-exist on a given façade with HIGHLY and LEAST possible events, when distinct crack patterns are observed that can be associated to a single failure mode and to more than one type of failure mode, respectively. The suite of failure modes so identified by trained engineers are assumed as target failure modes to validate the robustness of LOG-IDEAH.

LOG-IDEAH's Results and Validation and Discussion
The Precision and Recall parameters, introduced in section Validation of LOG-IDEAH, are the measures adopted to quantify the sensitivity and reliability of the produced KBS. Furthermore, these parameters are calculated to verify, not only whether the type of failure modes is correctly predicted, but also whether the predicted likelihood of occurrence estimated by LOG-IDEAH corresponds to the likelihood of occurrence detected by trained engineers, according to the mapping shown in Table 2. To this end the two classes of DEFINITE events  and CERTAIN events are directly compared, and so are the class of LIKELY-RARE failure modes to the class of HIGHLY possible events, and SCARCE-IMPROBABLE failure modes to LEAST possible events. Figure 13A shows that the ratios of DEFINITE failure modes to CERTAIN events and the ratio of LIKELY-RARE to HIGHLY possible are 0.90 and 1.17, respectively, showing remarkably good agreement between the two approaches. However, when the crack pattern information is less certain and lets itself open to more interpretations, the ratio of SCARCE-IMPROBABLE failure modes to LEAST POSSIBLE, increases significantly, to 5, for two main reasons: (i) the trained engineers will tend to state what is possible and not what it considers unlikely; (ii) the declarative nature of the KBS will ensured that all possible events, no matter how low their likelihood is, will be reported. Given the high ratio of responses, this last set is excluded from the rest of the validation. This entails computing the values of Precision and Recall for the two first sets, as shown in Figure 13B. DEFINITE failure modes have a value of Precision equal to 0.84, indicating the portion of DEFINITE failure modes, which are correctly detected, as they were identified by trained engineers as CERTAIN events, and a value of Recall equal to 0.76, underlining the portion of CERTAIN failure modes, identified by trained engineers, which are correctly detected as DEFINITE solutions by LOG-IDEAH. For LIKELY-RARE failure modes the corresponding values of Precision and Recall are 0.6 and 0.71, respectively.
The Venn diagram of Figure 14 allows to further evaluate the predictive capacity of LOG-IDEAH by correlating specific successful predictions, True Positives, or misclassifications, False Negatives and False positives, to failure mode types as specified in Figure 7. Results show that failure modes of type  A, C, D, and E are most likely to be accurately predicted as can be seen in the True Positives list. On the other hand, mechanisms G and H constitute the majority of False Negatives and False Positives. This is due to the fact that for both failure modes LOG-IDEAH imposes some conditions on the extension and severity of the crack pattern for these failure modes to be recognized as DEFINITE, while trained engineers might have observed and confidently associated these failure modes to façades, independently of such parameters. Furthermore, for the False Positives, building 23 and 47 are typical examples of façades with chaotic crack patterns, where LOG-IDEAH identifies failure modes which are not set as mutually exclusive, while the trained engineers discount them based on intuitive judgements. Figure 14, also points out that mechanisms of class B and C requiring observation on more façades have inherently higher epistemic uncertainty and even when rightly detected, True Positives, both LOG-IDEAH and the trained engineers confine them to the class of LIKELY-RARE and HIGHLY POSSIBLE, respectively. However, due to this epistemic uncertainty, the ratio of False Positives to True Positives is rather high compared with the class of DEFINITE. This is also underlined by the False Negatives, mainly belonging to class COMB (B1 or C) or OOP (D and A), which are generally defined as LIKELY-RARE failure modes, when derived from incomplete crack pattern, as the example illustrated in Figure 5.
To complete the validation of LOG-IDEAH, and, therefore, to investigate the quality of the values obtained for Precision and Recall in Figure 13, sets of outputs of failure modes, as discussed in section Validation of LOG-IDEAH, were randomly generated, and validated against the failure modes observed on site by trained engineers through the use of Precision and Recall. For these sets to be compatible and consistent with the observations on site, a range of 1 (Baseline 1) to a maximum of 5 (Baseline 5) failure modes were associated to the inspected façades, according to their number of failure modes observed on site, see Figure 12C. Furthermore, to increase the robustness of the Baseline from 1 to 5, these failure modes were randomly generated with the same failure modes distribution, in terms of failure mode types and occurrence (from CERTAIN to HIGHLY possible), recorded onsite for each inspected façade. A total of 10,000 realizations are generated for the construction of each baseline output, and Figure 15 reports the media and standard deviation of the Precision and Recall values obtained on the 10,000 random realization. Baseline 5 is the one performing best, nonetheless the Precision and Recall values are substantially lower than the ones obtained by LOG-IDEAH for both classes of DEFINITE and LIKELY-RARE failure modes. As expected, the comparison of the Precision and Recall values calculated on the Baselines and LOG-IDEAH's outputs highlights that the high ability of prediction of the proposed KBS.

CONCLUSIONS AND FUTURE DEVELOPMENTS
LOG-IDEAH is a web-Knowledge Based System (KBS), built on structural engineering expertise encompassing the response of masonry structures to seismic actions. The platform aims to mimic decision-making processes adopted by trained engineers in assessing failure modes through the observation and interpretation of crack patterns, collected from post-earthquake inspection of buildings. To demonstrate its effectiveness in predicting failure modes of damaged buildings, from onsite obtained data, LOG-IDEAH is applied to a set of buildings selected in the city center of L'Aquila (Italy), damaged by an earthquake in 2009. The platform lends itself very well to the collection of information on crack patterns and construction details of a large number of buildings in conditions of time constraint and reduced access, by relying on geo-positioning, simple sketches and photography to produce the base data for interpretation by the knowledge-based system. LOG-IDEAH's capabilities may be summarized as follows: 1. Quality of Data Capture: despite the remarkable enhancement achieved by the latest camera technology (Wieland et al., 2016;Stone et al., 2018), which have incredibly shortened the timeframes for seismic data collection, LOG-IDEAH has the advantage of immediate classification of the data collected in readiness for the KBS interpretation, also ensuring an effective information sharing, through internet connectivity. 2. Quality of Data Processing: LOG-IDEAH is the first KBS, relying on the engineers' knowledge, which interprets both crack pattern and damage severity and captures failure modes. Its notable assistance in the data interpretation is remarked by the high ability of providing, in real time, diagnoses of failure mode types, and related probability of occurrence, as soon as data is collected and entered in the web-platform. Moreover LOG-IDEAH also shows the ability to provide reliable judgements on possible failure modes, even when the buildings have been only partially inspected. 3. Facility in knowledge acquisition: New knowledge (i.e., amendment or additions of new declaratory statements) can be easily implemented to the platform alongside the already coded knowledge. Because of its rule-based model, LOG-IDEAH has a flexible framework, which can be expanded to new rules, introduced to enhance existing knowledge in the system. 4. Minimum validation: One of the advantages of KBSs models in respect to machine learning based models is that, once the underlying rules-set has been validated, this has universal validity irrespective of the specific application, hence can be applied to any size of data sets, without detriment of accuracy.
The reference data on which LOG-IDEAH has been developed and tested pertains to the urban construction tradition and practice typical of Italy and other Mediterranean countries.
Applications to other contexts such as the Casbah of Algiers, Algeria; Llorca, Spain; and Bovec, Slovenia, show the breadth of validity of the procedure. As the architecture of the KBS is based on the definition of a sound ontology and the translation of empirical observation into logical cause-effect engineering based on declarative statements, LOG-IDEAH, once new correlations between observed crack patterns and possible failure modes are identified, can be easily expanded to be applied to the diagnostic of damage in structures of other typologies and materials from the ones specified in this paper, such as concrete frames or bridges.

DATA AVAILABILITY
All datasets generated for this study are included in the manuscript and/or the supplementary files.

AUTHOR CONTRIBUTIONS
VN and DD'A conceived the study, design, data analyses, data interpretation, and wrote the manuscript.