Abstract
The rapier loom works in a complex environment and operates at high speeds. It is inevitable that its performance will deteriorate during the production process, which in turn will cause faults. The development of maintenance has undergone the transition from “regular maintenance” and “post-event maintenance” to “predictive maintenance”. In order to achieve the synergistic optimization goal of ensuring operational safety and reducing operational costs, a predictive maintenance method driven by the fusion of digital twin and deep learning is proposed based on the idea of “combining the real with the virtual and controlling the real”. Firstly, a digital twin system structure model of rapier weaving machine is constructed, and the overall architecture of digital twin is proposed according to the full operation cycle of rapier weaving machine. Then, the digital twin-driven process parameter evaluation and prediction and health state evaluation and prediction are investigated separately. In order to achieve the evaluation and prediction of process parameters to ensure the efficiency of weaving machine operation, the prediction method of IWOA optimized BP neural network driven by twin data is proposed and the model is updated and optimized based on the martingale distance approach. In order to achieve health state assessment and prediction, we use health index as an evaluation index to characterize the health condition of spindles, and use BiLSTM network to achieve prediction of remaining spindle life and then make maintenance decisions. The results show that there are greater advantages to combining deep learning and digital twin technology for intelligent predictive maintenance of rapier loom.
Introduction
Predictive maintenance is maintenance performed to prevent equipment failures from occurring and further deteriorating. Timely assessment and prediction of equipment health status is particularly important to maintain production and improve productivity. Currently, predictive maintenance for electromechanical equipment like rapier loom consists of two main approaches: Model-driven and Data-driven. Model-based methods do not depend on the historical data of the equipment and can better express the degradation laws of the equipment [1–3]. However, the complex structure and operation rules of many devices make it difficult to establish mathematical models, which makes these methods difficult to be widely used.
In recent years, a data-driven approach has gradually become the focus of research. This approach requires historical operation data of the equipment, and through data analysis and processing, information on health status indicators and performance degradation characteristics hidden in the equipment data are mined. Machine learning methods, especially deep learning models, have made breakthroughs in predictive maintenance of equipment. Deep learning methods are able to take into account the long-term history of input data, which leads to more accurate results than other data-driven methods. Xi Long [4] developed a fault prediction system for rapier loom, using historical data to train convolutional neural networks to predict possible faults by analyzing real-time data from rapier loom. Sharma et al. [5] used temporal convolutional networks to predict the remaining service life of turbofan engines to improve the efficiency, service life, and reliability of machines and reduce maintenance costs. Li et al. [6] proposed a deep learning driven method for mechanical equipment fault classification and degradation assessment. The analysis of vibration signals allows accurate discrimination of the degradation process of the equipment, and has shown good adaptability in degradation assessment experiments. Song et al. [7] proposed a two-stage deep learning scheme for machine remaining life prediction based on long- and short-term memory networks for the health prediction and management of devices, capable of extracting recursive and non-recursive features, and experimentally demonstrated that the method outperforms existing methods.
The above data-driven predictive maintenance methods have been widely applied in different industrial production fields, which can accurately evaluate the current health status of equipment and predict its service life. The existing fault diagnosis of weaving machines belongs to a post maintenance method that can achieve accurate classification of faults, but cannot predict the occurrence of faults, lacking an effective data-driven approach to achieve precise predictive maintenance of textile machinery.
With the development of artificial intelligence technology, digital twins provide effective solutions for precise, intelligent, and predictive maintenance of devices. The main body of digital twins is a data-driven model established for physical entities and behavioral logic. Twin data is the foundation of data-driven, which can achieve mapping between physical entity objects and digital world model objects, including model, behavioral logic, business processes, and state changes caused by parameter adjustments. It enables comprehensive presentation, precise expression, and dynamic monitoring of the state and behavior of physical entities in the digital world. Digital twins describe physical space in a digital form, based on models and data, to accurately map physical entities in physical space to digital models in the virtual world, and fully utilize the interaction feedback and iterative operation between the two to achieve synchronous presentation of physical entity behavior in digital space. By utilizing the diagnosis, analysis, and prediction functions of twin models, the decision-making and behavior of physical entity objects are optimized, ultimately achieving the interactive fusion of data-driven virtual and real spaces, meeting the intelligent requirements of intelligent monitoring and predictive maintenance of looms.
Digital twins have gone through a development process from the origin of the twin concept, the introduction of three-dimensional models, to the establishment of five-dimensional models. Digital twins refer to physical objects in real space, digital replicas in information space, and data connections that connect the two together. Polini et al. [8] d a digital twin tool to support lightweight design of composite components, which can help minimize geometric deviations from product nominal values. Liau et al. [9] applied digital twin technology in injection molding production, achieving production behavior simulation based on historical data, detecting the current state of machine equipment, and predicting future states. At the same time, they achieved bidirectional interaction control and deep fusion between physical space and information space. Aivaliotis et al. [10] proposed a method for achieving digital twins based on advanced physical modeling, using the multi domain unified modeling language Modelica to construct mechanical, electrical, and control system models of industrial robots, achieving monitoring and maintenance of robots. Wang et al. [11] roposed a digital twin framework for cross cutting machines, which connects physical space devices to a monitoring system and monitors the machine in real-time to improve the operational efficiency of the equipment. Fahim et al. [12] roposed an application framework based on digital twins to address the issues of poor real-time performance and low accuracy in wind farm monitoring and power generation prediction. A remote monitoring platform was established based on internet technology, and a prediction model was constructed through deep learning. The experimental results verified the good applicability of the proposed framework. Picanol BlueBox electronic system has been designed and developed by Picanol for its high-end weaving machines. Through this system, the weaving machine can be connected to a network platform, enabling remote inspection of weaving equipment and feedback potential abnormal issues to users. Yida has developed an NCP loom electronic platform that includes an IPOS intelligent production efficiency optimization system, and combined with an RTC monitoring system to form an intelligent active control system, further improving the production efficiency of the loom. Ulster Company has developed a new generation of loom monitoring and inspection system for its weaving machines. By monitoring the weaving process in real-time, it can effectively improve fabric quality and reduce production costs [13].
The above research on monitoring systems for industrial equipment and facilities mainly focuses on achieving the transmission of operational data, and building corresponding human-machine interaction platforms based on Internet and computer technology. This monitoring method can achieve remote monitoring, making it convenient for regulatory personnel to timely understand the operating status of the equipment, arrange production and predict maintenance in a planned manner. However, this monitoring system has too single functions and can only be used as a tool for data monitoring. Operators need to analyze the displayed data based on experience, which is not suitable for monitoring and predicting feedback of complex working conditions of looms. In the research of weaving machines, people have added the analysis and processing function of weaving machine operation data, using relevant theories and algorithms to reflect the current operating status of the weaving machine to a certain extent. However, these studies only focus on data mining and processing, without starting from the spatiotemporal perspective of loom operation, ignoring the specific needs of the loom at different stages of operation, and lack the ability to monitor and predict the entire cycle of loom operation. We incorporate twin data-driven model evaluation and prediction methods while conducting data mining processing to achieve intelligent prediction and maintenance of rapier looms through deep learning based on digital twins.
Many researchers have designed various digital twin models for predictive maintenance, but there is a relative lack of research and application on digital twins in the textile field. Relevant research is still in the theoretical analysis stage and has not achieved the ability to monitor and predict the entire cycle of loom operation. Therefore, in order to achieve intelligent maintenance of rapier looms, we introduce digital twin technology in order to make technological applications in the remaining lifespan and predictive maintenance of the loom. This article proposes to combine virtual simulation with physical devices, utilizing digital twins and deep learning to evaluate and predict process parameters and health status. The other parts of this article are as follows: In the second part, the overall digital twin system architecture of the rapier loom was built, and the five dimensional model was analyzed. The third part studies the predictive maintenance of digital twin driven rapier looms, which is divided into the evaluation and prediction of process parameters and the evaluation and prediction of health status. The fourth part summarizes the article.
Digital twin five-dimensional model framework for rapier looms
Structural model of digital twin system of rapier loom
The digital twin of the rapier loom is built on the basis of information and data, and uses real-time perception technology to obtain dynamic data of physical entities. With the digital twin model as the core and the intelligent algorithm as the enabling technology, the physical entity is analyzed, optimized and predicted, and finally realizes the all-round monitoring of the physical space. Figure 1 shows the structural model of the digital twin system of the rapier loom.

