# Dynamic Scheduling Optimization of Production Workshops Based on Digital Twin
## 4 Neural Network-Based Fault Disturbance Monitoring Model Construction  
Taking machine failure, a typical and influential disturbance situation, as an example, a neural network-based disturbance monitoring model is established by processing the machine tool spindle vibration signal, and the disturbance monitoring of the machine is realized through neural network training and testing. In this study, the vibration signal of machine tool spindle collected from an aerospace plant is analyzed, and the vibration signals of normal and abnormal states are shown in Figure 5.  
Figure 4: Multi-source sensing and real-time data collection framework. Considering that the vibration signal is difficult to be used as the input vector of the neural network, this study uses wavelet packet technique to extract the energy features of the machine tool vibration signal. The collected vibration signal is decomposed by 3 layers of wavelet packets to extract the energy features of the machine tool mechanical vibration signal, and the energy features are used as the input data of the neural network. The distribution of the energy features of the machine tool in normal and abnormal conditions is shown in Figure 6.  
A total of 30 sets of data were obtained for feature extraction of the two state patterns, and some of the data are shown in Table 3. From the obtained data, 20 sets of data are selected to train the neural network, and the remaining 10 sets of data are used as the neural network test data, where category 1 indicates the normal state and 2 indicates the abnormal state. The wavelet packet energy feature vector of the collected machine tool vibration signal is used as the input vector, and the learning vector quantization (LVQ) neural network is used for training and testing. The input layer of LVQ neural network was 8 neurons, which correspond to 8 feature quantities of the input data. The output layer was 2 neurons. When the input vector is closest to the competing layer neuron, the competing layer neuron is activated, and the output layer neuron connected to this competing layer neuron has a value of 1 and the other output layer neuron has a value of 0. The output is \"1 0\" for  
Figure 5: Vibration signals in two states. (**a**) The normal state; (**b**) The abnormal state. Figure 6: Energy characteristics in two states. (**a**) The normal state; (**b**) The abnormal state. category 1 and \"0 1\" for category 2 The number of competing layer neurons is calculated using Equation (1). \[N_{h}=\frac{N_{s}}{(\gamma\times(N_{i}+N_{o}))} \tag{1}\]  
where \(N_{h}\) is the number of neurons in the hidden layer, \(N_{i}\) is the number of neurons in the input layer, \(N_{o}\) is the number of neurons in the output layer, \(N_{s}\) is the number of samples in the training set, and \(\gamma\) is a real number from 2 to 10. After several training sessions, the number of competing layer neurons was finally set to 5, and the learning rate was 0.01. The trained model was used to classify the test set data. The LVQ neural network test results are shown in Table 4.  
When applying the neural network to monitor the disturbance, if the disturbance occurs in the test result but not in the actual test, the parameters of the neural network model need to be adjusted, and the neural network needs to be trained according to the \begin{table}
\begin{tabular}{c c c c} \hline \hline  & \multicolumn{2}{c}{**Classification Results**} & \multicolumn{1}{c}{**Accuracy**} \\ \cline{2-4}  & **Normal** & **Failure** & \\ \hline Normal & 19 & 18 & 1 & 95\% \\ Failure & 15 & 0 & 15 & 100\% \\ Total & 34 & 18 & 16 & 97\% \\ \hline \hline \end{tabular}
\end{table}   
test data and historical data. Conversely, if the test result is that the disturbance does not occur, but the actual test result is that the disturbance occurs, then the disturbance situation needs to be processed. The virtual workshop model needs to be updated, the rescheduling scheme needs to be generated, and the production will be carried out according to the new scheduling scheme after simulation.