Immune system inspired smart maintenance framework: Tool wear monitoring use case

As manufacturing industry is moving towards the fourth industrial revolution, there is an increasing need for smart maintenance systems which could provide manufacturers a competitive advantage by predicting failures. Despite various eﬀorts by researchers, there are still challenges for these systems to work reliably in industry such as lack of adaptability, resilience, reaction to disturbances and Future-prooﬁng. Bio-inspired frameworks like Artiﬁcial immune systems provide an alternative approach in satisfying these challenges. But existing immune based frameworks focus only on adaptive immunity characteristics and ignore innate immunity which is important for quick detection and faster response. There is a need for a holistic view of the immune system in developing a adaptive & resilient maintenance framework. This paper presents a holistic view of the human immune system with focus on the intelligence & response mechanism of both innate & adaptive immunity. Inspired by this holistic view and considering the emerging computer technologies - Internet of Things, Edge & Cloud computing, Multi-Agent system, Ontology, Big Data, Digital Twin, Machine learning and Augmented Reality - we present


Introduction
The emerging trends in computer science especially in technologies related to sensing, storing, computing, data analysis and visualization, have paved the way for the fourth industrial revolution.The impact of this revolution in manufacturing along with the trend for highly automatized and customized production has drawn interest towards developing smarter maintenance systems.A system which could predict failures and proactively plan maintenance activities will provide manufacturers an advantageous edge in the market as maintenance activities account for 15% of the total cost of an organization [1].A predictive maintenance system could reduce 50% downtime, 40% of maintenance costs and 3-5% of capital investment [2].These estimates have encouraged manufacturers to invest in developing a smarter maintenance system (estimated market size of $23 billion in 2026 [3]).An intelligent maintenance system does three activities -monitoring, diagnosis and predict Remaining Useful Life (RUL) [4].
Emerging trends like Big-Data, Internet of Things, Machine Learning, Cloud computing and Digital Twin had considerable research impact in maintenance activities (See Table 1).Big Data frameworks focused on data mining based on spatiotemporal properties [5] or models based on machine learning and heuristic algorithms [6] have been developed to predict machine failures.Some researchers focused on developing deep learning modules considering impulse response of the machine by analysis the machine vibrations data [7].The lack of breakdown data has encouraged utilization of Digital twins, where virtual models are trained using unsupervised deep learning and later transferred to the real world using deep transfer learning [8].Multi-domain models -physical, simulation and experimental -have also been used for predicting machine conditions [9].Other works include predictive maintenance solutions based on Multi-Agent Systems [10], Cloud Computing [11] and Internet of Things [12].Most of the research works mentioned above validated their framework on machine wear mechanism (tool wear or ball screw wear) [5][6][7]9].Tool wear monitoring accounts for 20% of the machine downtime [13] and 3-12% of a machine's processing cost [14].Hence an effective tool wear prediction methodology reduces the effect of tool breakage & maximize usable life (30-50% of tool life is wasted due to early tool replacement [14]).
Despite many research work being carried out for developing smart maintenance frameworks, few challenges still exist.The developed framework lacks the required ability to learn and adapt to complex systems.Resilience and Anti-Fragility are new desirable characteristics of a maintenance system and very few frameworks address these characteristics.Also, these frameworks depend heavily on few of the emerging computer technologies.There is a need for the integration of these technologies and a future proof framework which could be used for the technologies developed in the future.There also exist some application and practical issues like most of the research work on predictive maintenance assumes that the data are already labelled and the model is developed based on the labelled data.There exist a lack of breakdown data for expensive and highly reliable equipment and hence it is a time consuming task to obtain these labelled data.Most of the labelled data involve human experience, but in an ever-complex manufacturing system this dependency could lead to in-accuracy and false prediction.
Bio-inspired approaches could aid in developing future proof maintenance framework as these system are based on evolutionary mechanisms adapted and evolved over millions of years and present a near perfect complex systems.Recently researchers have focused on developing such frameworks especially based on human immune systems.Existing work has focused mainly the 3 main mechanisms of immune system: danger model [15,16], negative selection [17][18][19] and clonal selection [20,21].Although, these frameworks provide some solution in developing an adaptive framework they do not provide the holistic view of the immune system -considering both innate & adaptive immunity.The focus is mainly on the adaptive immunity with very less focus on the innate immunity.Innate immunity is essential for quick detection and response, which also helps in reducing the need for triggering the more resource expensive adaptive immunity with specialized defense mechanisms.Hence, there is a need to mapping the entire immune system, provide a more holistic view which might give valuable insights in developing an adaptive and resilient maintenance framework.
This paper aims to present an immune based smart maintenance framework based on a holistic view of the human immune system -considering both innate & adaptive immunity.The developed framework presents a solution in integrating the existing computer technologies like Internet of Things, Edge & Cloud computing, Multi-Agent System, Ontology, Big Data, Digital Twin, Machine learning (ML) and Augmented Reality (AR).A subset of the developed frameworks was then implemented for a tool wear monitoring framework.Section 2 presents the related work on maintenance frameworks developed using emerging technologies and the immune based maintenance frameworks.The proposed smart maintenance framework is presented in the next section (Section 3).The implementation of the framework for tool wear monitoring in presented in section 4 and concluding remarks in section 5.