Structural model of digital twin system of rapier loom.
A physical entity is a system that physically exists in physical space that the digital twin is intended to map. The physical entities included in the digital twin need to have digital interfaces that enable data collection and information mapping. Virtual entities are the multidimensional twin models that are constructed during the design and operation of the physical entity, and these models can be seen as a definition of the physical entity. The twin data is the key driver of the digital twin. The monitoring system receives data collected by the data communication module, which is processed, streamlined and mined by algorithmic procedures to support state analysis and drive state mapping. Services are an important part of the digital twin, which are the interfaces of various services provided by the digital twin system to users and reflect the functions of the digital twin. Finally, connectivity is the key to realizing virtual-real interaction, and real-time dynamic data connectivity is the artery of the digital twin.
The digital twin structure model is the key to the application of the digital twin theory. As an important driving force for the development of digital twins, the proposed five-dimensional model is the latest practice of digital twin theory. With the help of the five-dimensional model, the digital mirror image of the physical entity is established, and data transmission and data analysis are used to realize the functional requirements of the monitoring system in the context of intelligent manufacturing. It gives a new paradigm that can be referred to by different application objects in different industries, as shown inEquation 1.
Where MDT is digital twins rapier loom, PE is physical entities, VR is virtual representation, DC is data curation, CS is communication scheme, and Ss for services.
The digital twin system architecture of the rapier loom is shown in Fig. 2. The architecture is mainly divided into the following five layers:

Overall framework of rapier loom digital twin system.
(1) Physical layer
The physical devices in the digital twin system mainly contain the mechanical, electrical and control subsystems of the rapier loom, external sensors, data acquisition cards and other devices. By arranging sensors on the loom and industrial Ethernet connections, the digital twin system maps the behavior of the physical entity to the virtual entity in real time. As shown in Fig. 3, the physical entity of rapier loom is shown. Figure 4 is the geometric model of the rapier loom is shown.

Physical entity of rapier loom.

Geometric model of rapier loom.
(2) Virtual layer
The virtual model in the digital twin system is a 3D rendered model based on the actual rapier loom modeling, which is constructed based on several aspects of the rapier loom such as geometry, constraint relationships, and material properties. The behavioral characteristics and logical rules of the rapier loom are also considered. Through the Open Platform Communication Unified Architecture (OLE for Process Control Unified Architecture, OPC UA), a mechanism for controlling the real machine with the virtual machine is established, enabling the virtual machine to reverse the behavior of the real rapier weaving machine. Figure 5(a) shows the hierarchical tree of the motion model of the rapier loom. The rapier loom model imported into the virtual engine is shown in Fig. 5(b).

