# Smart Manufacturing Real-Time Analysis Based on Blockchain and Machine Learning Approaches
## 5 Results and Discussions
### Fault Detection Based on Hybrid Prediction  
A hybrid prediction model in the proposed system was applied to extract the normal and abnormal functionality during the procedure. As shown in Figure 19, this procedure detects the mentioned functionality in the manufacturing system. The outlier detection in the hybrid prediction model is used to remove the sensor data outliers and classify them based on Random Forest. This procedure's final step is the performance evaluation comparing the hybrid prediction model results with other classification models. The per  
Figure 17: List of transactions.  
Figure 18: Transaction history records.  
formance evaluation is based on the different ML prediction models. The dataset contains 400 classified instances that are normal or abnormal throughout the manufacturing process. The data are divided into eight features: temperature, humidity, accelerometer 1, accelerometer 2, accelerometer 3, gyroscope 1, gyroscope 2, and gyroscope 3. The applied machine learning technique is expected to produce a robust model classifier from the provided data. After the generating monitoring system, the results show the prediction results of the sensor dataset.  
After collecting the relevant dataset, the pre-processing step removes unsuitable, conflicting, and missing values from the data records. Table 5 shows the dataset's detailed information. There are four main sensors used in this procedure: temperature, humidity, accelerometer, and gyroscope. Moreover, the information gain (IG) technique analyzes the considerable features during the process [55]. Table 6 shows the dataset attributes and IG scores. Based on the provided results, the manufacturing system's temperature has the highest factor affecting abnormal functions.  
The comparison of the different classification models is shown in Table 7. The models are defined as: multiple linear regression, Random Forest, k-nearest neighbor, decision  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Features** & **Information gain score** \\ \hline Temperature (celisius) & 1.0615 \\ Humidity (relative humidity) & 0.9829 \\ Accelerometer 1 & 0.5774 \\ Accelerometer 2 & 0.98 \\ Accelerometer 3 & 0.5988 \\ Gyroscope 1 & 0.7435 \\ Gyroscope 2 & 0.9359 \\ Gyroscope 3 & 0.9582 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Considered features based on information gain score.  
Figure 19: Hybrid prediction model based on Random Forest classification for fault detection.  
\begin{table}
\begin{tabular}{l l} \hline \hline
**Features** & **Introduction** \\ \hline Temperature (Celsius) & Provided environmental temperature \\ Humidity (Relative humidity) & Provided environmental humidity \\ Accelerometer 1 & First value of the accelerometer \\ Accelerometer 2 & Second value of the accelerometer \\ Accelerometer 3 & Third value of the accelerometer \\ Gyroscope 1 & First value of the gyroscope \\ Gyroscope 2 & Second value of the gyroscope \\ Gyroscope 3 & Third value of the gyroscope \\ \hline \hline \end{tabular}
\end{table}
Table 5: Dataset information.  
tree, and extra tree. Based on the results, the combination of the hybrid method and the Random Forest had the best performance in the proposed system with an accuracy of 0.956 and an RMSE (Root Mean Square Error) of 0.105. This procedure showed the RMSE score for each model. The highest error rate was for the linear regression model, which had the lowest accuracy score in this system.  
The performance metrics of the presented models were evaluated based on Equations (1)-(3). In this process, based on the confusion matrix, there are four possible outputs: true positive (_True+_) and true negative (_True-_), which are are the right classified points, and false positive (_False+_) and false negative (_False-_), which are the wrong classified points.  
\[Precision=(True+)/((True+)+(False+)) \tag{1}\]  
\[Recall=(True+)/((True+)+(False-)) \tag{2}\]  
\[Score=((True+)+(True-))/((True+)(True-)(False+)(False-)) \tag{3}\]