Related Works
This section gives a brief overview of the related works on maintenance frameworks with focus on the emerging technologies and immune based maintenance frameworks.

Smart maintenance frameworks
The advances in computer technologies have aid researchers in developing smart maintenance frameworks.These smart maintenance systems predict failures in advance and support in the maintenance decision making.These could be achieved through three different approaches -mathematical model based, simulation based, and data driven approaches.These approaches are implemented using emerging technologies some of which are listed below, 1. IoT and Cloud: Sensors as Internet of Things (IoT) along with data transfer and storage technologies like Cloud technologies have aided in the transmission and processing of real time shop floor data.2. Machine Learning: Advances in mathematical and statistical models along with the use of ML algorithms have aided in accurate prediction of machine conditions and maintenance requirements.3. Big Data: The ability to collect, transmit, store, process & visualize large amount of data from the shop floor has helped in effectively utilizing advanced machine learning and data visualization techniques and accurate maintenance decisions.4. Multi-Agent System: The use agents with ability to perform it's task independently and also collaborate with other agents in achieving collective tasks has helped in developing a robust and decentralized maintenance system 5. Digital Twin: Virtual representation of a physical world has helped in developing simulated environments for testing the system before failures and the ability to remotely access the physical world.6. Augmented Reality: The use of AR has aided the operators in understanding machine condition in real-time and also make necessary changes with adaptive instructions.
Table 1 lists highly cited publications on smart maintenance framework using emerging technologies in the last half decade.

Limitations of existing frameworks:
The emerging technologies have high potential in developing a smart maintenance system in satisfying the new requirements like robustness, adaptability, resilience, anti-fragility and proactivity [52].There exists a need for integrating these technologies to fully utilize their combined benefits.Also, all the developed approaches depend on these current technologies and is not based on a future proof framework.There is also a need for a future proof framework which could easily adapt to newly developed technologies and also satisfy new smart maintenance requirements.

Immune System based frameworks
An immune system-based maintenance framework is a concept that applies the principles of the human immune system to the maintenance and upkeep of manufacturing equipment and processes on the shopfloor, by identifying and responding to anomalies, defects, and failures.Human Immune System : Human immune system is one of the largest, complex and wide spread organ systems found throughout our body.A network comprising of 21 different cells & 2 protein forces, 2 large organ (Thymus & spleen), hundreds of tiny organs (lymph node) and a large transport system (lymph vessel).Started evolving from around 3.5 billion years ago, Human immune system protects human from attack by billions of bacteria, viruses & fungi and from cancerous cells from within us every day [53].
Artificial Immune System : Inspired by human immune system, Artificial immune system is a wide area of research in engineering for abstracting, designing, developing and implementing models using techniques like mathematical algorithms and computational modelling [54].The fault diagnosis in sensory networks was one of the first implementation of artificial immune systems in engineering [55].The field of study comes under the scope of complex adaptive system with dynamic network of interactions with hard to predict the system behaviour considering individual components.
Immune system based maintenance framework: The immune based maintenance framework developed so far consider some immune mechanisms in developing a predictive and adaptive system.3 main mechanisms considered are listed below, 1. Danger Model: The healthy cells which was damaged due to the intruders/infected cells sends panic signals which is attracted by the Dendritic cells and these cells collects a sample of the intruders (antigen) for selecting the appropriate T-cells.

Negative selection: T-cells are designed to identify the difference between
the body cells and infected/foreign cells.This knowledge is crucial is preventing the immune system from attacking healthy human cells.3. Clonal selection: Once a specific B-cell is identified by the T-cell, the Bcell starts producing copy of itself (cloning) and the cloned B-cells produce antibodies which help in attacking the intruders.
Table 2 lists highly cited publications which uses immune system as the base for developing a fault diagnosis and maintenance system.Very few paper tried to develop a framework considering more than one immune mechanism.Laurentys et.al. [15] developed a decision support system considering negative selection and danger model where immune response was triggered by alarms.The same author in a later publication [56] presented a zero sum balance mechanism for identifying harmful activities by considering natural killer cell activation & education.Araujo et.al. [57] showed a framework for a "self" and "non-self" dynamic pattern recognition model inspired by negative and clonal selection.Thumati et.al. [58] developed an online approximator for fault detection in axial piston pump by using negative selection and memory cell intelligence capabilities.In an monitoring application outside of shop-floor, Chen et.al. [21] demonstrated an adaptive immune response pattern recognition algorithm based on negative & clonal selection for detecting structural damage pattern in steel bridge structure.Limitations of existing frameworks: Proposed frameworks considers the interaction between 2-3 cells (Immune system consist of 21 different cells and 2 protein forces) which doesn't provide the full picture of the human immune system.In fact, immune system protects us by providing two types of immunity -Innate & adaptive.All the proposed mechanisms in the literature focuses on the adaptive immunity.Innate immunity is essential for quick detection and response, which also helps in reducing the need for triggering the more resource expensive adaptive immunity with specialized defense mechanisms.Hence mapping the entire immune system provide a more holistic view which might give valuable insights in developing an adaptive and resilient maintenance framework.