(a) Hierarchical tree of motion model of rapier loom; (b) Virtual model of rapier loom.
(3) Data layer
The twin data is the basis for the operation of the digital twin system. The effective perception of the rapier loom operation state and the interactive mapping of the real and imaginary space completely rely on the transmission and driving of twin data. The twin data mainly includes data generated by the rapier loom control system, sensor monitoring data, weaving attribute data, environmental information and other data. The collected signals are analyzed in MATLAB after completing pre-processing such as noise reduction, and Fourier transform, etc., and effective features are extracted and transmitted to the service layer. As shown in Fig. 6, the running data transmission of the rapier loom is shown.

Schematic diagram of rapier loom operation data transmission.
(4) Service layer
By fusing physical entities, virtual entities and twin data, the rapier loom digital twin system platform is built in Unity visualization software for the whole cycle of rapier loom operation process, which can achieve the effect of transparent weaving process and intelligent equipment management. For example, through machine learning and other technologies, the twin data is mined for laws, and a mechanism model between rapier loom process parameters and loom operation status is established to analyze and evaluate the current process parameters and provide decision support for reasonable planning of process parameters. For example, a quantitative assessment and prediction model of rapier loom health status based on digital twin drive is established to realize real-time assessment and life prediction of loom operation status, and feedback control of loom based on health index to provide a reasonable decision plan for rapier loom operation and maintenance.
(5) Application layer
The application layer of the digital twin system serves as the integration of physical entities, virtual entities, service platforms, twin data, and two-two interactive connections, and is the key to effectively drive the operation of the entire system. For the predictive maintenance process, twin data such as machine setup parameters, sensor data, etc. are retrieved and dynamically refreshed in real-time in the visualization interface. The prediction results and decisions serve the intelligent operation and maintenance of rapier weaving machines to improve equipment operation efficiency and ensure production safety.
Evaluation and prediction of process parameters
The process parameter evaluation model is a twin data-driven, data analysis, machine learning and other methods to extract knowledge and establish a mechanistic model between weaving machine process parameters and operating efficiency. The process parameter evaluation model will help to change the status quo of process planning in the weaving preparation stage, optimize the process flow, and through quantitative analysis can give clear evaluation indicators to effectively avoid the impact of unreasonable process parameters on production.
As shown in Fig. 7, the process parameter evaluation process of the rapier loom is established based on the twin data. The evaluation process is divided into three parts. Firstly, the data processing part, by pre-processing and correlation analysis of the twin data, the feature data are screened to obtain. Secondly, machine learning algorithms such as neural networks are used to establish process parameter evaluation models, and relevant improvement algorithms are used to enhance the model prediction effect, and finally an evaluation model that can meet the accuracy requirements is obtained. By predicting the loom efficiency, the results can be fed back to the physical space to analyze and make adjustments to the current parameter combinations. With the operation of the monitoring system, twin data are continuously collected, and when the prediction error of the model exceeds the threshold, the model can be updated using the continuously generated twin data, so that the model has an autonomous evolutionary function.

Process parameter evaluation process based on twin data.
With reasonable process parameters, rapier looms can maintain high production efficiency. In the actual production process, considering the influence of various process parameters on the weaving effect and related evaluation indicators, five process parameters were selected as the influencing factors on the weaving effect, the speed of rapier loom, the height of the rear beam, tension during operation, the time of flat heddle, the height of the warp stopper.
In order to determine the different degrees of influence of each process parameter on the operating efficiency of the rapier loom, we use the gray system theory for analysis. Gray system theory is a control theory proposed for information-complete or incomplete systems, in which gray relational analysis is a method to characterize the degree of correlation between factors [14].
Gray relational analysis can be described as: if there are multiple different comparison series x1, x2, ⋯ , xn, the correlation coefficient pi (k) of these comparison series and reference series x0 at different times can be calculated by the following Equation:
Based on the gray correlation analysis, the degree of correlation between each process parameter and the loom operating efficiency can be obtained. The greater the degree of correlation, the greater the degree of influence of the parameter on the loom efficiency. According to the Equation 2, the process parameters affecting the efficiency of the loom are calculated, and the results are shown in Table 1.
Grey correlation analysis results
It can be seen from Table 1 that the order of influence of each influencing factor on loom operation efficiency is as follows: 1 > 5>4 > 2 > 3. The effect correlations are all greater than 0.7, indicating that each influencing factor has a great correlation with efficiency and can be used as a relevant index for analysis.
In the previous section of this paper, through the analysis of factors affecting the operating efficiency of rapier looms, the process parameters closely related to operating efficiency were obtained. Therefore, this section will study the process parameter evaluation method on the basis of the analysis of the process parameters of the rapier loom. Since the weaving process is a multi-variable and multi-indicator nonlinear complex process, it is difficult to establish a feasible mathematical model to describe this process.
BP neural network (Back Propagation Neural Network) is a very efficient and accurate model algorithm that repeatedly trains multi-layer feedforward networks through error backpropagation, which plays an important role in the field of artificial intelligence [15]. The algorithm has good self-learning, self-adaptation, robustness and generalization ability. The three-layer BP neural network can approximate any nonlinear function with arbitrary precision. The BP neural network consists of three layers: input, hidden and output, and each layer consists of a certain number of neurons. Each neuron has a threshold and each layer is connected by weights. Figure 8 shows the topology of the BP neural network, which consists of three levels: input, hidden and output.

