1 Introduction

The method of employing damage detection techniques in various engineering fields such as aerospace, mechanical and civil is called Structural Health Monitoring (SHM) or Non-destructive Testing and Evaluation (NDE). The terminology ‘damage’ in effect can be defined as the variations subject to the geometric characteristics or materialistic properties of the system, comprising the modifications to the boundary conditions and system connectivity, which can create adverse effects on the performance of the systems. There exist different kinds of Non-Destructive Evaluation (NDE) methodologies and tools for localised monitoring of such systems [1]. At present, the known damage detection approaches include experimental methods of visual or localised nature. The use of acoustic signals, ultrasonic methods, radiographs, magnetic field methods, thermal field methods or Eddy current methods are some of the conventional techniques employed in damage detection. The limitations of these methods are the prior knowledge about the location where damage occurs is required, and also the detected area should be easily accessible. Apart from these drawbacks, the methods mentioned above can identify only the damages on the surface of the structures. Thus methodologies including the examination of vibration characteristics of the structural systems, which can be applied to complex areas were introduced to overcome these limitations [2].

On the other hand, during the past three decades of research in this field, attempts to determine the damages in a structural system as a whole were carried out. There has been a tremendous increase in the number of research projects conducted during the recent decade in the field of SHM. The increased attention in SHM of structures has been due to the importance of life-safety factors as well as cost-effective benefits on civil and mechanical structural systems [1]. The goal of this research is to study, by way of analysing existing experimental results readily available on the internet, the structural damage in the presence of operational and environmental variations using vibration-based damage identification procedures, with the help of machine learning algorithms that aim to improve the damage detection efficiency.

2 Literature Review

2.1 Structural Health Monitoring

Reviews based on examining the techniques to measure structural vibration have been found from earlier times. The attention in monitoring civil, mechanical and aerospace structures to understand and detect the damage has been prevalent in the structural engineering field [1, 2]. Structural Health Monitoring (SHM) using vibration analysis is based on five levels, which are detection, localisation, classification, assessment, and prediction [3]. Linear and non-linear types are the two major classifications meant for structural damage. Even after the occurrence of damage, a linear-elastic structure will exist as the same, where the modal properties and variations due to geometric or materialistic changes can be demonstrated using a linear equation.

On the other hand, non-linear damage occurs when an initially linear-elastic model or structure changes into a non-linear manner after the occurrence of damage. For instance, development of a crack from wear and tear may consequently open and close under vibrating in its normal operating circumstances is a suitable example for non-linear damage. A reliable damage detection technique will be relevant to both types of damages in general [2].

As mentioned before, the process of SHM involves different steps. At first, the system is monitored over time, using a set of sensors and observations are inferred based on periodic samples of measurements of dynamic responses obtained from the same sensors. Extraction of the features is the next stage, where the features which can bring about damages are being extracted from these observed measurements. Later a statistical analysis is performed on these extracted damage sensitive features to assess the current conditions and health of the structural system. In case of long term structural monitoring scenarios, the output of such statistical process is updated regularly, in order to obtain information that substantiates capacity of the structure t smoothly o function when it is subjected to ageing and deterioration resulting from various environmental conditions.

Moreover, when the structure undergoes adverse impacts due to the occurrence of events like earthquakes or heavy loading, SHM is an emergency aid to validate the structure’s functional reliability. The collapse of the North Carolina Bridge [4] in the USA is an incident that paved the way for focusing on the structural health monitoring techniques inspired from the aspect of life-safety. Also, the advancement in wireless sensor networks (WSN) has influenced the SHM technology, which facilitates the wireless transmission of the monitored parameters, mainly featuring the remote access of the SHM systems.

2.2 Damage Detection Techniques

Centred on the works of Rytter as referred to in [1], the author groups the process of SHM into five phases:

  • Identification of damage occurred in a structure

  • Localisation of damage

  • Identification of the damage type

  • Quantification of damage severity

  • Estimation of the remaining service life of the structure.

Doebling [2] presents a recent thorough review of the vibration-based damage identification methods. He has proposed several diverse methods for the identification and localisation of damage with the aid of vibration response measuring methods. However, for real-time applications, these methodologies are subjected to certain limitations, which make them ineffective for detection of the damage at the initial stages. Thus to overcome the drawbacks of such methods, researchers have introduced statistical analyses of the structure through time series analysis.

The authors Farrar and Warden [1] have proposed a damage detection method by combining five processes which are closely interrelated to each other. This method includes:

  • Structural Health Monitoring (SHM)

  • Condition Monitoring (CM)

  • Non-Destructive Evaluation (NDE)

  • Statistical Process Control (SPC)

  • Damage Prognosis (DM).