Immune system based Maintenance Framework
An immune system-based maintenance framework involves designing a system that can detect and respond to anomalies and potential failures in a proactive and adaptive manner, drawing inspiration from the principles of the human immune system.

Immune system -Holistic View
As mentioned in the previous section, the existing literature review does not consider a holistic view of the Immune system.Understanding the human immune system in its entirety will help in providing valuable insights in developing a immune based maintenance framework.The human immune system is the second most complex system in the world after human brain and hence, here a simplified overview of the immune system is presented with focus on the key ideas required in developing the maintenance framework.The entire immune system neutralizes three types of disease cells -Parasitic worms, pathogens and infected cells.The description below focuses only on attack of pathogens(See Fig. 1).Similar immune mechanism is utilized in the attack of the other two types of disease cells.Each cell has one main job and maximum of 3 secondary duties (For example, Macrophages main job is to kill the pathogens and secondary duties to communicate and activate other cells) [53].
Innate and Adaptive : The human immune system monitors and maintains our body in difference stages and has a system of various cells for specific tasks.These cells protect us by providing two types of immunity -Innate & Adaptive immunity.The innate immunity exists when we were born and have general purpose cells to attack all pathogens.The adaptive immunity consists of specialized cells what have targeted attack on the specific pathogens and have very high impact on the pathogen they are designed for.
Innate Immunity : Innate immunity is the first line of defense against pathogens and it is present from birth.It is a non-specific response that does not differentiate between different types of pathogens.When the human body is attacked by a pathogen, the pathogen double their numbers about every 20 minutes and start damaging the body by changing the environment around them [53].The damaged cells signal and activate the innate immunity.The innate immunity cells -Macrophages, Neutrophils and complements -try neutralizing the attack cells by swallowing the intruder, trap its inside membranes & break down by enzymes and by releasing toxins.In most cases, the innate immunity is enough for suffocating an attack.In an attack from a more stronger pathogen, the dendritic cells are activated to collect samples (antigens) from the pathogens and to move to the next stage of the immunity [15].
Adaptive Immunity : Adaptive immunity, on the other hand, is a more specialized and targeted response.It develops over time in response to exposure to specific pathogens.The dendritic cell in the lymph node identifies the correct helper T-cell for the task and activates it [64] .This initiates a chain reaction as the helper T-cell duplicates thousands of times -to support macrophages & activates a specific virgin B-cell.The activated B-cell clones, produces antibodies (little proteins that binds the surface of pathogens) and saturates the body from the attack of the pathogens [65].Some T & B cells are converted into memory cells for encountering an attack in the future.
The main difference between innate and adaptive immunity is that innate immunity is non-specific and present from birth, while adaptive immunity is more specialized, takes time to develop, and is tailored to attack specific pathogens.Innate immunity provides immediate protection against a wide range of pathogens, while adaptive immunity provides long-term protection and memory against specific pathogens.The Dendritic cell with the collected antigen decides to activate antivirus/bacteria cells (here, anti-bacteria attack is required).Dendritic cells then search for a virgin helper T cell that can bind the antigen which the dendritic cell has on its membrane.The T-cell has the ability to identify the difference between human cell & pathogen to avoid attacking the human cell [66,67].The T-cell later identifies a similar B-cell for the task.
Innate and Adaptive Response : In innate response, the macrophages (huge cells with around 21mm in diameter) attacks up to 100 intruder each by swallowing them whole, trapping them inside a membrane and break them down by enzymes.They also cause inflammation (complement) by ordering the blood vessels to release water into infected area.The complement stuns and kills the bacteria by ripping holes in them.Neutrophils fight by releasing toxins (some toxins even kill healthy body cells) which generate barriers that trap and kill the bacteria.They are later destroyed to prevent from causing damage to body cells.
As part of adaptive response, the T-cells provide support to macrophages by providing chemical signals.The cloned B-cells produce antibodies [68] (around 2000 antibodies/sec) which saturate the battlefield by pinching and stunning the bacteria, making them defenseless for the macrophages.Libraries and Memory Support : The adaptive immune cells are specially designed to resist attack from all the disease that exist or might come into existence in the future.These cells are designed, trained and stored with the help of Thymus, bone marrow and lymph nodes.This is achieved by having adaptive immune system mixing gene segments and able to connect to every possible protein in the universe [53].As mentioned before, the memory cells also provide support to the future attack by the same pathogens [69].