BP neural network structure.
As a commonly used learning algorithm for neural networks, BP algorithm has the ability of precise optimization. By continuously updating the weight of the network, the error between the output value and the expected value is continuously reduced to achieve the purpose of approximation. Through the generated error, correct the direction and size of the weight of each layer of neurons and the partial derivative of the threshold until the error reaches the set value. Define the objective cost function e as:
Where, y m (n) represents the expected value of the neural network output, and y o (n) represents the actual value of the output. In order to minimize the error, it is necessary to continuously correct the weights and thresholds of the neural network, and use the gradient descent method to optimize the connection parameters. The parameter learning algorithm is as follows:
Where, α is the inertia coefficient, ω ij is the weight of the neural network connection, b ij is the threshold, and β is the learning rate of ω ij and b ij .
The traditional BP algorithm is an optimization-seeking algorithm based on local search, and the parameters of the neural network are gradually modified along the direction of local optimization, which tends to make the algorithm fall into local optimality and leads to the inability to obtain a usable neural network model. Mirjalili [16] proposed the WhaleOptimizationAlgorithm (WOA) in 2016, which is easier to operate, requires fewer parameters to be adjusted and has a better ability to jump out of the local optimum compared to the conventional heuristic algorithm. WOA draws on the group predation of whales by surrounding the prey, bubble net predation and The WOA is based on the group predation of the whale, which searches for the optimal solution by three methods: encircling the prey, bubble net predation and prey search. However, it should be noted that although WOA has some advantages over traditional optimization algorithms, it still inevitably falls into the local optimum when solving [17]. Therefore, in order to avoid the problem of low training accuracy due to local optima in solving, this paper proposes a hybrid strategy to improve the Whale Optimization Algorithm (IWOA), and then to optimize the BP neural network parameters.
Chaotic motion is a random and ergodic phenomenon, and the initial population generated by using chaotic mapping can effectively solve the problem of population homogeneity caused by the adoption of random variables for the initial population. Since Tent mapping has strong uniformity, this paper uses Tent mapping to generate the initial population, and its mapping principle can be expressed by the following equation:
Where, X n represents the initial value, X n ∈ (0, 1), and Xn+1 represents the value after a Tent mapping.
By nonlinearly adjusting the convergence factor a in the whale algorithm, it can be dynamically adjusted according to the number of iterations. As the iteration progresses, the non-linear downward trend can make the algorithm approach the target continuously, so that it has a strong local optimization ability. The following is the improved convergence factor equation:
Where, t represents the number of current iterations; T max represents the maximum number of iterations set.
In order to make the algorithm obtain larger weights at the initial iteration, the adaptive weight method is used to improve the global search performance and the population diversity. The expressions of adaptive weights are given in Equation 7, and the improved local search mathematical model of this algorithm is given in Equation 8.
Figure 9 shows the process of optimizing BP neural network by IWOA algorithm. The WOA algorithm is used in the initial stage of neural network training to perform global optimization search for parameter values in order to obtain near-optimal solutions for network weights and thresholds, and then the BP algorithm is used to iterate on the network at a later stage to obtain a more optimal model.

Improved whale algorithm optimization BP neural network flow chart.
In this paper, weaving efficiency is used as an evaluation index for weaving machine process parameters. The weaving efficiency of a rapier loom characterizes the actual output of a loom per unit of time, and this paper uses time efficiency as an evaluation index for weaving efficiency, as shown in Equation 9.
Where, T is the total running time of the loom, T f is the downtime of the loom due to failure, and T s is the downtime caused by yarn breakage.
Based on the analysis of the influence of the weaving machine process parameters on the operating efficiency, a neural network model is constructed to solve the relationship between them. The input layer of the neural network includes the speed of rapier loom, the height of the rear beam, tension during operation, the time of flat heddle, the height of the warp stopper (x1 ∼ x5), and the output layer is the time efficiency of the loom (y1). According to the empirical Equation 10, the interval in which the number of neuron nodes in the hidden layer is distributed can be calculated.
Where, m is the number of nodes in the input layer, n is the number of nodes in the output layer, a is a constant in the range of [1, 10], and l is the number of nodes in the hidden layer.
After calculation, the number of neurons in the hidden layer of the BP neural network is set to 10, the target error is set to 0.0001, the learning efficiency is set to 0.01, and the number of training times is 1000. 200 sets of data are created by using some of the production data provided by the factory as data samples. A total of 140 sets of data samples were selected as the training set to train the model, and the remaining 60 sets of data were used as the test set to verify the training effect of the model.
In order to verify the optimization performance of IWOA algorithm, BP neural network, genetic algorithm optimized BP neural network (GA-BP) and whale algorithm optimized BP neural network (WOA-BP) are selected as the comparison models in this paper. The predicted and actual values of the test samples after the models were trained are shown in Figs. 10–13.

BP model prediction result.

GA-BP model prediction result.

WOA-BP model prediction result.