Among these methods, SHM is generally applied to aircraft structures and buildings to detect real-time damages in the whole structural system. CM is similar to SHM, but it is deployed in assessing the damages into SHM, but addresses damage identification in rotating mechanical systems and reciprocating machinery, which are used specifically in manufacturing and power generation plants [6]. NDE is a localised offline method carried out once the damage has been traced. Apart from these, NDE is utilized in monitoring some prefabricated structures such as rails and pressure containers. For performing NDE, the general methods include the use of acoustic waves, X-rays and microscopic observatory techniques [7]. NDE is implemented and applied to smaller areas of a structure where the location of the potential damage is identified, which make it mainly useful only for analysing the characteristic of the detected damage, provided prior information regarding the damaged spot [6]. Converse to the structure-based method, SPC is regarded as process-oriented technique, where a set of sensors are used in order to monitor the variations in the carried out processes, which can provide information related to the structural damages. Damage prognosis is a different technique used after the detection of the damage, in order to estimate the remaining functional lifetime of a structural system [1].

2.3 SHM Methods in Civil Structures

The examination of the structural health of surviving structures like buildings and bridges after disastrous events such as hurricanes and earthquakes is generally time-consuming and expensive as most of the critical structural members and links are being masked under architectural surfaces. In the case of acute structures such as major bridges, power plants, hospitals, military centres and incineration plants, it is inevitable to evaluate and reassure the structural health as soon as possible [8]. Moreover, the information on such critical and catastrophic collapses should be broadcasted to the emergency services at the earliest, in order to save peoples life. Mostly, such emergency alert messages are delayed because of the weather conditions, and unreachability to the damaged locations due to the obstacles from the collapse. In most of the situations, the collapses occurring in the near future are not noticeable from outside of the structure [8].

Even though in the field of aerospace and mechanical industries, SHM has been extensively utilized, it was in the recent only attention was given to the civil infrastructures, as a result of their gradual weakening due to blast loading variations, for example. Various categories of SHM procedures have been developed for analysing the structural states. Vibration-based, strain-based, electrical impedance-based probability-based and statistical based methods [9]. In the last decade, a significant amount of research has been carried out theoretically and experimentally. Side by side, efforts have been taken to develop systems for typical seismic event damage monitoring, such as earthquakes scenarios. Those systems integrate a sensing and processing unit, a mechanism for transmission and acquisition of data and damage verifying systems together. Innovative developments in micro-scale sensors, wireless and GPS technologies and systems capable of increased calculation abilities have effectively contributed to solving the hindrances in SHM systems.

SHM is generally concentrated on damage identification, that is whether the damage has occurred or not as well as prediction of the extent of the damage. Apart from these, additional information regarding the damage, such as geometrical properties, configuration, networking, shape are not considered or considerably simplified at the time of categorising the damage sensitive characteristic features for SHM [7]. However, such parameters can be used well enough to estimate the depth of damage occurred. At present, there are several NDE techniques to detect the structural damages, but at the same time, those include expensive visual processes or experimental analysis confined to particular areas in the structure, including ultrasonic techniques, magnetic field procedures, X-ray technology and Eddy-current methods and so on. Non-destructive methods are subjected to limitations, as these require the knowledge about the damaged site in advance, provided it should be readily accessible [10]. A damage identification scheme that evaluates the non-linear features of the structure to determine the damage could be very much useful in the sense as most structural damages bring some non-linear changes in the structure [10]. To lessen the costly human intervention and complex safeguarding SHM judgements in damage characterisation processes, computational analysis with the help of algorithms are required.

2.4 Time Series Analysis

When we record some processes which change with time, we get a time series. For instance, the variation of share market prices in a short period recorded as stock exchange census is a perfect example of time series analysis. Those recordings can be observations of either continuous or discrete variable or events. In SHM, mainly discrete set of observations that changes with time are monitored using time series analysis method; those observed values are obtained at equal and regular intervals of time [5, 11]. When we analyse data at different time slots, it results in distinct problems. The sampling data is always dependent on time, and this put a limit to the use of random samples for standard statistical methodologies. Such a case, make the use of time series analysis important in statistical modelling techniques [12]. Earlier, physical and environmental science problems were solved using time series analysis. Scrutinising the recorded information plotted across time is the initial stage in any time series analysis execution [12]. By primarily analysing the recorded history of acceleration in a structure over time, the source of damage is traced. At first, a data normalisation procedure is carried out, and this process compares the detected or recorded signal with a reference signal which is closer to that of under undamaged condition of the structure [4]. For detecting and locating the damage, the most widely used statistical time series analysis method is Auto Regressive-Auto-Regressive with exogenous input (AR-ARX). The structural damage is identified or recognised based on the fact that, if the model developed through the statistical prediction of undamaged time series data measurements could not replicate or estimate the newly generated time series, then the current structure is said to be damaged [13].