Immune system and emerging technologies
In this section we explain how the current emerging technologies are related and could be used in achieving the key characteristics of the Immune system.Six key characteristics have been identified, which can help us in developing a smart maintenance system (Fig 3).
1. Ignorant but collaborative : Each immune cell is assigned to perform a main task and a set of secondary tasks.They are quite ignorant about the objective of the entire system and doesn't have a centralized system in controlling the activities of individual cells.They work in a collaborative way and perform the most important task of keeping us safe.These characteristics could be achieved by considering their communication and system as a multi-agent system with each agent performing its assigned task but also collaborating with other agents in achieving its global task.2. Federated system : The entire immune system function in different locations of our body with a huge transport network (lymph vessel) spread throughout the body.The innate immune system perform its task at the damage site as the adaptive immunity is developed at the lymph nodes.This federated system could be achieved using Edge, Fog and Cloud computing with decentralized control (See Table 3).The use of IoT devices could also help in developing such a system.3. Distributed Intelligence : As mentioned in the previous section, the immune system consist of two types of intelligence -innate and adaptive.This distributed intelligence could be achieved by using technologies such as Ontologies and Machine Learning.Table 3 provides the various tasks and how to achieve them using Machine Learning.

4.
Extensive Knowledge Base : The adaptive immune system has the knowledge base for resisting the attack from all types of disease that has existed , which exist now or might exist in the future due to its ability to connect to every possible protein in the universe.They also have the memory of all the attack and the defense mechanism used during its life span.
To achieve such an extensive knowledge base requires the use of Big Data techniques for data injection, storage, processing, and retrieval.5. Intelligent Response System : As mentioned in the previous section, the immune system consist of two types of response -innate and adaptive.This response system could be achieved at various locations of the maintenance system by utilizing Digital Twin for remote response and AR for on-site response.For instance, In a tool condition monitoring, the digital twin would help in adjusting the CNC machine parameters and AR technology could aid the maintenance personnel in tool replacement.6. Complex System : The human immune system is the second most complex system in the world after the human brain.Despite the advances in the automation of computer systems, human centered AI techniques might be required to deal with the existing complexity of a smart maintenance system especially in the region of decision making where human might need to play the role of certain decision-making agents with the help of AI tools.

Immune system based Smart Maintenance Framework
With inspiration from the holistic view of the immune system and the related computer technologies, we propose a smart maintenance framework for a complex shop-floor.The framework consist of 4 modules -Physical Asset, Innate Maintenance, Adaptive Maintenance and Knowledge Base.Each module has different blocks for achieving its functionality.

Physical Asset
The physical asset represents the machine, equipment or components in the need for maintenance (here after in the paper, all types of physical assets are mentioned only "machine") and the network of sensors which tries to monitor the machine and capture its real-time information for maintenance.
Sensor Network : Sensor network is essential for monitoring real-time status of the machine considered for maintenance.Wide range of sensors could be selected for monitoring a system.Some common sensors used are forces, vibration, motor current, acoustic emission, temperature, pressure, and sound.Multiple sensors could also be used to improve the accuracy of the prediction.Some points need to be considered during data acquisition: • Sensor placement on the machine/critical components (on machine spindle, work piece, work bed etc.).• Sampling frequency might be influenced by various factors like limitations of the sensor, application, the type of connection (wired or wireless) and how you are storing it (local server or cloud).• Noise reduction in sensor might be required especially high frequency noise by filtering techniques (e.g.band pass filter).Other filtering techniques might be implemented during data acquisition e.g.anti-aliasing filter for working with frequency domain.

Data acquisition:
In the proposed framework the sensor data could be transmitted using both the wired and wireless format.The sensor data needs to be transmitted to both the Innate maintenance for real-time monitoring and response and be stored in Knowledge base for later use to develop an adaptive model.This transmission could be wired or wireless, depending on the sampling frequency.For low sampling frequency, wireless data transmission could be preferred which reduces the complexity of the data transmission and sensor placement.
Internet of Things and Edge and Cloud Storage : In the transmission of data to the knowledge base, the sensors could act like an Internet of Thing device, which send the data from the edge to the cloud storage in the knowledge base.There also needs to be an some level of local edge storage to deal with disturbance in the transmission and loss of data.

