Skip to the content.

Predictive-Maintenance-AI4I

Building ML model which can detect machine failure with given information. In this case, CNC machine

As Industry 4.0 continues to generate media attention, many companies are struggling with the realities of AI implementation. Indeed, the benefits of predictive maintenance such as helping determine the condition of equipment and predicting when maintenance should be performed, are extremely strategic. Needless to say that the implementation of ML-based solutions can lead to major cost savings, higher predictability, and the increased availability of the systems.

Why Use ML Techinques for Predictive Maintenance

Frankly speaking, predictive maintenance doesn’t require anything more than an informal mathematical computation on when machine conditions are at a state of needed repair or even replacement so that maintenance can be performed exactly when and how is most effective.

However, ML eliminates most of the guesswork and helps facility managers focus on other tasks, such as:

Objective of this model is to detect the machine failure using some of available information regarding the machine and also to build an interface.

Tech Stack used:

Dataset Information

Since real predictive maintenance datasets are generally difficult to obtain and in particular difficult to publish, we present and provide a synthetic dataset that reflects real predictive maintenance encountered in industry to the best of our knowledge..

From UCI machine learning repository:https://archive.ics.uci.edu/ml/machine-learning-databases/00601/ai4i2020.csv

Attribute Information:

Machine Failure modes

The machine failure consists of five independent failure modes:

If at least one of the above failure modes is true, the process fails and the ‘machine failure’ label is set to 1. It is therefore not transparent to the machine learning method, which of the failure modes has caused the process to fail.

Exploratory Data Analysis

As mentioned before there are five independent failure modes within system and also if there’s failure it is flagged with “1” as failure is true and “0” as failure is false.

Percentage of machine failures

In any well maintained systems, the occurances of failures are to be minimum in this case also that’s true over only about 3.4% of time the said machine fails. Let us see the share of different mode of faults.

Percentage of different machine failures

Pie chart of different failures

Here Heat Dissipation failure seems to be more common type of failure within the system, thus this indicates that temperature monitoring of process and environment is to more important in order to minimize this type of failure also, it has 30.8% of share among other type of failures.

Correlation Plot of all attributes

As expected air temperature has impact on process temperature thus, controlling air temperature will regulate the process temperature and reduce the possibilty of HDF failure.

Approach towards building classifiers

We are going to build classifiers with high precision rate than recall rate, because I want to minimize the “false alarms”.

Building Logisitic Regression Model

Logisitic Regression model was build by using Air temp, process temp,rotational speed, torque and tool wear to predict the status of machine failure.

Confusion Matrix and ROC curve of logistic Regression

From confusion matrix shows that 45 samples of class 1 were wrongly as Class 0 and only 16 samples were classified as Class 1.

PR curve of logistic Regression

With precision score at 0.62 and recall score at 0.26 logistic regression performed better well.But still to many False alarms.

Building Random Forest Classifier Model

Same features are used in building the classifier and see the performance.

Confusion Matrix and ROC curve of Random Forest Classifier

Comparing with Logistic Regression there’s less False alarms and there’s more number of samples were classified with right class.

PR curve of Random Forest Regression

With precision score at 0.79 and recall score at 0.31 Random Forest Classifier performed well than previous one.But still to less False alarms. We will use this model to build an simple interface.

Building demo interface with model

Gradio has this amazing interface to demo your model thus, using that we are able to see the model’s ability to predict the proablility of the status of machine failure.

Future Work