資料來源：北科工業4.0 陳振傑 顧問
With attackers advantages using AI (Artificial Intelligence) and Machine Learning as the companys strategy, Small and Medium Enterprises are still having difficulties where to start the very first step? This article will jump start your Smart Manufacturing based on the existing ERP (Enterprise Resources Planning) MES (Manufacturing Execution System). For the past decade, companies have kept accumulating tons of data from the existing ERP MES System, such as BOM (Bill of Material), recipe in process industries and equipment parameters in manufacturing processes, without knowing the values of these data. By applying the data driven and machine learning approach, we can turn these existing valuable data into competitive advantages and further assist companies moving forward to Smart Manufacturing and gain attackers advantages.
The article contains two case studies from the industry and is divided into two parts. The first part will be delivered by a Senior Industrial Expert and Nvidia Certified Instructor from NTUT Industry 4.0 Consulting Group covering the management, processes and cases study, such as recipe forecast and equipment failure prediction (PHM) for Petrochemical, Electronics and Process Industries. We will share AI project experience acquired from our NTUT Alumni Enterprises, such as Delta Electronics, Panasonic, TECX-UNIONS and Pegatron. A field Data Scientist from the group will take care of the second part, which is the technical implementation of case study, ranging from machine learning cycle from data collection, pre-processing, features engineering, training, validate, test and deployment (Cloud and Edge). Automation of data collection using the latest popular RPA tool (Robotic Process Automation), techniques of handling overfitting caused by imbalanced data and LSTM for time series data will also be addressed.
Combining both management (Scenario Benefits) and technical implementation (Data Preparation, Modeling with a simple Multilayer Perceptron Deployment through Cloud Computing Edge Device) in two cases study, the article assures you to have a better understanding of Machine Learning in Smart Manufacturing and capable of kicking off your very first pilot project in Smart Manufacturing in the area of recipe forecast, quality prediction, finding critical factors causing low yield rate and equipment failure prediction (professional termed as PHM: Prognostic and Health Management) among various industries such as Petrochemical, Electronics and Process Industries.
Case Study I: Recipe Forecast for Petrochemical, Electronics and Process Industries.
Scenario: An ABC company from Process Industries has implemented an ERP (Enterprise Resource Planning) System, for more than ten years accumulating thousands of historic recipe data in its Production Planning System. A recipe typically contains components (for example: chemical compounds, catalyst, dyes and etc.) and their corresponding concentrations which meet the customers specific requirements, such as targeted color (L,a,b,C,H) and material type in the sales orders (see Picture 2).
Problem Definition: When ABC Company receives sales orders, the traditional method to process the orders is to proceed coloring processes with try and error, by experienced masters following their own rules and experience, to find out whether the resulting color matches the customers specific requirements, such as targeted color (L,a,b,C,H) and material type. This traditional method increases the coloring processes error rate due to variables, such as material type, temperature, PH value and concentrations of various components in recipes that cause wasting of processing time, water, electricity and recipe components.
Solutions: By using thousands of historic recipe data accumulated in ERP System and their corresponding MES data, a model (see Picture 1) can be built through machine learning, to seek out the patterns of forming the correct recipe, resulting in increasing accuracy rate in coloring processes.
Picture 1: A typical machine learning model: Multilayer Perceptron (MLP)
Benefit Description: (1) Speed up the coloring processing to increase productivity. (2) Reduce the training time for new employees with the prediction of new recipes. (3) Standardized the recipe to avoid employees using their own rules and reduce the wasting of coloring processing time, water, electricity and recipe components.
Business Understanding: Please see scenario and benefit in Case Study I above.
Two data sources, including recipe and MES data, are available in the database. The first data source is recipe data in its Production Planning Module of ERP System. A recipe typically contains components (for example: chemical compounds, catalyst, dyes and etc.) and their corresponding concentrations which meet the customers specific requirements, such as targeted color (L,a,b,C,H) and material type in the sales orders (see Picture 2). The second data source is wavelength and reflectance data of the color key, residing in the MES System (see Picture 3). For the recipe data, its easy to export all historic BOM from the ERP System at one time. But for the wavelength and reflectance data, each record has to be collected by logon into the MES and either export ONLY one record at a time or manually write down the data values which frequently cause errors and are time-consuming tasks. We will automate the collection of these MES data by applying the RPA (Robotic Process Automation) tool in the following Data Preparation step.
Picture 2: A typical recipe for Process Industries
For recipe data, simply logon to the ERP system and export the data. For MES data, apply a RPA tool to automate the manual collection processes by executing a pre-recorded RPA script to perform the following steps: (see Picture 4)
In the RPA tool, click run to execute the script.
Open Excel file: all_keys.xls = Data list to retrieve from MES system
Open Excel file: all_keys.xls = MES_path = Path to activate MES system
Remote connecting to MES Server = Login to MES Server
Login to MES System = Login to MES System and retrieve data
Retrieve, export and save data to Excel file named: Excelxxx.xls and exit MES System
Open Excel file: Excelxxx.xls = The data just downloaded from MES system
Once we have both recipe and MES data, we will merge them into one file for the model training in the following step.
Picture 4: RPA: Process Flow to collect MES data automatically
Two steps machine learning is designed to train the model. The first step is to train the model to learn Recipe Components to meet the customers requirements. The input (x) and output (y) training data format and its model are shown in Picture 5. And Learning Recipe Concentration for their corresponding Components is the second step (Picture not shown).
Picture 5: Model-1 for Learning Recipe Components
We train the first model (Model-1) with 50 epochs, training size of 80% and test size of 20%, to learn Recipe Components from historical Recipe and MES data, resulting in test accuracy of 0.993 (see Picture 6). The second model (Model-2) for prediction of Recipe Concentration of their corresponding Components is not shown here.
The Google Cloud Platform is used for the referencing (see Picture 7). When receiving sales orders from the customers, we feed customer requirements, its corresponding wavelength and material type (Line 13: content) to Model-1 (Line 4: model_id) to get the most suitable Recipe Components (Line 13: prediction). And through Model-2 (not shown here), we are able to predict the Recipe Concentration for their corresponding Components with the accuracy of up to 90%, resulting in saving processing time, water, electricity and Recipe Components.
Picture 7: Deployment through Google Cloud Platform
Case Study II: Equipment failure prediction for Petrochemical, Electronics and Process Industries.
Scenario: A company in the Process Industry has eight production lines with more than twenty equipment for each line. The traditional methods for equipment maintenance to apply are reactive and preventive maintenance strategy.
Problem Definition: The Company has suffered huge loss due to equipment unexpectedly shut down several times in production lines, causing late delivery and reduction of production capacity. Cost to repair equipment is even more expensive when its in total failure status.
Solutions: Apply predictive maintenance strategy to tackle this critical issue. Predictive maintenance and equipment failure prediction, professional termed as PHM (Prognostic and Health Management) are commonly used in Smart Manufacturing to avoid equipment unexpectedly shutting down.
Benefit Description: (1) increase equipment efficiency and reliability (2) lower equipment maintenance time and cost (3) avoid equipment unexpectedly shutting down (4) maintain production capacity (5) products delivery on time
Business Understanding: please see scenario and benefit in Case Study II above.
Data Understanding: we have two hundred thousand rows of one years equipment data with date, time, sensor measurements and equipment status (normal or failure) recorded every minute (see Picture 8).
These sensor measurements are Status Variable IDentification (SVID), including temperature, current, pressure, vibration, noise, voltage, particle, flow, etc.
The input for the model is a time window of two hours (2*60) of consecutive equipment sensor data (50 SVID). The input x length will be accordingly 2 x hours x 60 minutes x 50 sensor samples/minute = a 6000-dimensional input vector. The model output vector y length is 1 (just one output neuron) by checking whether there is an equipment failure, within a day (window length of 60 minutes * 24 hours) after the input window length of two hours. If there is an equipment failure, y is set to 1, otherwise 0 (see Picture 9).
We generate 3000 records by randomly choosing a sample minute, compute the input vector x for the input window size of two hours starting at this minute, compute the output vector y by checking whether in the following time window (a day) the equipment will fail and finally combine both the input and output vector into one training sample (x,y). 2000 randomly extracted samples (x,y) will be used for training.1000 randomly extracted samples (x,y) will be used for testing.
Picture 9: Data Preparation for Equipment SVID Data
Modeling: A MLP (Multilayer Perceptron) model is built with two hidden layers (see Picture 10)
Picture 10: A MLP (Multilayer Perceptron) model
Evaluation: We train the model with 2000 pairs of data and the validation accuracy is 99%. For testing, another 1000 pairs of data are fed into the model resulting in the following confusion matrix.
Precision = TP / (TP + FP) = 45 / (45 + 3) = 0.93
Overall accuracy = (TP + TN) / (TP + TN + FN + FP) = 0.99
Although the overall accuracy is pretty high with 99%, If there is really an equipment failure in the future, the model could predict failure with ONLY 90% of accuracy (see Recall above). That means there is still a 10% of chance that the equipment will be broken unexpectedly! See Further Development below for improvement.
Further Development: There are two critical issues needed to consider for improving Recall of FAILURE:
LSTM model: Instead of modeling with MLP, apply LSTM (Long Short Term Memory Network) model especially suitable for time series data in this case.
Imbalanced Datasets: Equipment failures are usually rare. In this case, there are ONLY 5 failures within a year causing overfitting during the model training. Apply Under-Sampling or Over-Sampling techniques to deal with Imbalanced Datasets.
NVIDIA JETSON AGX Xavier (Picture 11) is used as an edge device for on-line real-time referencing by running TensorRT in two stages (Picture 12), including Model optimization (left) and TensorRT target runtime (right).
Picture 11: an edge device: NVIDIA JETSON AGX Xavier
Picture 12: Model optimization and real-time inference
With sensor data continuously fed into the model every minute in step 2 of Picture 12, the model will grab two hours records of 120 data and predict whether the equipment will be broken within a day.
Combining both management (Scenario Benefits) and technical implementation (Data Preparation, Modeling with a simple Multilayer Perceptron Deployment through Cloud Computing Edge Device) in two cases study shown above, the article assures you to have a better understanding of Machine Learning in Smart Manufacturing and capable of kicking off your very first pilot project in Smart Manufacturing in the area of recipe forecast, quality prediction, finding critical factors causing low yield rate and equipment failure prediction (professional termed as PHM: Prognostic and Health Management) among various industries such as Petrochemical, Electronics and Process Industries.