Innate Maintenance
Innate maintenance provides real-time monitoring of the machine and quick response for maintenance activities.It is usually carried out at the vicinity of the machine.
Real-time monitoring : The sensor data from the physical asset is monitored in real-time with respect to an existing model to understand the current condition of the machine.The block consists on the data processing and analytics algorithm developed by the adaptive maintenance.The machine condition is predicted and communicated to the context awareness block for the required action.
Machine Learning, Edge and Cloud computing : A commonly used technique for data processing and analytics considering the emerging technologies is the use of Machine learning techniques.The machine learning model developed by the adaptive maintenance is deployed for real-time monitoring for predicting the machine condition.In deploying the model care should be taken in addressing the constraints of online prediction.If the model is deployed at the edge, high processing speed and power is required for the edge device in dealing with complex models.A parallel data storage system (can be stored on cloud) is required along with the online prediction as some data will be missing during model prediction and might be needed for future processing.Data drift or concept drift should also be considered for long-term model deployment and the current model could be updated for a more adaptive and resilient model.
Innate Response System : It provides immediate response to the maintenance need for the machine.Various response systems could be implemented at the innate maintenance system level after online prediction.Alarm signals at the machine could inform the operator of the status of the machine.A control system could be activated to vary the machine parameters or stop a part/whole system.
Augmented Reality : In response to the alarm signal, the operator could utilize the help of AR in carrying out the maintenance activities.The adaptive response system had communicated the set of instruction to be carried out for the current situation and the operator with the help of AR devices could perform the maintenance activities.
Context Awareness : It analysis the sensor signals and the response to be carried out before real-time monitoring and response.The context awareness system deals with two main aspects -Signal and response.
The sensor signals from the physical asset are initially analyzed if the realtime monitoring system can handle this type of sensor signals.This awareness helps identify if there exist a concept/data drift in the sensor signal and the need for an updated real-time monitoring block.The concept/data drift could happen due to variation in the sensor signals with respect to the historical sensor signals used in developing the real-time monitoring system.
The context awareness block also analysis the response from the real-time monitoring block to see if the response is as expected.This analysis could be achieved by comparison with existing knowledge about the machine.An important parameter is to understand the Remaining Useful Life (RUL) developed with the deeper understanding of the machine and operator experience which is captured as expert knowledge.Considering the time run by the machine the RUL could be updated regularly.
The context awareness block triggers the adaptive maintenance if detected an abnormal signal or response for further analysis and if required, for an updated real-time monitoring system.Multi-agent system and Ontology : Ontologies can be used for analysing the incoming sensor signals and also for capturing the expert knowledge and providing a reasoning mechanism for adequate model response.Also, the blocks within the innate and adaptive maintenance could be considered as individual agents with its individual tasks and communication and collaborative with other block in order to achieve collective task.

Adaptive Maintenance
Adaptive maintenance provides in depth analysis of the maintenance activities including development of real-time monitoring algorithm, drift analysis and a smart and adaptive response system.It is usually carried out far away from the physical asset.
Data processing and analytics algorithm development : Utilizing the historical and/or Virtual database, the task of this block is to develop the data processing and analytics algorithm for real-time monitoring of the machine.The development process includes various steps and is application specific, but the commonly used steps are mentioned below, Data Cleaning : Data cleaning might be required to remove data while machine is not functioning (ex.non-cutting data) as they might be classified as a separate class during data processing and reduce the accuracy of the system.Another issue includes handling the missing values by either replacing the values with previous one or removing the data.
Feature Extraction : Feature extraction is required to handle large amount of data and perform further analysis.This feature extraction could be performed using different techniques as listed below, • Time series analysis -Autoregressive (AR) process, AR moving average process, time domain averaging A typical maintenance assessment profile has 4 stages -healthy, warning, replacement, and breakdown.The various classes grouped by clustering are labelled for model generation.The label selection could be based on the evolution classes (healthy, warning, replacement, and breakdown) or failure state (less severe & severe).
Model Building, Evaluation and Deployment : After data preparation, a ML model is developed.Generally, classification models are developed for data with label as evolution classes or failure state.Some point to be remembered while developing the classification model includes, Choosing the classification techniques ( Logistic Regression, Naive Bayes, Support Vector, k-nearest neighbors, Decision Tree, Random forest, Neural Network etc.), Algorithm Parameter Selection (weight, random state, max iteration, number of jobs), Checking for Over-fitting/under-fitting (by increase the number of training data set, removing redundant variables, regularization, dataset balancing), Parameter control (number of iterations, learning rate etc.) and choosing the appropriate performance Evaluation (Score, Confusion Matrix, Precision and Recall).The model after evaluation is then deployed to real-time monitoring block.
Drift Analysis : It analysis the signal for change in its distribution and provides the necessary actions to be taken.Abnormal signal from the sensor network or abnormal real-time monitoring model response triggers the drift analysis where the system check for concept drift or data drift.The drift analysis identifies the reason for the abnormality and decides the required action to be performed.The action could be initialization for a new algorithm development and/or trigger an adaptive response.
Human-centered AI : Considering the complexity of the maintenance system, A human-centered AI technique could be used in dealing with drift analysis.The human could use advance AI tools for data processing and visualization and make decision on the required course of action to deal with the abnormality.
Adaptive response system : It provides the necessary response needed for maintenance considering the concept or data drift.Triggered by the Drift analysis, the response system develops techniques in dealing with the abnormality.The adaptive response system then communicates with the required action to the innate response system and then logs the response in the knowledge base for further reference (when a similar abnormality arises in future).
Digital Twin : Advance techniques like control systems, SCADA, Digital Twin etc. could be used in achieving the required response.The Digital twin could provide real time information of the system and also can be used to perform the required changes to the system parameters.