IWOA-BP model prediction result.
According to the prediction results, the GA-BP, WOA-BP and IWOA-BP models all showed good prediction results on the test set, and the prediction result of BP was relatively poor. However, the differences between the models cannot be accurately distinguished by the fitting results alone. Therefore, corresponding evaluation indexes need to be introduced for accurate analysis. To further verify the specific differences in prediction accuracy of the above models, the relative analysis error (RPD), mean square error (MSE), mean absolute error (MAE), root mean square error (RMSE), and mean absolute percentage error MAPE). The expressions are shown in Equations 11-15. The statistics of evaluation indexes for different models are shown in Table 2.
Statistical table of evaluation indicators
From the statistics of evaluation indexes in Table 2, it can be seen that the BP neural network has the largest prediction error, and its prediction results correspond to MSE of 0.2357, MAE of 0.3516, RMSE of 0.4855, and MAPE of 0.3977. Compared with GA-BP, the prediction error of WOA-BP is relatively small, and the RMSE index is reduced compared with GA-BP by 0.0733, which also indicates that the WOA algorithm has better merit-seeking ability than the traditional heuristic algorithm. Among all the above methods, the IWOA-BP model has the best prediction accuracy, and its prediction accuracy is significantly higher than that of BP, GA-BP and WOA-BP models. The RMSE index shows that the IWOA-BP model has a calculated result of 0.1638, which is 0.3217, 0.1563 and 0.0830 lower than the other prediction models, respectively. The results show that the IWOA-BP model has a better prediction effect and can evaluate the process parameters of the loom more accurately.
At the same time, it should be noted that the prediction results are based on the hybrid strategy we have chosen to improve the Whale algorithm to some extent, in order to improve the situation where BP neural network algorithms are prone to falling into local optima. We use the hybrid strategy of chaotic motion to improve the Whale algorithm, and the heuristic algorithm is used for global and local optimization. Although the overall final effect is relatively accurate, it evaluates the process parameters of the loom. But we should also be aware that in modern engineering optimization problems, with the increase of variable dimensionality and the number of nonlinear constraints, meta heuristic algorithms generally tend to be locally optimal and slow convergence. Therefore, the performance of meta heuristic algorithms needs to be further improved. The Global Best Guided Firefly Algorithm, Dandelion Optimizer, and Nutcracker Optimization Algorithm (NOA) have proposed possible solutions to address these complex engineering optimization problems [18, 19]. It should be noted that naturally inspired metaheuristic optimization algorithms can be used to solve various local and global search optimization problems in engineering problems [20]. There is no single metaheuristic algorithm that can solve all optimization problems. Therefore, in order to provide the best solution to engineering optimization problems, we must focus on improving the performance of existing algorithms or developing new algorithms.
The rapier weaving machine process parameter evaluation model is built by machine learning method, and relatively accurate prediction results are obtained by using fixed data as training samples. However, with the continuous operation of the rapier loom, a large amount of new twin data will be generated, which contain information about the rapier loom in its current operating state. Since the initially established prediction model can no longer completely describe the characteristic space of the data, the sample data need to be updated in order to ensure the training efficiency of the model. In this paper, we propose a similarity-based training sample update strategy.
The Marxist distance is a distance evaluation method that can eliminate the effect of units and can ignore the effect of magnitudes on the distance between two points for evaluating the similarity between data [21]. By evaluating the distance between the newly generated test data and each of the original training samples, the data sample with the closest distance to the test data is replaced with the data, so that the features of the original data can be retained to the greatest extent possible, while new data features are introduced. For the Marx distance between two data points x and y, it can be calculated by the following equation:
Where ∑ is the covariance matrix of multidimensional random variables and μ is the sample mean. The formula of the martingale distance shows that when the martingale distance between two points in the space is close, it indicates a high similarity between two samples, and vice versa, it indicates a low similarity between samples. Therefore, when the prediction accuracy of the model cannot meet the requirement, t is necessary to use the twin data driven iterative update of the model by the method based on the Marcian distance, which is continuously updated until the prediction accuracy reaches the standard and then the prediction result is output. The flow of the twin data-driven model update method based on twin data is shown in Fig. 14.

Twin data driven model update process.
After the initial process parameter evaluation model is established based on the original training data, when new test data is input, the new test data is input into the constructed model, and the predicted value y m of the current data is output, and the current state of the model is judged by calculating the error between the predicted value y m and the expected value y. If this error is greater than the set threshold δ, it means that the current prediction model no longer reflects the real characteristics of the rapier loom. At this time, new test data can be added to the training sample, and the Marschall distance between the original training sample data and the new test data is calculated at the same time, and the data sample with the closest distance is replaced. When the prediction error is less than or equal to the threshold value, it indicates that no model update is required.
Based on the above methods, we can realize real-time updating of the twin data-driven rapier weaving machine process parameter evaluation model, thus maintaining the consistency of the model throughout the life cycle of the rapier weaving machine, realizing the self-evolution capability of the digital twin, and providing a reliable model basis for the process parameter evaluation.
After a long period of operation, there is a tendency for the performance of the loom to deteriorate. With the accumulation of time, the degree of deterioration increases, which in turn has a significant impact on the stability of the loom. The rapier weaving machine spindle is the core component that characterizes the state of the loom and transmits the power to the various actuators of the loom through the spindle. Therefore, the operating condition of the rapier weaving machine spindle itself directly affects the operating process of the loom and has a significant impact on the quality of the fabric, the operating efficiency and the service life of the loom.
In this paper, a digital twin-driven loom health state assessment and prediction method is proposed for the predictive maintenance of loom spindles. The digital twin establishes a degradation rule model in the information space to reflect the health status of the spindle, analyzes the health status in the physical space intelligently, predicts the future development trend, and then intelligently regulates the loom to achieve dynamic interaction and feedback optimization in the virtual and real space. The digital twin-driven loom state evaluation and prediction process established in this paper is shown in Fig. 15.

Digital twin driven rapier loom health assessment and prediction process.
The rapier loom health assessment and prediction process is divided into two parts: physical space and information space. The physical space is the rapier loom entity, and the information space is the health assessment and prediction model. Based on the physical degradation data of the rapier loom entity, knowledge mining and feature extraction are performed through data processing algorithms, and a health state assessment and prediction model is constructed based on deep learning, which is used to analyze and predict the health state of the spindle in real time, and visualize the health state through the monitoring platform built by Unity. At the same time, the health state of the spindle can be evaluated to give timely and targeted maintenance strategies, so that equipment maintenance personnel can have more processing time and reduce the intensity of maintenance on the equipment. When the health status of the spindle system deteriorates, control commands can be sent to the loom controller in the physical space via the monitoring system to reduce the loom speed or execute shutdown commands to protect personnel and equipment. By collecting, analyzing, predicting and making decisions on loom spindle signals, a closed-loop system for loom health management based on digital twin drive is established to achieve precise control of the loom operation process.
(1) Feature Selection
In order to be able to predict the degradation trend of the rapier weaving machine spindle system, the spindle vibration data of the rapier weaving machine needs to be collected. The rapier weaving machine spindles generally operate under normal operating conditions and have a long degradation process. Therefore, in order to obtain the degradation trend of the spindle as much as possible, the spindle vibration data were collected once a day at an interval of 2 s each time, and a total of 60 sets of vibration data were collected. The collected vibration data were processed in time series to obtain the distribution law of vibration signal with time, as shown in Fig. 16.