2.5 Machine Learning Approach in SHM

The researcher Arthur Samuel as in [14], contributed one of the best definitions for Machine Learning as a tool to offer the computers the ability to learn without programming explicitly. It is one of the most widely used algorithms now to monitor the health of infrastructures, which includes two different types of learning methods such as supervised and unsupervised learning. When the information from both damaged and undamaged scenario is accessible, the pattern recognition in statistical modelling can come under the supervised learning method category [1]. For instance, Group classification and regression analysis are examples that fall under the supervised learning algorithm. When the information or data regarding the damaged scenario is not available, the unsupervised learning algorithm is applied in SHM systems. Novelty detection or outlier detection is the prime category of algorithms executed in the application of unsupervised learning methods. However, all algorithms above make use of the statistical modelling of findings derived from enhancing the damage detection process in SHM [1]. In order to solve the issue of pattern recognition, several machine learning algorithms are utilized. The authors Farrar and Worden [1] used neural networks, SVM (Support Vector Machines) and genetic algorithms (GA). Gaussian Classifiers, SVM, Random Forests and Adaboost algorithms are mentioned by the author William Nick and others in their research on SHM using machine learning techniques [15].

In the development of an agent-based SHM, acoustic emission signals are used, where signals are categorized according to source processes, which are accompanied by significant crack developments in the structural systems. The agent-based system can replace complex communication and computational monitoring techniques, which can respond to the circumstances immediately by proposing an appropriate set of techniques. The need to respond quickly necessitates the system to have a selection of classifiers with different features so that it can utilise a combination of those to apply for distinct situations. As mentioned earlier, unsupervised learning can detect and identify the spot of damage, whereas a supervised method can contribute information about the severity and nature of the damage [15].

2.6 Existing Machine Learning Methodologies

There are different types of learning systems, based on the aspect of learning. These include supervised learning, unsupervised learning and reinforcement learning, which will be described in detail later in this chapter. Firstly, the way of learning is essential and based on this, different strategies and algorithms are developed and following are some of the ways that a machine or learner transforms the knowledge acquired.

  • Learning by being programmed: The system learns and performs the task based on the program or code implemented by an external entity into the system [16]. Here the system is capable of working strictly within the coded ways unless the external entity modifies the program.

  • Learning by memorisation: The data or facts stored in various format is used by the system to learn the environment or task. The system is not capable of learning or performing aspects beyond the information fed in its memory.

  • Learning from examples: This is the most established method of learning, where the system learns or understands the process from previous outputs or past experiences of the working environment of a task. The previous experiences and performing conditions serve as an example to the machine which enables it to predict future outputs. The examples fed to the system can be favourable examples or counterexamples so that the system can make decisions and predict accordingly. This is considered as a supervised method of learning as there are some specific outputs or previous experiences for some specific inputs given to the system. Learning from examples is regarded to be a more efficient method to make valid inferences than learning from instructions or by being programmed type [17].

  • Learning from observations: Here the system uses the observations to discover and form theories, analyses and classify the information gained through observations and so on to learn and arrive at inferences [16]. Learning from observation is an example of unsupervised learning as there are no specific set of inputs and corresponding outputs, i.e. the system learns without supervision or an external entity who act as a teacher.

3 Methodology

This section discusses various methods planned in accomplishing the development of an effective Structural Health Monitoring system with the help of Artificial Intelligence (AI) techniques like Machine Learning, to improve the damage detection in SHM systems. The proposed methodology for this research is using experimental analysis and applied research, which tries to analyse the findings (available on the internet for use by the research community) of an experiment conducted at the Engineering Institute (EI) located at Los Alamos National Laboratory (LANL), USA, in partnership with the Laboratory for Concrete Technology and Structural Behaviour (LABEST) of the Faculty of Engineering of the University of Porto (FEUP), Portugal on structural health monitoring, where time series analysis is carried out to detect the damages in civil infrastructure. Also, the project’s primary focus is to apply machine learning techniques in order to improve the damage detection process. For this, an existing database with results of damage detection from the experiment as mentioned above using time series analysis is utilised. A set of training data is to be created from the stated database to perform machine learning (ML) methods such as supervised and unsupervised learning techniques.

3.1 Experimental Setup at LANL [10]