Knowledge Base
A smart maintenance system requires an extensive knowledge base for the storage of the data, information, algorithms, and libraries required for the Adaptive maintenance.Such an extensive knowledge base requires the use of Big Data technology of data injection, storage (cloud), processing and retrieval.The various parts of this knowledge base include, • Historical Database: The sensor data for the physical asset is required to be stored and retrieved.IoT devices could be used for long distance transmission of these sensor data.• Virtual Database: The lack of data (especially failure data) is a big challenge in developing an effective algorithm.The use of simulation data (using digital twin) could be used in solving these problems and the generated virtual data needs to be stored.This database could also be regularly updated depending on the changes to the physical environment.• Machine Learning Support Libraries: The existing various state of the art machine learning support libraries is stored and constantly updated for developing advance algorithms.• Developed algorithm & response log: The developed algorithm and response by the adaptive maintenance is also stored for future references.The knowledge of the developed algorithms and response will provide the ability to be resilient and anti-fragile to similar issues in future.

Tool Wear Monitoring Use Case
In the following section, some of the blocks of the proposed framework are developed to demonstrate the development of a tool wear condition monitoring system for a CNC milling machine (Fig- 4).The use case demonstrates a partial implementation of the framework using one of computer technologies mentioned in the framework -Machine Learning.It is implemented using a three experimental dataset made available by the PHM 2010 Data Challenge (see [70] for more details).The goal of this work is to demonstrate the application of the proposed framework in the application of tool wear monitoring and so,not to achieve the highest tool wear classification accuracy.Hence, traditional machine learning algorithms are used to demonstrate the application of the framework as they are widely used and can be readily available in the knowledge base.

Experiment details
The flat workpiece was machined line-by-line along the x-axis with tool retracted after each pass for a new one (till complete layer is machined).Then, flank wear at individual flute was measured.Table 4 gives the details of the experimental setup including details of the sensors & equipment used and relevant parameters for the experiment.Figure 5 provides the information of the sensor placement and flank wear measurement.