Rapier loom spindle degradation process data.
The spindle vibration acceleration signal in Fig. 16 shows that in the time domain, the spindle vibration signal increases gradually with the increase of operation time, and contains characteristic information that can characterize the degradation process. In this paper, a variety of feature variables are considered to characterize the degradation process, and 20 feature variables are extracted to characterize the vibration signal, including 12 time-domain features (e.g., mean value, root mean square), 4 frequency-domain features (e.g., root mean square frequency, standard deviation of frequency), and 4 spectral cliffness features (e.g., mean value and standard deviation), as shown in Table 3.
Characteristic variables
Since the original signal contains noise, the stability of the extracted feature curves is poor. Because the feature parameters need to be selected by calculating the relevant indexes subsequently, an unstable feature curve will adversely affect the analysis of monotonicity and other indexes. Therefore, the feature curve needs to be pre-processed, i.e., the curve is smoothed by moving average filtering, in order to enhance its change trend and cut the influence of noise and other disturbing factors. The following is an example of the characteristic RMS, whose original characteristic curve is shown in the blue curve in Fig. 17. It can be seen that the original characteristic curve is more volatile and does not reflect the degradation trend well. The red curve is the feature curve after the smoothing process, which can effectively reduce the fluctuation of the original feature curve by smoothing.

RMS feature index and its smoothed features.
In the above paper, after the acquisition and feature extraction of spindle degradation signals, some information on the degradation process of the spindle was obtained. However, only the degradation data of the spindle under normal operating conditions does not determine the risk threshold of the degradation process, and it is difficult to establish a quantitative description of the spindle health status. Since the degradation process of spindle bearings is slow, it is difficult to obtain comprehensive information of the degradation process. Therefore, a rapier loom of the same model as the degradation data measured above in the textile workshop was selected for this paper. At this time, the rapier loom had already experienced an increase in body vibration amplitude after a long period of operation, indicating that the spindle of the loom had already experienced a more obvious failure. Therefore, in order to establish the risk threshold of degradation and to quantify the health level, the vibration signal of the main shaft of the loom was extracted as the fault signal, and a total of 5 s of vibration data was collected, as shown in Fig. 18.

Loom spindle fault vibration signal.
(2) Sensitive degradation feature set construction
In order to characterize the degradation process of the main axis more comprehensively, a total of 20 characteristic variables were selected above as effective indication features for the degradation process. However, not all of the above 20 feature parameters can accurately reflect the degradation state of the system. In order to prevent the redundant features from negatively affecting the assessment and prediction of the degradation state of the system, the above features need to be filtered and the feature parameters that are not sensitive to the state change need to be eliminated.
The monotonicity and correlation indicators are linearly combined to obtain a composite indicator to evaluate the sensitivity of the degradation features and thus to better understand how indicative they are of the degradation process. Equation 17 is the monotonicity indicator and Equation 18 is the correlation indicator.
The weights of monotonicity and correlation indexes are set to 0.75 and 0.25, respectively, so as to improve the accuracy and reliability of the composite indexes. The composite indexes are calculated and ranked according to equation 19, and the results are shown in Fig. 19.

Correlation analysis of characteristic variables.
The seven feature values with the largest combined metrics are selected, then the final feature set includes energy (F12), mean frequency (F14), waveform factor (F8), standard deviation (F2), root mean square (F7), cliffness (F4), and spectral cliffness mean (F17). After filtering, these seven feature variables can be used to train the model.
(3) KPCA dimensionality reduction
Kernel Principal Component Analysis (KPCA) is an effective algorithm to deal with nonlinear feature sets, which is a nonlinear transformation of PCA, constructing a nonlinear mapping from the input space to the feature space by kernel functions, and then performing the operations of PCA in the feature space [22]. Compared with the PCA algorithm, the KPCA algorithm introduces the idea of kernel function mapping, which reduces the computational difficulty of expressions in the transformation process.
In this paper, the KPCA algorithm is used to reduce the dimensionality of the extracted feature parameters. Using Radial Basis Kernel Functions,

Characteristic value after feature extraction of KPCA algorithm.
According to the data in Table 4, the contribution rate of the first core pivot KPCA1 is as high as 89.5683%, which covers almost all the information of the feature set; the contribution rate of the second core pivot KPCA2 is 10.2624%; the third core The contribution rate of the pivot KPCA3 is 0.1646%. Since the cumulative contribution rate corresponding to the first two eigenvalues obtained after KPCA dimensionality reduction exceeds 99%, the projection matrix can be constructed through the eigenvectors corresponding to their eigenvalues, and the feature data can be completed through the projection matrix. The projection is transformed to obtain the corresponding kernel pivot. Visualize the obtained first two nuclear principal components, and obtain the distribution of nuclear principal components as shown in Fig. 21.
Results of kernel principal component analysis
Health index grading

KPCA data dimension reduction results.
It can be seen from Fig. 21 that, with the continuous degeneration of the main axis, the value of the first core principal component is gradually increasing. Therefore, the first kernel principal component is used as the feature index after dimensionality reduction of the feature data to reflect the degradation state of the loom spindle, which is helpful for evaluating the current health status of the loom spindle and predicting the remaining life. The degradation process of the loom spindle system represented by the first kernel principal component is shown in Fig. 22.