According to [10], a three-storey building prototype shown in Fig. 1 is created for the experiment, and linear and non-linear impacts are introduced repeatedly with the help of a bumper mechanism. The three-storey test structure is made from unistrut columns and aluminium floor plates [10]. Floors consist of 0.5 in. thick plates of aluminium with two-bolt connections to brackets on the unistrut column, with an adjustable mechanism for the floor heights. An aluminium plate of 1.5 in. thick forms the base, and support brackets for the columns were also bolted to this plate. All bolted connections were stiffened to a torque of 25 Nm in the undamaged state. At the bottom of the base plate, in order to introduce free horizontal displacement, four firestone air-mount isolators were fixed. In order to maintain the level of the base with the shaker, isolators were assembled on aluminium blocks and sheet of wood. The isolators were inflated to 10 psi. The shaker was connected to the structure of a 6 in. long stinger with a diameter of 0.375 in., which is connected to a hole in the base plate at a mid-height. For the proper excitation of torsional and translational motion, the shaker was connected 3.75 in. apart from the corner of the 24 in. side of the structure.

Fig. 1.
figure 1

Side view and top view of the assembled three-storey structure in LANL Lab [10]

In this experimental setup [10], the damage is introduced by relaxing the preloads applied by the bolts at the joints of the building structure. A “healthy” joint is held together by bolts that are torqued to a value of 25 Nm. In order to test the sensitivity of the damage detection ability, multiple levels of damages are introduced in the structure. There are 24 piezoelectric accelerometers with two at each joint and one linked to the plate and other attached to the column. The configuration in [10] enables the detection of relative motion of the column with respect to the floor. Each accelerometer is having a minimum sensitivity of 1 V/g. In order to facilitate the digitising of the accelerometer and to force the analog signals from the transducer, a data acquisition system which is accessible from a laptop or PC is used.

3.2 Steps in Conducting the Test

The test structure mentioned above is analysed using an SHM damage detection process which is the focus of this study. SHM involves the following four progressions based on a statistical pattern recognition paradigm [18]:

  • Operational evaluation

  • Data Acquisition

  • Feature extraction

  • Statistical modelling for feature classification.

Operational evaluation involves assessing the parameters that facilitate the computing of the possible extends of damage occurrence and extent of damage in the deployment of Structural health monitoring systems. In real cases, monitoring of structures requires consideration of operational and environmental effects. Temperature changes sometimes generate more significant changes in parameters than the effect of damage in the early state. Thus it becomes difficult to distinguish between the two causes [19]. This stage also constitutes the modifications in SHM characteristics to be streamlined to monitor the distinct features of the damage identification system. The data acquisition step includes the selection of application specific processes such as data collection, processing, transmission and storage and so on, along with the excitation scenario that comprises the information regarding the type, number and location of the sensors assembled in the structure. These aspects will not add in determining the existence of damage or measuring the damage, whereas the data acquisition and sensing activities compare and measure the response to the excitation mechanisms or to the loads the structure subjected from the environment and operating conditions. The sensor outputs, which are associated with the nature of damage to be detected and the underlying sensor technology utilised can provide information about the occurrence and location of the damage [20].

The next stages Feature extraction involves analysing the damage sensitive features from the recorded sensor output measurements to predict the damage conditions of the structure. That is to differentiate damaged and undamaged structure using SHM. The extracted Damage Sensitive Features (DSF) are classified based on the statistical modelling techniques utilised with the help of algorithms such as machine learning to evaluate the damaged condition in detail [20]. Theoretically, when the extent of damage increases, DSF that holds the changes of structural properties [21] will increase, will be converted in some logical manner. The damage detection and localisation approach based on the residual forces method was used successfully by some researchers to locate structural damage based on an analytical model for damage identification [22].

3.3 Supervised ML Algorithms Used

As we know, machines are generally designed to perform tasks effortlessly. Humans are capable of classifying and recognising various aspects, which a machine cannot do in general. In some cases, humans can perform some tasks like speech or handwriting recognition without efforts. However, it might be difficult for them to explain how they recognise the differences. Machine learning algorithms are strategical techniques designed to fill the gap of perceiving or understanding how the task was carried out [23]. A machine or computer can learn or understand the aspects behind a task such as recognition or classifying through machine learning algorithms. Different individuals perform the same tasks differently according to the situations and their capacity of intelligence. Similarly, based on the application and the scenarios, many machine learning algorithms can be implemented through a computer to perform simple to complex tasks beyond human limits. In this project, we mainly focused on supervised learning algorithms. Following are some commonly used algorithms that come under supervised mode in a machine learning algorithm.

  • KNN classifier

  • Support Vector Machine

  • K-Means Clustering

  • Random Forest

  • Neural Networks

  • Bayesian.

Among these, for improving the damage detection method in structural health monitoring, we utilised three algorithms, namely KNN classifier, Support Vector Machine and Random Forest as described below. ML algorithm classification in MATLAB is shown in Fig. 2.

Fig. 2.
figure 2

ML algorithm classification