Tool Wear Monitoring Framework
The tool wear monitoring framework for the presented use case consist of 4 modules -Physical Asset, Innate maintenance, Adaptive maintenance and Knowledge Base.A complete tool wear monitoring framework will require all blocks of the modules which was presented as a immune based smart maintenance framework (Fig- 4) but for this use-case we have a limited implementation with just selected blocks.Figure 6 presents the adapted framework.Physical Asset : The physical asset consist of a 3-axis CNC milling machine with motion control units that include position sensors, rotary encoders, proximity switches, current sensors and pressure sensors.3 types of add-on sensors (not included with the CNC machine) for the current application were placed for the current application.These include a 3-axis dynamometer to measure the cutting forces, 3 accelerometers to measure the machine tool vibrations in X, Y, Z direction and Acoustic Emission (AE) sensor to monitor the high frequency stress wave generated by the cutting process.The accelerometer & acoustic emission sensor were placed on the side of the workpiece and Dynamometer was mounted in between the workpiece and machining table.The best sensor network for this current experiment could be decided considering the performance of each sensor or a group of sensors with respect to the data processing & analytic algorithm.(see Table-8).The add-on sensor output is conditioned using charge amplifiers or couplers.For example, cutting forces are measured in the form of charges and then converted to voltages by the charge amplifier.
The sensor data is stored in the historical database for updating the data processing and analytics algorithm development and sent to the innate maintenance for real time tool wear condition monitoring.
Knowledge Base : The sensor data sent from physical asset is stored in the knowledge base along with the existing set of Machine learning algorithms and other support libraries required to for data processing & analytics algorithm development.Data Cleaning: The noise is removed using joint time-frequency distribution algorithm followed by non-cutting signals removal by eliminating data with very low forces (less than 5N).The effect of the elimination of non-cutting signal is presented in Table-6.
Feature Extraction : Time series data for one layer (315 layers in total) consist of around 220,000 measurements and one feature to represent so many measurement might be misleading.Hence, one layer time series data was further divided into blocks of 5000 measurement and a single feature for these smaller blocks was measured.Statistical parameter (root mean square, peak value and average) were selected for feature extraction as many of the literature have selected statistical parameters as reliable feature extraction method for tool wear prediction [4,70].The effect of various statistical features is also examined (Table -7).
Clustering : 7 input variables were used for clustering (see table 5).The preprocessing step includes feature scaling using a min-max scaler.4 clustering techniques -Agglomerative, Birch, KMeans, Gaussian Mixture -were used to cluster the input variables into 3 clusters from the knowledge base.The best clustering technique was then used for later stages.The number of clusters were chosen to be 3 due to the 3 evolution classes involved during a tool lifebreak-in, steady wear, severe wear (see figure 9).
Labelling : The first occurrence of the 3rd cluster was chosen as the boundary representing the start of severe wear.All the features before the start of the severe wear were labelled as "less severe wear (Value 0)" and others were labelled as "severe wear (Value 1)".The tool flank wear was also measured after each layer on the three flutes of the tool.The maximum tool wear value of the three flutes was considered as the tool flank wear (V b ) (Figure 9).The variation in the slope value of the flank wear was used to identify the boundaries of the wear evolution.For performance evaluation of the clustering technique, flank wear was used as ground true value.The flank wear was grouped into two groups -less severe wear (break-in & steady stage) and severe wear.Two groups were chosen as the knowledge of break-in group doesn't add value to the operator.Figure 8 shows both the predicted severe wear and true severe wear.The objective of the clustering algorithm is to have the predicted severe wear as close to the true severe wear.Normalized mutual information score could also be calculated considering the true and predicted severe wear for each clustering algorithm.This helps in feature (Table 7) and sensor selection (Table 8).
Model Building, Evaluation and Deployment: As we have two groups, a binary classification model was developed for predicting the tool wear.Five Classification techniques -Logistic Regression, Multinominal Naive Bayes, Linear Support Vector, k-nearest neighbors, Decision Tree -were used for developing prediction model from the knowledge base.The best classification model was deployed to the innate maintenance data processing and analytics.As three similar experiments were carried out, data from one experiment was used as the train data set and then the model was tested against the two other experiment.The scores were used for evaluating performance of the model and choosing the best one (Table 9).
Innate Maintenance : This module consist of three blocks -to analyze the incoming sensor information and to respond considering the tool wear condition.Only the "Real-time monitoring" block was implemented in this usecase while other two block have been described as a possible implementation for future.
Real-time monitoring: We tried to simulate an real-time monitoring environment by using the best classification model chosen in the last stage.The model was developed using one experiment data as training set and tested using the other two experiment data (Figure 10).There also exist a slight delay and hence loss of some data from the sensor network when the condition monitoring model was running.
Signal Context Awareness : The developed classification model is suited for the current working condition of the machine (fixed parameters like 23,600rpm spindle speed, 4.7m/min cutting speed, Y & Z depth of cut of 0.125mm & 0.2mm rep.).Any modification in the working condition of the CNC machine beyond certain range would require the development of a new data processing & analytics algorithm.
When an abnormal signal is detected due to changes in machining conditions (for example, a much lower spindle speed) the signal context awareness triggers the adaptive maintenance to develop a new classification model considering the historical/virtual database for the new machine condition.The newly developed model is replaced with the existing model in the real-time monitoring.
Innate Response system : The system response to the detection of severe tool wear could range from an alarm signal to alert the operator to changing machine parameter automatically like reducing cutting parameter (speed, feed or depth of cut), coolant control, machine stop etc.

Discussion on immune-based monitoring
The proposed tool wear monitoring framework is adapted from the immune based smart maintenance framework considering one of the most emerging technologies for smart maintenance -Machine Learning.With the sensor data from historical database, the data processing & analytics algorithm is developed.
Accessing the traditional machine learning libraries from the knowledge base, the data is prepared by initially performing data cleaning of non-cutting signals, followed by key feature selection (RMS) and selecting the ideal clustering techniques (Birch clustering) for labelling the data.The most accurate classification model is then selected for online monitoring (Logistic regression).
The data processing & analytics algorithm is then morphed to real-time monitoring, where the new incoming sensor data is labelled and classified to monitor the tool wear.The classification model result is then analyzed by the context awareness and trigger a response to change the tool.The classification model accuracy is constantly monitored and any deviation from the accuracy triggers the context awareness to develop a new algorithm when it crosses a given threshold (say, 85%).The adaptive maintenance system considering the updated historical database and advanced libraries develops a more accurate model.Hence, the developed framework quickly adapts to the changes in the environment and develops a more resilient model before the system accuracy drops drastically.
The presented use case attempts to showcase a smart maintenance system considering the new requirements like resilience and anti-fragility based on a future proof framework (A system considering both innate & adaptive immunity).