Spindle degradation trend characterized by KPCA1.
The evaluation and prediction of equipment health status is mainly done by collecting equipment data, obtaining features that can reflect the operation status and constructing evaluation indexes. In the previous section, a kernel principal component that can reflect the degradation process was obtained by the KPCA algorithm to reduce the dimensionality of the data, but it is still a critical issue to relate the kernel principal component to the health status of the spindle for effective health status evaluation. Therefore, in this section, HealthIndex (HI) is constructed as an evaluation index to characterize the health status of the spindle to better describe the state of the spindle quantitatively. The first nucleus principal element KPCA1 is used as the evaluation index of the health status of the weaving machine spindle, and the nucleus principal element corresponding to the fault data is used as the risk threshold, and then the health status is described quantitatively. Since the health index is a dimensionless value between 0 and 1, it needs to be normalized and mapped to the interval where the health index is located in order to eliminate the difference in magnitude. Let the first core principle PCA1 be K ={ k1, k2, ·· · , k
n
}, The normalized value is used as the health index to characterize the operating state of the spindle, and the expression of the health index HI is:
There is a linear relationship between the health index and the health status of the equipment; the greater the health index, the higher the health level of the corresponding equipment. In order to qualitatively describe the state of the equipment, the health index can be empirically graded. For rapier weaving machines, the operating status can generally be divided into four classes: healthy, sub-healthy, slightly faulty and faulty. A mapping relationship between the health indices according to the range of values taken and the health condition classes is established, as shown in Table 5. The health index of the degradation process determined based on the risk threshold is shown in Fig. 23.

Spindle degradation process health index.
After constructing the health index, the mechanistic relationship between timing and health index needs to be established. Through the analysis of different timing prediction models above, this paper uses BiLSTM network to evaluate and predict the health status of the spindle. The results of the model analysis can reflect the current operating state of the loom based on the health level, and thus better predict its future changes and development trend.
As can be seen from Fig. 24, the BiLSTM network consists of a forward LSTM and an inverse LSTM, both of which have the same input x t , only the direction of information transfer is different, and the output y t of the BiLSTM network is:

BiLSTM network structure.
In order to verify the prediction effect of BiLSTM network, BP neural network and LSTM network are introduced as a comparison with it in this paper, and the mean absolute error (MAE), mean square error (MSE), root mean square error (RMSE) and mean percentage error (MAPE) are used to evaluate the accuracy of different algorithms.
Next, different networks need to be trained with the health index dataset, and the first 45 sets of data from the HI dataset are used to train the network and predict the trend of the health index for the next 15 days. Before the network training, the parameters of the network need to be set. The initial learning rate of the BiLSTM network is set to 0.005, the sliding time window size is set to 7, the number of hidden layer neurons is 200, and the training times are 1000. to prevent overfitting, the forgetting rate can be set in the network parameters. The forgetting rate is set to 0.1, which means 30% forgetting. The loss function uses the square loss function, and the LSTM network sets the same training parameters as the BiLSTM network. For the BP network, the maximum training number is 1000, the learning rate is 0.02, and the training error is 0.0001. the health index is trained and predicted using BP, LSTM and BiLSTM networks, and the obtained prediction errors are shown in Table 6.
Prediction error of three algorithms
The MAE is 0.0368 and 0.0425 larger than that of LSTM and BiLSTM, respectively, and the RMSE is 0.0438 and 0.0779 larger than that of LSTM and BiLSTM, respectively. The MAE and RMSE of the LSTM are 0.0057 and 0.0086 larger than those of the BiLSTM, and the BiLSTM algorithm has the smallest error index and shows good prediction accuracy.
To clearly demonstrate the prediction process of each algorithm, the above three algorithms are compared, as shown in Fig. 25. From Fig. 25, it can be seen that the prediction results of both LSTM and BiLSTM networks are better than those of BP neural networks. the errors between the prediction results and the true values of LSTM and BiLSTM are the smallest, and the prediction performance of BiLSTM, which considers the forward and backward timing, is better than that of LSTM, which only considers the forward timing.

Comparison of BP, LSTM, and BiLSTM prediction processes.
Process parameter prediction and evaluation model testing
In the evaluation of the above process parameter models, it was determined that the IWOA-BP model has a good predictive effect and can accurately evaluate the process parameters of the loom. It is necessary to test the optimization situation of the algorithm and evaluate the performance of the optimization algorithm. In order to propose an updated algorithm for comparison, the algorithm iteration process will be analyzed. As shown in Fig. 26.

IWOA-BP fitness curve.
From Fig. 26, it can be seen that the IWOA-BP model reached its optimal fitness at the 5th iteration, with a fitness value of 0.1109. It can be seen that the IWOA algorithm has good adaptability and optimization performance. For complex weaving processes with multiple variables, multiple indicators, and nonlinearity, a practical and feasible mathematical model can be better constructed to describe this process. Under a more accurate evaluation model, twin data-driven model updating and optimization can be carried out more accurately, which is conducive to maintaining consistency in the construction of the entire life cycle evaluation model for rapier weaving and achieving monitoring and prediction capabilities throughout the entire life cycle of weaving machine operation.
To verify the actual operational capability of the loom process parameter evaluation module, actual weaving experiments were conducted on the rapier loom. During the experiment, a total of 5 sets of process parameters were set. Before actual weaving, the process parameters were input into the parameter analysis interface of the monitoring system to predict the operating efficiency of the loom. Then, experiments were conducted on each group of parameters and the actual operating efficiency was statistically analyzed. The experimental results are shown in Table 7.
Experimental data of loom weaving
According to Table 7, in the 5 tissue experiments, the minimum prediction error is 0.23%, the maximum prediction error is 0.44%, and the average prediction error is 0.33%. According to the above experimental results, it can be seen that the process parameter evaluation module of the rapier loom monitoring system has high prediction accuracy, which can accurately analyze the process parameters and provide effective reference for the planning of process parameters of the loom.
In order to quantify the effectiveness of health status prediction, the accuracy of the prediction was tested in practice with the goal of predicting the remaining lifespan of the spindle. This article uses a single step rolling prediction method to predict the system failure time. Train BiLSTM with all health indicator data obtained from degraded data, and use the last predicted value as the first training value for rolling prediction, and add it to the training data. Starting from the second step, the network state is updated with input parameters composed of the first predicted value and the original training data, and the next time step is predicted. The prediction process is shown in Fig. 27 by conti nuously rolling forward in a cyclic manner.