K-Nearest-Neighbor Classifier (KNN). KNN is one of the most widely used supervised learning algorithms for pattern recognition. It is considered to be one of the modest learning algorithms in machine learning when no prior knowledge of the learning environment is available or when the available knowledge is at a minimum level. The K-Nearest Neighbour algorithm works on the principle that objects or examples in a training sample that are closer to each other have similar characteristic features [24]. The nearest neighbour rule is shown in Fig. 3.

Fig. 3.
figure 3

Nearest neighbour rule

In KNN, the classification of examples occurs in accordance with the class of their ‘k’ closest neighbouring examples.

For an optimum value of k, this conventional classifier independent of specific parameters shows good performance levels in a learning environment. According to the k-nearest rule of the neighbourhood, a data sample is assigned a class label with the most frequent occurrence among the k-nearest test samples or examples. When there are two or more similar classes, the sample is assigned class labels that possess minimum average distance to it [25]. For example, if a bird looks like a duck make sounds like a duck and walk like a duck, and then it is probably a duck only. Although there are different means to evaluate k-nearest neighbour, the most regarded method is the classification based on estimating the Euclidian distance because of its ease in use, better productivity and efficiency.

The Euclidian distance between two vectors Xi and Xj can be calculated as shown in Eq. (1) [25], where \( {\text{X}}_{\text{i}} = {\text{ X}}_{\text{i}}^{ 1} ,{\text{ X}}_{\text{i}}^{ 2} ,{\text{ X}}_{\text{i}}^{ 3} \ldots {\text{X}}_{\text{i}}^{\text{n}} \) and \( {\text{X}}_{\text{j}} = {\text{ X}}_{\text{j}}^{ 1} ,{\text{ X}}_{\text{j}}^{ 2} ,{\text{ X}}_{\text{j}}^{ 3} \ldots {\text{X}}_{\text{j}}^{\text{n}} \).

The difference, Euclidian distance,

$$ {\text{D = }}\surd \mathop \sum \nolimits_{k}^{n = 1} (xik - xjk)2 $$
(1)

KNN classifier is also called by the name instance-based classifier, as it can perform in learning environments where unknown instances can be classified based on the neighbour distance function. KNN algorithm is powerful and easy to implement, while at the same time, it is not considered to be suitable for data sets with larger dimensions. It is also known as a memory-based classifier as it necessitates the storage of all training examples in the memory of the learner at the time of running the algorithm.

The nearest neighbour rule, in its simplest form, is when the value of ‘k’ equals 1. Depending on the value of ‘k’, each sample is compared to find similarity or closeness with ‘k’ surrounding samples. In short, when k = 1, each sample is classified by comparing it with one nearest sample. When k = 4, the individual samples undergo comparison with the nearest four samples in and hence the unknown one is classified accordingly. Following is a simple example of a KNN algorithm [26].

figure a

Figure 3 illustrates the nearest neighbour rule for k = 1 and k = 4, where samples are labelled into two different classes (red and green). As shown in Fig. 3, in the second case, when k = 4, out of four samples, three of them fall into the same class and only one is under a different class. Estimating the neighbourhood value k is crucial as different values of k can produce different probable outcomes in classification [26].

If the k value is minimal, the query sample may fail to find any nearest neighbour as it could get into some mislabelled noisy data points. On the other hand, a large k value may result in overlapping of invalid samples from other classes, which in turn makes the classification technique much tougher. Thus, the KNN classifier performance is evaluated based on the selection of the parameter ‘k’.

Support Vector Machines (SVM). SVM is one of the most widely utilised machine learning algorithms in the supervised mode for applications such as pattern classification, forecasting and decision-making tasks. SVMs are deployed by making use of randomised training set instances or samples which are categorised in advance [27]. SVM was the first algorithm which evolved from a kernel based system, where samples from input environment are transformed into a multidimensional feature space with the help of a kernel function by creating a hyperplane that separates the training data samples for the classification process. Some of the primarily used kernel functions [27] to convert the input space into corresponding feature space includes Linear functions, Polynomial functions and Radial Basis Functions (RBF).

As mentioned previously, the SVM model uses a hyperplane to separate or classify two or more classes of data samples, where the focus is to maximise the underlying margin between the data samples [28]. For a data sample of lower orders, with two classes, the hyperplane is a straight line (as seen in Fig. 4) that separates the two classes with a marginal distance, whereas in a training set with multi-dimensional samples, the hyperplane becomes a plane as the name suggests. The primary goal of an SVM classifier is to figure out an optimal hyperplane between the classes, where a hyperplane is said to be optimal if it is capable enough to separate the classes with the largest possible margin. The data samples that lie along the marginal line are termed as support vectors, as they serve as the means to classify the dissimilar classes.

Fig. 4.
figure 4

Hyperplane illustration

Fig. 5.
figure 5

