# Blockchain Secured Dynamic Machine Learning Pipeline for Manufacturing
## 6 Case Study: Machine Learning Application in Manufacturing
### ML Pipeline and Stakeholders  
Typically, a machine learning pipeline consists of five components that build on each other, are continuously monitored by a monitoring system, and are based on CRISP-DM (CRoss-Industry Standard Process for Data Mining) [52]. Through a series of intermediate steps and components, the raw data that comes in (process parameters, workpiece data, and order data) is turned into a quality index.  
Step 1 \"Data collection\" (see Figure 5), where the data to be processed is collected, is the entry point into the ML pipeline. Step 2 \"Data preprocessing\", the collected data are preprocessed based on methods and rules. Step 3 \"Model training\" the existing model is retrained based on the preprocessed data and historical data; this step takes place in parallel with the other steps. Step 4 \"ML usage\" the model that was trained in step 3 is used on the data that has already been cleaned up. Step 5 \"Result\" is the end of the pipeline. It shows the quality index that the machine learning model came up with.  
Figure 4: Visual Metal Surface Quality Inspection.  
Figure 5 depicts four stakeholders who are often from different companies and are typically involved in the development and operation of a machine learning application for a SME as well as blockchain nodes (e.g., manufacturer, ML consultant, machine manufacturer, condition monitoring service provider, quality check auditor, etc.). For the goals to be met, the stakeholders must work together to manage their parts of the machine learning pipeline and affect the outcome. In the use case presented in Section 6.1, the actors are each from a different company. The actors are the company that is using ML, the company that is modelling training, the company that is conditioning monitoring, and the company that is quality control. However, stakeholders do not just influence parts of the pipeline; they influence each other by their reactions and also rate each other for trust value. A company that uses machine learning has control over and manages the following parts: data collection, data preprocessing, ML use, and results. So, these are the parts that make up the processing of data and the use of the ML model.  
Company Model Training controls and manages the Model Training component and the certificate, which use machine learning and historical data to create a model from the company's collected and preprocessed data. _This is where the first mutual influence between stakeholders can be found: Company using ML and Company Model Training._  
Company Quality Control checks the history data to see which of the recorded images of the workpiece show a good surface. Quality control checks output data and assigns a trust level rating to it. _This is the second mutual influence that can be found among the actors: Company Quality Control, Company Model Training, Company using ML._  
Company Condition Monitoring manages and affects the monitoring of the following parts: data collection, data preprocessing, model usage, results of company ML use, and model training for company model training. _This is the third mutual influence between stakeholders that can be found: Company using ML, Company Model Training and Company Condition Monitoring._  
Lastly, it can be said that the people who have a stake in this pipeline can make decisions that affect the quality of the ML model, whether they are aware of it or not. Because of this, it is important that all stakeholders, all parts, and all data used to train the model can be tracked.  
Figure 5: ML Pipeline and Stakeholder.