BiLSTM life index prediction process.
From Fig. 27, it can be seen that the residual life indicator of the risk threshold obtained by rolling prediction based on degradation process data is about 10 days. However, considering that the original data is collected at intervals, the actual life indicator should be around 20 days. The number 20 here is only used as a qualitative indicator and does not mean that a malfunction occurs after 20 days. In the early stages of model prediction, due to the fact that the input parameters are basically raw data, the prediction accuracy is relatively high. However, as rolling predictions continue, prediction errors will accumulate, resulting in unsatisfactory long-term prediction results. However, for unknown data, it is already difficult to predict, so it is necessary to set a reasonable prediction interval to accurately predict future trends while ensuring certain errors.
In the actual production process, the health index risk threshold set by the maintenance personnel is 7 days. Our life index prediction method was used to measure that the loom malfunctioned after more than 20 days. As a result, we ran the loom normally, and on the 23rd day, the surface unevenness of the loom occurred, indicating that the loom had a relatively obvious malfunction. It can be seen that our method can basically accurately predict the remaining service life of the rapier loom, we have greatly improved our prediction level by comparing the current weaving machine prediction level with weekly or even monthly reference periods. So, when it is predicted that the remaining life index of the spindle system is less than 7 days, it is necessary for maintenance personnel to inspect the loom spindle and maintain key components.
During the operation of the monitoring system, timely data transmission is required to ensure the real-time visualization of monitoring. In order to evaluate the data transmission performance of the system, the communication delay of the system was tested. In a LAN environment, the time difference between sending and receiving data is recorded as the communication delay time. A total of 50 sets of delay data were recorded during operation, as shown in Fig. 28. The maximum delay for data transmission is 73.4 ms, the minimum delay is 71.7 ms, and the average communication delay is 72.6 ms. The overall communication delay of the monitoring system can be controlled within 100 ms. Although the real-time performance of the system cannot be compared to enterprise level monitoring systems, this article aims to monitor the operation status of a single rapier loom. This delay does not significantly affect the monitoring effect, so it is acceptable.

Data transmission delay test.
During the operation of the loom, the real-time vibration signal of the spindle is collected to evaluate the current health index of the loom, and the spindle speed of the rapier loom is adjusted based on the health index. When the real-time vibration exceeds the vibration threshold determined by the virtual system, the real-time vibration value is compared with the maximum threshold set by the system. If the real-time vibration exceeds the maximum threshold, the virtual system will give an alarm and emergency stop, and the loom equipment will wait for manual processing. If it is less than the maximum threshold, the virtual system will issue an alarm. At this time, the vibration of the loom spindle may affect the quality and safety of processing, reminding operators to pay attention and be vigilant. When the real-time vibration is less than the vibration threshold determined by the virtual system, the loom operates normally and the virtual system continuously monitors.
In order to meet the demand for intelligent operation and maintenance of rapier looms, this paper proposes an intelligent predictive maintenance approach for rapier looms driven by digital twins. The main contributions of our work are as follows: A digital twin architecture for the full operating cycle of rapier weaving machines was developed for understanding and analyzing rapier weaving machines. Based on the rapier weaving machine digital twin architecture, an IWOA optimized BP neural network for process parameter evaluation and prediction is proposed to predict the operating efficiency of the weaving machine in the future period based on the highly correlated equipment parameters. A model self-renewal method is proposed based on twin data, and the network parameters are continuously corrected by dynamic twin data so that the model has the ability of self-evolution. Based on the rapier weaving machine digital twin architecture, a BiLSTM-based health state assessment and prediction is proposed to construct a health index as an evaluation index to characterize the health condition of the spindle, to realize the prediction of the remaining life of the spindle, and then to make maintenance decisions.
Digital twinning is a complex technology that involves multiple disciplines and fields. Realizing a complete digital twin is a lengthy process that requires the collaboration of various methods and tools. Our future work plan is as follows: On the basis of mapping the geometric, physical, and rule levels, further mapping the physical and rule level information, such as the mechanical characteristics of the mechanism, to establish a more comprehensive digital twin of the rapier loom, and to achieve comprehensive monitoring of the entire equipment using artificial intelligence technologies such as deep learning. There is no single metaheuristic algorithm that can solve all optimization problems, so in order to provide the best solution to engineering optimization problems, we must focus on improving the performance of existing algorithms or developing new algorithms. The digital twin monitoring system established in this article only focuses on the core equipment of textile production and does not have the ability to monitor large-scale equipment in the production workshop. In the future, the application scope of the digital twin monitoring framework proposed in the article can be extended to the textile workshop, and a monitoring system for the complete textile production process can be established.
Footnotes
Acknowledgments
(1) Competing Interests and Funding
The authors have no financial or proprietary interests in any material discussed in this article.
This work was supported in part by the Natural Science Foundation of Hebei Province under Grant E2022202136.
(2) Data availability
Data sharing not applicable to this article as no datasets were generated or analysed during the current study.
(3) Replication of results
No results are presented.