Comparison of accuracy of ML algorithms.

SVM is a quadratic programming algorithm in convex nature, as it optimises the parameters globally rather than performing time-consuming local optimisations, which is done in the case a concave function [27]. Hence SVM optimises the linear parameters in a training set on a global basis to arrive at inferences at a faster rate. There are two major parameters set to SVM classifier, which includes smoothness parameter γ and penalty parameter C in a radial-based-function [27]. The smoothness parameter decides the functional mapping of space inputs into multidimensional features, whereas the model complexity and minimising the error in fitting the classifier is influenced by the penalty parameter. Support vector machine algorithm finds its application in areas like image classification, handwriting recognition, face detection, pedestrian detection and diagnostics of tumours from scanned results. SVM is found to produce good results on a smaller set of training data sets, whereas for a huge data sample it consumes more time, thereby making the computational cost high. Moreover, SVM is regarded as a less effective method in environments were overlapping of classes occurs which makes the dataset noisier.

Random Forest Classifier Algorithm. A Random Forest Classifier (RFC) is an ensemble algorithm under the supervised method of machine learning, where the term ensemble indicates that the samples are analysed as a whole or a group rather than viewing them individually. The fundamental classifiers used in RFC algorithms are decision trees, where many decision trees are produced to perform classification. The aspect of random sampling is carried out in two stages [29].

Firstly, for bootstrap samples, which are used for introductory processing of algorithms, are sampled randomly, and secondly, input attributes for individual decision trees are also sampled randomly. The major aspect of random error generalisation in RFC is based on the correspondence of individual decision trees with the base tree used for classification [29].

RFC is regarded to be well suited for a large number of datasets. RFC also can manage the missing data samples while processing a huge dataset by effectively estimating them, by evaluating the generalisation errors, where the generation of decision trees occurs concurrently in a progressive manner. RFC model is deployed in a wide range of areas, which includes, texts classification and extraction, arranging books in a library according to various specified categories, statistical analysis in stock markets, diagnosing various medical conditions such as heart failures, cancer and tumours from scanned outcomes, liver failures and so on.

The decision tree structure is inspired or framed based on the features of a normal tree in nature, which consists of a root, branches and leaves. Similarly, a decision tree starts with a root and moves in the downward direction, which is divided into circular nodes interconnected with branches or segments and nodes are ended or terminated at leaf nodes [30]. A node indicates some features, where the branches indicate the range of information. The branches or segments that contain the range of values serve as the separation points for a group of samples with specific characteristics. Depending on the data samples and learning environment, the number of branches evolving from a node can be different. Pre-classified data samples are used to generate Decision trees; the classification of samples into the different class is primarily based on some characteristic features that divide the data into the finest levels. The process of tree generation continues until all the samples in a subset fall into the same class.

The decision trees are built based on the parameter kn which indicates the number of points to be estimated on the leaf nodes. The value n denotes the training set size, which determines the minimum size of a leaf node.

In the next section, we consider the implementation of the above methods in SHM.

3.4 Experimental Evaluation and Implementation of ML in Structural Health Monitoring

To implement the ML in SHM, as mentioned in the introductory section, the database from the Los Alamos National Laboratory (LANL) resulted from the testing of a three-storey building bookshelf-like structure is used in this work. The test database includes a large number of files produced through the time series analysis experiment. Out of the 24 channels, which represent the outputs from the 24 accelerometers located, two each in the four corners of each storey of the three-storey bookshelf structure gives out a resulting data set of size 26 × 8192 data samples, where 2 channels were found to be of extra information, which is mentioned briefly in the following training data set preparation stage.

3.5 Training Data Set Preparation

Here, the damage sensitive features are extracted from the collected database, in order to do statistical analysis by implementing the ML technique. There are separate data sets for the two cases, Damaged and Undamaged condition at 8192 test instants with input voltages 2 V, 5 V and 7 V applied to the accelerometers to check and ensure the repeatability of the experiment. Among these, for preparing the training set, a data set corresponding to the 2-V application on accelerometers is used. The data set features were extracted carefully as there were some wrong outputs as the channel nine did not work properly and channel nine sensor outputs were recorded later on channel 26. Also, channel 25 represented time stamps for test instances, which is considered to be insignificant while preparing the training set. So channel 25 was removed, and channel 9 was replaced with channel 26 data in the data cleaning process. For implementing a predictive model, the features needed to be classified with class labels. Damaged and Undamaged data sets were combined to form a training data set of 25 × 16,384 with the class labelling shown in Table 1 below.

Table 1. Labelling classes

Thus a combined data set matrix of 25 × 16,384 briefly illustrates the following information:

25 columns::

Column (1–24) represents 24 sensor output channel & column 25 for Class labels.

16384 rows::