Conclusion and Future research direction
The need for the development of a smart maintenance framework has encouraged may researchers in utilizing the potential of the current existing computer technologies and bio-inspired approaches.We present a novel smart maintenance framework inspired by the human immune system.We initially present the human immune system in a holistic view considering the intelligence and response of both innate and adaptive immunity.We then map the immune system key characteristics with the emerging computer technologies -Internet of Things, Edge & Cloud computing, Multi-Agent system, Ontology, Big Data, Digital Twin, Machine Learning and Augmented reality.Inspired by the holistic view of the immune system we present a smart maintenance framework.The framework consist of four modules: physical asset, innate maintenance, adaptive maintenance and knowledge base.Few blocks of the proposed framework are used in determining the tool condition monitoring of a CNC milling machine.The implementation utilizes clustering techniques to label sensory data followed by classification for online prediction.
Future research includes incorporating other emerging technologies like Internet of Things, Cloud & Multi-Agent System in developing a smarter and resilient application.Another research direction is to implement the developed framework is different use cases like ball bearing wear, motor balancing, engine monitoring etc. to validate the generality of the framework.• Ethics approval : Not applicable.

Statements and Declarations
• Consent to participate : Not applicable.
• Consent for publication : All authors agree to publish the paper.
• Authors' contributions : All authors contributed to the study conception and design.Experiment preparation, data collection and analysis were performed by Terrin Pulikottil.The first draft of the manuscript was written by Terrin Pulikottil and all authors commented on previous versions of the manuscript.All authors read and approved the final manuscript.
in the work as Antigen Presenting Cell, $ -T-Cells determines negative selection not antibodies

Fig. 2 :
Fig. 2: Intelligence and response tasks of immune cells

Fig. 3 :
Fig. 3: Immune system key characteristics and related emerging technologies

Fig. 5 :
Fig. 5: Experimental Setup ( Setup adapted from [71], the tool wear image used was captured during an experimental campaign carried out at University of Nottingham )

Fig. 6 :
Fig. 6: Tool Wear Monitoring Framework adapted from the immune based smart maintenance framework (The block faded in grey color are not used/developed for this use-case)

Fig. 7 :
Fig. 7: Data processing and analytics algorithm development Figure 7 presents the various stages of the data processing and analytics algorithm development.The current use case provides special emphasis on the data preparation stage as it considers the sensor data as un-labelled data and hence a semi-automatic labelling technique is presented.

Fig. 8 :
Fig. 8: Semi-auto labelling of the peak values of each cut for Experiment-1

Fig. 9 :
Fig. 9: Flank wear on 3-flutes showing the three stages tool wear -break-in, steady and severe wear (results for measurement carried out for Exp-2)

Note:Fig. 10 :
Fig. 10: Innate intelligence tool wear monitoring results (Online tool wear monitoring using Logistic Regression model developed using exp-1 as historical data and tested using data from (a) Exp-2 (b) Exp-3)

•
Funding : This work is carried out under DiManD Innovative Training Network (ITN) project funded by the European Union through the Marie Sktodowska-Curie Innovative Training Networks (H2020-MSCA-ITN-2018) under grant agreement number no. 814078.• Conflicts of interest/Competing interests : The authors have no relevant financial or non-financial interests to disclose.• Availability of data and material : Available on request.• Code availability : Available on request.

Table 1 :
Existing Maintenance frameworks developed using emerging technologies

Table 2 :
Immune system based maintenance framework

Table 3 :
Innate and Adaptive intelligence using Machine Learning and Cloud technologies Un-labelled data after feature extraction undergoes a clustering stage where the data are grouped due to its similarities.Things to be considered while carrying out clustering includes, Pre-processing (Feature scaling, Feature transformation & redundancy reduction, Dimension reduction, Image encoding), Choice of clustering techniques (Agglomerative, Birch, KMeans, Gaussian Mixture, Fuzzy C-mean etc.), Algorithm Parameter selection (no. of clusters, threshold, initialization, max iteration, Verbosity, random state) and Performance Evaluation (normalized mutual info score based on a ground true value).

Table 5 :
Clustering input variables and parameters

Table 6 :
Effect of filtering non-cutting signals

Table 7 :
Feature selection based on Clustering data

Table 8 :
Sensor selection based on clustering dataThe results presented here are considering RMS as Feature Selection *-Normalized mutual information score

Table 9 :
Classification model score for various algorithms Note: The results presented here are considering RMS as feature selection and using Birch clustering ⋆-Normalized mutual information score ‡ -Standard Deviation