Represents test instances. Rows (1-8192) indicate Undamaged test results and (8193–16384) with Damaged ones

3.6 Training and Applying ML

Python programming language is used to implement the ML and corresponding Python codes used are mentioned in each step of training and modelling. The sample input and its responses are represented by vector X and Y, respectively, where X includes the input accelerometer sensor outputs, and Y is the response represented as Damaged and Undamaged. Out of the total data samples, as in most ML algorithm implementations, 80% of the data is generally used for training purposes, and 20% for testing the model, i.e., the training and testing split ratio is 0.20. The seed value represents a random number generator factor, which initiates the training according to the split size ratio.

figure b

There are three machine learning algorithms used to test the trained data, which includes K-Nearest Neighbour (KNN), Support Vector Machine (SVM), and Random Forest Classifier (RFC). The following are the steps in Python that define each classifier.

figure c

After setting up the classification model, the fitting of the model is done. For instance, we use the svm.fit () function to generate fitted values from the past data samples by extending them, in order to make predictions for the unknown samples. In the evaluation of the models, the accuracy of each classifier model is estimated with the help of confusion matrix and classification report which are explained in detail in the results section next.

4 Results and Discussion

4.1 Confusion Matrix

A confusion matrix is generated in each modelling, which summarises the prediction results in a matrix form. The data set values used for testing is represented in count values, and it is indicating the confused stage of the model while making predictions. A confusion matrix is generated in the following format using Python code:

Confusion_Matrix = confusion_matrix (Y_test, predictions)

$$ \begin{aligned} & [\left[ {{\text{TP}} \,{\text{FN}}} \right] \\ & \left[ { {\text{FP }}\,{\text{TN}}} \right]] \\ \end{aligned} $$

The confusion matrix generated for SVM is given below as a reference:

Confusion Matrix

$$ \begin{aligned} & [\left[ { 10 6 1 \, 5 3 9} \right] \\ & \left[ { 8 8 { }\, 1 5 8 9} \right]] \\ \end{aligned} $$

The row of a confusion matrix signifies the predicted class, and the column of the matrix indicates the actual class. The elements or count value in a confusion matrix are:

  • TP: True Positive values; Actual class was True, predicted correctly as True (Damaged predicted as Damaged)

  • FN: False Negative values; Actual class was True, predicted wrongly as False (Damaged predicted as Undamaged)

  • FP: False Positive values; Actual class was False, predicted wrongly as True (Undamaged predicted as Damaged)

  • TN: True Negative values; Actual class was False, predicted correctly as False (Undamaged predicted as Undamaged).

The efficiency of the model increases as the number of False Negatives (FN) and False Positives (FP) reduces. So a good predictive model classifier makes good predictions by avoiding FN & FP.

4.2 Classification Reports

Classification report is another means that evaluates the performance of a supervised classifier. The classification reports for three ML algorithms used in this project are described below

Classification report is obtained by using the below mentioned Python code

$$ {\text{Classification}}\_{\text{Report }} = {\text{ classification}}\_{\text{report}}\, \, \left( {{\text{Y}}\_{\text{test}}, \, \,{\text{predictions}}} \right) $$

A classification report includes the following parameters:

Precision. Precision is defined as the ability of a classifier not to predict any false value of a class as True. In other words, how precisely the model predicts the true class values as a true and false class as false. In an SHM context, if we consider the precision for a damaged class for Random Forest Classifier 0.94, it means the model successfully predicted 94% of damaged conditions correctly as damaged itself, out of the total number of damaged predictions made. The ‘precision’ factor can also be calculated manually from the confusion matrix as follows:

For RFC Confusion Matrix:

$$ \begin{aligned} & [\left[ { 1 4 4 5 \, 1 5 5} \right] \\ & \left[ { 9 1\, 1 5 8 6} \right]] \\ \end{aligned} $$

Precision is also described as the ratio of true positives to the overall number of positive predictions made.

$$ \begin{aligned} {\mathbf{Precision}} & = {\text{TP}}/ \, \left( {{\text{TP }} + {\text{ FP}}} \right) \\ & = 1 4 4 5/ \, \left( { 1 4 4 5 { } + { 91}} \right) \\ & = {\mathbf{0}}.{\mathbf{94}} \\ \end{aligned} $$

Recall. The Recall factor is the ratio of true positives to the overall number of predictions made in that specific class. It is also called the sensitivity of the classifier- that is the ability to find all positive predictions of a class. The recall for a damaged class in RFC is computed as follows.

$$ \begin{aligned} {\mathbf{Recall}} & = {\text{TP}}/ \, \left( {{\text{TP }} + {\text{ FN}}} \right) \\ & = 1 4 4 5/ \, \left( { 1 4 4 5 { } + { 155}} \right) \\ & = {\mathbf{0}}.{\mathbf{90}} \\ \end{aligned} $$

f1 Score. This value is derived using the precision and recall values, where a calculated weighted harmonic average or mean of precision and recall gives the f1 score. For an ideal classifier, the f1 score will be 1. The value of f1 in its worst or minimum state is 0. f1 score is used to evaluate the efficiency of a model, similar to the accuracy of the classifier.

$$ {\mathbf{f1}} = 2*\left( {{\text{Recall}}\, \, *\,{\text{ Precision}}} \right) \, / \, \left( {{\text{Recall }} + {\text{ Precision}}} \right) $$

Support: This gives the number of true values belonging to the particular class. The total numbers of support for both classes together form the testing data (20% of the entire dataset), obtained by splitting the data set to train and test the models.

KNN, SVM and RFC classification reports are shown in Tables 2, 3, and 4, respectively.

Table 2. KNN classification report
Table 3. SVM classification report
Table 4. RFC classification report

4.3 Results Interpretation

The results obtained from the ML classifier models are interpreted to conclude. For this, the precision-recall curve, Damage Prediction comparison charts and Accuracy charts are used.

Comparison of ML algorithms – based on predictions. The precision-recall curve explains how good the classifier model is. For an ideal or best classifier, the precision and recall value will be the one as shown in Fig. 6(a). A precision-recall curve is obtained by connecting the points marked according to each classifier with the value best value of precision and recall, i.e., 1. When comparing the obtained precision-recall curve as shown in Fig. 6(b) for the three ML algorithm model classifiers, Random Forest Classifier is found to be the most efficient classifier than the Support Vector Machine and K-Nearest Neighbour. KNN shows a moderate performance and SVM shows less performance when compared to KNN and RFC.

Fig. 6.
figure 6

Precision-recall curve: Ideal (a) vs Obtained (b).

RFC made a good number of predictions among all the classifiers. Here the number of true positives, where exact damaged predictions were accounted for 1445 out of the total number of observations used for testing the model. Similarly, several true negative predictions, that is undamaged predicted exactly as undamaged was more found in KNN classifier. SVM predictions were intermediate between both KNN and RFC. False positive predictions were found the minimum in the case of KNN as only 27 numbers of undamaged observations were predicted as damaged. Also, false negatives were seen as the minimum for RFC, where the number of damaged samples predicted as undamaged was only 155. Overall, Random Forest Classifier is considered to be a good classifier from the above interpretation.

Comparison of accuracy of KNN, SVM, RFC algorithms. Figure 5 above shows the graph that compares the accuracy of the three ML algorithm classifiers used for this study. Accuracy is the major parameter used in order to compare and evaluate the performance or efficiency of one or more classifiers. It is the ratio of correct predictions to the total number of predictions made by a classifier. Accuracy is expressed in percentage or decimal formats. In Python, the accuracy is generated using the following code.

$$ {\text{Accuracy }} = {\text{ accuracy}}\_{\text{score}}\;\left( {{\text{Y}}\_{\text{test}},\,{\text{ predictions}}} \right) $$

Accuracy is calculated theoretically by using the following formula:

$$ {\text{Accuracy}} = {\text{ TP }} + {\text{ TN }}/ \, \left( {{\text{TP }} + {\text{ TN }} + {\text{ FP }} + {\text{ FN}}} \right) $$

Among the above three classifiers, the RFC gives the highest percentage of accuracy of 0.92 or 92%, where, SVM and KNN showed an accuracy of 80% and 85%, respectively.

5 Summary and Conclusion

In this paper, we have discussed some aspects of Structural Health Monitoring (SHM), primarily the implementation of Machine Learning in SHM in an attempt to improve the damage detection techniques. With the help of relevant literature that describes SHM, we discussed different damage detection methods and methods adopted on civil structures to monitor those. A brief explanation of Machine Learning (ML) techniques and its classification is provided. An experimental setup available in the literature was described in detail in the methodology along with a thorough explanation and implementation of three supervised learning classifiers KNN, SVM and RFC. An existing database from the experiment conducted on a simulated three-storey building model at the Los Alamos National Laboratory (LANL) in partnership with the Laboratory for Concrete Technology and Structural Behaviour (LABEST) of the Faculty of Engineering of the University of Porto (FEUP) on SHM was used to demonstrate the use of ML. Python programming language was used to implement the ML algorithms, and results were analysed using Excel and MATLAB software. According to the results obtained among the three ML classifier models used for damage detection, Random Forest Classifier algorithm generated good predictions on damaged and undamaged conditions with good accuracy, when compared to K-Nearest Neighbours algorithm and Support Vector Machine algorithm under the supervised mode of machine learning.