Fiber dyeing performance prediction method based on mha-pinn model
By combining the MHA-PINN model with multi-head attention and physical information neural networks, the problems of scarce sample data and complex nonlinear coupling relationships in the fiber dyeing process are solved, achieving high-precision and robust fiber dyeing performance prediction and supporting intelligent control of industrial production.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- DONGHUA UNIV
- Filing Date
- 2026-03-23
- Publication Date
- 2026-06-19
Smart Images

Figure CN122245499A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of AI algorithm and fiber cross-disciplinary technology, and relates to a fiber dyeing performance prediction method based on the MHA-PINN model. Background Technology
[0002] Polyester fiber dyeing is a complex, nonlinear industrial process. Traditional data-driven algorithms are no longer suitable for the highly nonlinear data characteristics of modern industry. Therefore, using deep learning algorithms to model and predict complex fiber dyeing processes is becoming increasingly popular. Furthermore, in actual fiber dyeing processes, the depth of dyeing directly affects the quality of the resulting fibers, as the dyeing process influences subsequent applications.
[0003] In the dyeing process of polyester fiber production, on-site engineers typically monitor and adjust individual key indicators based on their experience. This method often involves complex measurement steps and is time-consuming and costly. Therefore, there is an urgent need for a predictive method that can predict the dyeing performance of polyester fibers based on set production parameters without online debugging. However, fiber dyeing is a complex physicochemical process involving multiple stages such as dye molecule penetration, diffusion, and adsorption. It is affected by the coupling of various process parameters such as dyeing temperature, dyeing time, dye concentration, liquor ratio, and pH value. Significant nonlinear interactions exist between these parameters, resulting in a complex dyeing mechanism and making modeling difficult.
[0004] Currently, there is limited theoretical research on this topic both domestically and internationally. The main approaches utilize data-driven prediction methods such as support vector machines or artificial neural networks. For example, the literature (Preparation of Cationic Dyeable PTT Fibers and Machine Learning-Assisted Performance Prediction [D]. Donghua University, 2025) employs the extreme learning algorithm, using Moore-Penrose generalized inverse instead of gradient-based backpropagation to train the model, resulting in better generalization ability and extremely fast learning speed. However, this method relies solely on data-driven modeling, failing to fully utilize the inherent physical mechanisms of the dyeing process. Furthermore, it is prone to overfitting when dealing with small sample scenarios and cannot adequately capture the nonlinear coupling relationships between process parameters, thus limiting prediction accuracy.
[0005] In recent years, the rise of Physical Information Neural Networks (PINNs) has provided a new approach to solving the aforementioned problems. PINNs achieve collaborative modeling of data-driven approaches and physical laws by embedding physical laws into the loss function as residuals. Their fitting ability does not directly depend on large-scale training datasets, giving them a significant advantage in small-sample scenarios. However, applying PINNs to fiber dyeability prediction still faces two major challenges: first, the dyeing process involves multi-parameter coupling, and traditional PINNs, using fully connected networks, struggle to capture the nonlinear dependencies between variables; second, dyeing experiments are costly, and high-quality samples are extremely limited, making it easy for PINNs to converge to local optima under small-sample conditions, leading to decreased prediction accuracy.
[0006] Therefore, it is of great significance to study a fiber dyeing performance prediction method based on the MHA-PINN model to solve the problems existing in the current technology. Summary of the Invention
[0007] The purpose of this invention is to solve the problems existing in the prior art and provide a fiber dyeing performance prediction method based on the MHA-PINN model.
[0008] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0009] The fiber dyeing performance prediction method based on the MHA-PINN model preprocesses the collected original fiber dyeing dataset and inputs it into the trained MHA-PINN model to output the predicted fiber dyeing performance index.
[0010] The MHA-PINN model consists of a connected Multi-Head Attention (MHA) module and a Physics-Informed Neural Network (PINN) module. The loss function of the PINN module is embedded in the quasi-second-order coloring dynamics equation in the form of residuals.
[0011] The pseudo-second-order staining kinetic equation is:
[0012] ;
[0013] In the formula, The rate constant is a second-order kinetic reaction. Let t be the fiber dye uptake rate. To balance the staining rate, t is the staining time.
[0014] As a preferred technical solution:
[0015] As described above, the fiber dyeing performance prediction method based on the MHA-PINN model uses historical data of dyeing process variables and fiber dyeing performance indicators collected from sensors during the fiber dyeing process to construct the original fiber dyeing dataset.
[0016] The variables in the dyeing process include dyeing temperature, dyeing time, dye concentration (the percentage of dye mass relative to the mass of the fabric being dyed), liquor ratio, and pH value. The fiber dyeing performance indicators include dye uptake and K / S value.
[0017] The fiber dyeing performance prediction method based on the MHA-PINN model described above includes preprocessing such as Min-Max normalization, data augmentation, and integrated feature selection.
[0018] Data augmentation is performed using a variational autoencoder (VAE).
[0019] The fiber dyeing performance prediction method based on the MHA-PINN model described above integrates the following process for feature selection: three embedded feature selection algorithms, Lasso (a special type of linear regression), random forest, and XGBoost, are used to calculate feature importance in parallel. The final feature importance ranking is obtained by merging them using the averaging method. The top three variables are selected as key input variables, while the dyeing time variable is retained for subsequent physical constraints. The top three variables are dyeing temperature, dye concentration, and liquor ratio.
[0020] The calculation formula for the multi-head attention module in the fiber dyeing performance prediction method based on the MHA-PINN model, as described above, is as follows:
[0021] ;
[0022] ;
[0023] ;
[0024] in, For the input feature matrix, , and For the first The trainable parameter matrix of each attention head, , and Let X be the query matrix, key matrix, and value matrix obtained through a linear mapping, respectively. Scaling factor The first attention head and the second attention head are respectively. The output of the h-th attention head The result is the linear transformation of the concatenated outputs of all attention heads. To output the parameter matrix of the linear transformation, For the number of attention heads.
[0025] The fiber dyeing performance prediction method based on the MHA-PINN model described above includes an input layer, several hidden layers, and an output layer in the physical information neural network module. The hidden layers use the ReLU activation function.
[0026] As described above, in the fiber dyeing performance prediction method based on the MHA-PINN model, the total loss function of the physical information neural network module is a weighted sum of data loss and physical constraint loss, as shown in the formula:
[0027] ;
[0028] in, and Here, w1 and w2 are the weights for data loss and physical constraint loss, respectively. The optimal value of w2 is determined experimentally to be 0.001. For the sample size, These are the model's predicted values for all staining properties. For the true value, This is the model's predicted value for the dyeing rate.
[0029] The specific derivation process of the total loss function of the physical information neural network module is as follows:
[0030] In general, the generalized nonlinear ordinary differential equation can be expressed as follows:
[0031] ;
[0032] in It is the unknown function to be solved. It is a mathematical operator that represents the expression for... Various nonlinear operations are performed.
[0033] Due to the true solution We typically cannot write the expression directly, so we use a neural network. To "represent" it, among which This is the network parameter set. Adjustments can be made... This allows the neural network to get closer and closer to the true solution;
[0034] Using neural networks to analyze the true solution To approximate, denoted as ,in This is the network parameter set. Substituting the approximate solution into the original equation, we obtain the residual of the differential equation:
[0035] ;
[0036] Precise calculations can be performed using automatic differentiation techniques. The derivative is used to obtain the residual. .
[0037] By optimizing network parameters Minimize the total loss function, which consists of a data fitting term and a physical residual term:
[0038] ;
[0039] ;
[0040] ;
[0041] in, For the generalized total loss function, For data fitting loss, Loss due to physical constraints; For the training data points at the initial / boundary conditions, These are the residual calculation points sampled from within the domain; For neural networks to handle input The predicted output;
[0042] The pseudo-second-order staining kinetic equation is:
[0043] ;
[0044] Output dyeing rate using the MHA-PINN model. Approaching the true staining rate Substituting into the equation and rearranging the terms, we obtain the physical residual:
[0045] ;
[0046] Physical constraint loss when predicting fiber dyeing ::
[0047] ;
[0048] Although the red and blue K / S values are not directly used as constraints in the quasi-second-order dynamic equations, they are strongly correlated with the staining rate and share the underlying multi-head attention layer and hidden layer feature representations with the staining rate. Therefore, the physical constraints of the staining rate will indirectly affect the prediction results of the K / S values through shared parameters, making them physically reasonable as well.
[0049] At the same time, we introduce weighting coefficients. and To balance the contributions of data fitting loss and physical constraint loss, the specific expression is substituted to obtain the total loss function of MHA-PINN for fiber dyeing prediction. :
[0050] ;
[0051] in, Let be the total number of initial and boundary condition points. This represents the total number of residual points. In MHA-PINN, all training samples provide true labels and are used to calculate the physical residuals; therefore... .
[0052] The fiber dyeing performance prediction method based on the MHA-PINN model described above uses the Adam optimizer to train the MHA-PINN model and sets the hyperparameter values of the MHA-PINN model through empirical parameter tuning.
[0053] Invention principle:
[0054] This invention integrates a multi-head attention mechanism with a physical information neural network (PIN) to construct an end-to-end MHA-PINN model for predicting fiber dyeing performance. The uniqueness of this combined architecture lies in its ability to capture the nonlinear coupling relationships between dyeing process variables (such as the synergistic effect of temperature and time on diffusion rate) through a multi-head attention module, and then embed the quasi-second-order dyeing kinetic equation as a physical constraint through the PIN module. This achieves collaborative modeling of data-driven and physical laws, solving the technical challenge of handling variable coupling and maintaining physical consistency simultaneously under small sample conditions in purely data-driven models. This represents an architectural innovation of deep learning in the field of fiber dyeing prediction. The invention embeds the quasi-second-order dyeing kinetic equation as a residual into the loss function of the PIN. Its uniqueness lies in the fact that the reaction rate constant k and equilibrium dyeing rate in the equation are dynamically determined parameters based on process conditions such as dyeing temperature, dye concentration, and liquor ratio. These are embedded as known physical knowledge in the loss function during model training and do not participate in parameter optimization. Automatic differentiation technology is used to calculate dCt / dt and calculate the residual with the right-hand side of the equation to form a physical constraint loss term. This design enables physical constraints to force the network output to approximate the physical equations, limiting the feasible solution space to a subset that conforms to physical laws. This directly suppresses overfitting under small sample sizes and significantly improves the model's prediction accuracy. Simultaneously, by using the reaction rate constant k and equilibrium dyeing rate as known parameters, the model can adaptively learn the kinetic characteristics of specific dyeing systems during data fitting, thereby ensuring the physical consistency of the prediction results. This directly enhances the accuracy and reliability of the predictions, improves the model's modeling accuracy and generalization ability for complex dyeing processes, and makes the model of this invention exhibit excellent prediction accuracy, robustness, and physical consistency in fiber dyeing performance prediction tasks.
[0055] Beneficial effects:
[0056] (1) The present invention provides a fiber dyeing performance prediction method based on the MHA-PINN model, which integrates the multi-head attention mechanism with the physical information neural network to construct an end-to-end MHA-PINN model for fiber dyeing performance prediction. This solves the problems of low prediction accuracy and poor generalization ability caused by the scarcity of sample data, complex nonlinear coupling relationship between variables and lack of physical mechanism integration in the existing fiber dyeability prediction methods.
[0057] (2) The fiber dyeing performance prediction method based on the MHA-PINN model of the present invention uses variational autoencoder for data augmentation and combined with integrated feature selection, which effectively solves the problem of unstable model training caused by the scarcity of fiber dyeing experimental data and improves the generalization performance of the model.
[0058] (3) The fiber dyeing performance prediction method based on the MHA-PINN model of the present invention introduces a multi-head attention mechanism, which can automatically capture the nonlinear dependence between dyeing process parameters (such as temperature, time and concentration), generate better feature representation, and improve prediction accuracy.
[0059] (4) The fiber dyeing performance prediction method based on the MHA-PINN model of the present invention embeds the quasi-secondary dyeing kinetic equation into the loss function of the physical information neural network, so that the model prediction results conform to the physical laws of the dyeing process, and can still maintain reasonable output in the data sparse region, thus avoiding the risk of overfitting of the pure data-driven model.
[0060] (5) The fiber dyeing performance prediction method based on the MHA-PINN model of the present invention can realize rapid online prediction of fiber dyeing performance indicators, timely feedback to guide actual production, reduce raw material waste and time costs, and meet the needs of intelligent production.
[0061] (6) A fiber dyeing performance prediction method based on the MHA-PINN model of the present invention. The MHA-PINN model has the ability to predict multiple dyeing performance indicators at the same time. The output layer outputs four indicators at the same time: red dyeing rate, red K / S value, blue dyeing rate, and blue K / S value. This design meets the needs of simultaneous monitoring of multiple targets in industrial production and reflects the practicality and efficiency advantages of the model in practical applications. Attached Figure Description
[0062] Figure 1 The flowchart shows the fiber dyeing performance prediction method based on the MHA-PINN model.
[0063] Figure 2 This is a schematic diagram of the integrated feature selection model results of the present invention;
[0064] Figure 3 The diagram shows a comparison between the predicted and actual values of red uptake rate for the MHA-PINN model, ANN model, ELM model, and ML-MR model of this invention, respectively.
[0065] Figure 4 The diagram shows a comparison between the predicted and actual values of red K / S for the MHA-PINN model, ANN model, ELM model, and ML-MR model of this invention.
[0066] Figure 5 The diagram shows a comparison between the predicted and actual values of the blue dyeing rate of the MHA-PINN model, ANN model, ELM model, and ML-MR model of this invention, respectively.
[0067] Figure 6This is a schematic diagram showing the comparison between the predicted and actual values of blue K / S for the MHA-PINN model, ANN model, ELM model, and ML-MR model of this invention. Detailed Implementation
[0068] The present invention will be further described below with reference to specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. Furthermore, it should be understood that after reading the teachings of this invention, those skilled in the art can make various alterations or modifications to the invention, and these equivalent forms also fall within the scope defined by the appended claims.
[0069] The test methods involved in the performance indicators in the embodiments and comparative examples of this invention are as follows:
[0070] Dye uptake rate: After dyeing, the fiber to be tested is removed and washed multiple times with distilled water. The washing solution is then transferred to the residual solution. The absorbance A of the original solution and the residual solution is measured using a UV-Vis spectrophotometer. The formula for calculating the dye uptake rate is as follows:
[0071] ;
[0072] In the formula: E is the dyeing rate, A0 is the absorbance of the original solution, and A1 is the absorbance of the residual solution.
[0073] K / S value: After the dyed fibers are dried, the K / S value of the sample is determined using a Datacolor 850 colorimeter. Before testing, the colorimeter is calibrated using a black light trap, followed by calibration using a white ceramic plate. After calibration, the sample is flattened into a ball shape for measurement. Multiple points are tested five times for each test, and the average value is taken. The K / S value indicates the surface color depth of the sample. The larger the K / S value, the darker the surface color of the sample and the higher the dye concentration on the sample surface.
[0074] The fiber dyeing performance prediction method based on the MHA-PINN model, taking the dyeing process of cationic dyeable poly(propylene terephthalate) (CDPTT) fibers as an example, includes the following specific steps:
[0075] (1) The original fiber dyeing dataset was constructed by collecting historical data of 40 sets of dyeing process variables and fiber dyeing performance indicators from sensors in the fiber dyeing process;
[0076] The variables in the dyeing process include dyeing temperature (80~120℃), dyeing time (20~100min), dye concentration (1%~5%), liquor ratio (1:20~1:40) and pH value (4~5); the corresponding fiber dyeing performance indicators include red dyeing rate, red K / S value, blue dyeing rate and blue K / S value.
[0077] The original data is shown in Table 1:
[0078] Table 1
[0079]
[0080]
[0081] (2) Preprocessing of the original fiber staining dataset:
[0082] (2.1) Perform Min-Max normalization on each sample in the original fiber staining dataset to map it to a uniform interval [-1, 1] to eliminate the influence of dimensions and improve the stability of model training;
[0083] ;
[0084] In the formula, It is a normalized value. Indicates the initial value of a variable. and These represent the minimum and maximum values of all variables, respectively.
[0085] (2.2) The 40 normalized samples were randomly divided into a training set (20 sets), a validation set (10 sets), and a test set (10 sets) in a 2:1:1 ratio. The 20 training sets were augmented using a variational autoencoder (VAE) to generate 110 composite samples, which were added to the training set to construct the augmented fiber staining dataset, i.e., the final training set consisted of 130 sets. The validation set and test set remained unchanged.
[0086] (2.3) Perform integrated feature selection on the enhanced fiber dyeing dataset to screen out key process variables that have a significant impact on dyeing performance indicators;
[0087] The specific process of ensemble feature selection is as follows: Three embedding feature selection algorithms—Lasso, Random Forest, and XGBoost—are used in parallel to calculate feature importance, and then fused using an averaging method to obtain the final feature importance ranking. The results are as follows: Figure 2 As shown, the three variables with the highest ranking—dyeing temperature, dye concentration, and liquor ratio—were selected as key input variables. At the same time, the dyeing time (duration) variable was retained for subsequent physical constraints, and the pH variable was removed to reduce the complexity of the model.
[0088] (3) Constructing such Figure 1 The MHA-PINN model shown;
[0089] The MHA-PINN model includes a connected multi-head attention (MHA) module and a physical information neural network (PINN) module;
[0090] The calculation formula for the multi-head attention module is:
[0091] ;
[0092] ;
[0093] ;
[0094] in, For the input feature matrix, ; The number of samples; For the number of attention heads, =4; , and For the first The trainable parameter matrix of each attention head, ; , and These are the query matrix, key matrix, and value matrix obtained from X through linear mapping, respectively. Scaling factor , The hidden layer dimension of the model; The first attention head and the second attention head are respectively. The output of the h-th attention head The result of a linear transformation after concatenating the outputs of all attention heads (i.e., the feature matrix output by the multi-head attention module). To output the parameter matrix of the linear transformation, ;
[0095] The feature matrix output by the multi-head attention module Concatenating the input vector with the staining time variable yields the input vector. ;
[0096] The physical information neural network module consists of an input layer, three fully connected hidden layers, and an output layer. Each hidden layer has 64 neurons and uses the ReLU activation function. The output layer has four neurons, outputting predicted values for four fiber staining performance indicators: red staining rate, red K / S value, blue staining rate, and blue K / S value. The loss function of the physical information neural network module is embedded in the quasi-second-order staining kinetic equation in residual form. The quasi-second-order staining kinetic equation is as follows:
[0097] ;
[0098] In the formula, The rate constant is a second-order kinetic reaction. Let t be the fiber dye uptake rate. To determine the equilibrium dye uptake rate, t represents the dyeing time. Under experimental conditions of a liquor ratio of 1:20, pH 5, dye concentration of 1%, and dyeing temperature of 100℃, the equilibrium dye uptake rate of cationic red dye was calculated by fitting the slope and intercept of the curve. The rate is 97.85%, and the reaction rate constant is... It is 5.38 Equilibrium dye uptake of cationic blue dye The rate is 99.01%, and the reaction rate constant is... It is 4.13 ;
[0099] The total loss function of the physical information neural network module is a weighted sum of data loss and physical constraint loss, as shown in the formula:
[0100] ;
[0101] in, and These are the weights for data loss and physical constraint loss, respectively. For the sample size, These are the model's predicted values. For the true value, This represents the model's predicted value for the dye uptake rate;
[0102] (4) The original fiber staining dataset after step (2) is preprocessed is used to train the MHA-PINN model using the Adam optimizer, and the hyperparameter values of the MHA-PINN model are set by the empirical parameter tuning method.
[0103] When training the MHA-PINN model, if the loss function value no longer decreases for several consecutive iterations, training is stopped early; otherwise, the hyperparameter values are adjusted and training continues until the stopping condition is met.
[0104] Hyperparameter values include the number of heads in the multi-head attention module, the dimension of the hidden layer, the weights of the physical constraint loss, the learning rate, the batch size, and the number of iterations;
[0105] The number of heads in the multi-head attention module is set to 4, and the hidden layer dimension is... Set to 16; w1 is fixed at 1, the optimal value of w2 is determined to be 0.001 through experiments, the learning rate is 0.001, the batch size is 32, the maximum number of iterations is 500, and the early stopping rounds are 50 (if the validation set loss does not decrease for 50 consecutive iterations, training is stopped).
[0106] During training, the total loss function of MHA-PINN is calculated in each iteration, and the network weights are updated through backpropagation; after training, the deep features output from the feature space in the last iteration are saved. And the weight parameters of the decoder (i.e., MHA-PINN).
[0107] (5) Input the preprocessed original fiber dyeing dataset from step (2) into the trained MHA-PINN model and output the predicted fiber dyeing performance indices; the predicted values of red dyeing rate, red K / S value, blue dyeing rate, and blue K / S value are shown in Table 2 below:
[0108] Table 2
[0109]
[0110] (6) Model testing and performance evaluation;
[0111] To verify the accuracy of the MHA-PINN model, this invention also inputs test samples obtained under different experimental conditions from the past into MHA-PINN, which outputs predicted values, and calculates the mean square error (MSE), root mean square error (RMSE), and correlation coefficient by combining them with the true values. The calculation formula is as follows:
[0112]
[0113]
[0114]
[0115] Ten sets of test samples were input into the trained model, and the root mean square error (RMSE), mean squared error (MSE), and coefficient of determination (R²) between the predicted and actual values were calculated. The model was compared with three other models: Artificial Neural Network (ANN), Extreme Learning Machine (ELM), and Mixed loss-guided modular regression for dependent system reliability (ML-MR, Reliab. Eng. Syst. Saf. 2026, 267, 111898.). The hyperparameters of each model were independently optimized to ensure a fair comparison. The results are shown in Table 3. MHA-PINN achieved the best performance across all four output metrics, especially in the blue K / S value prediction, where the RMSE was 0.8411, significantly better than ANN (1.2308) and ELM (1.1959), verifying the effectiveness of the method. Simultaneously, the predicted and actual values were plotted as shown in Table 3. Figures 3-6 The scatter plot shown visually displays the prediction accuracy.
[0116] Table 3
[0117]
[0118] To verify the effectiveness of each component in the MHA-PINN framework, ablation experiments were conducted. Three main methods were employed: Fully Connected Network (CN), Multi-Head Attention Network (MHAN), and Physical Information Neural Network (conventional PINN). CN is a base model derived from MHA-PINN by removing the multi-head attention mechanism and physical information constraints. MHAN and conventional PINN represent models obtained by removing the physical information constraint layer and multi-head attention layer from MHA-PINN, respectively. The hyperparameter determination methods for the three models are similar to those for MHA-PINN. The ablation experiment prediction results for CDPTT staining performance are shown in Table 4.
[0119] Table 4
[0120]
[0121] Comparative results show that combining multi-head attention mechanisms and constraint layers can improve the prediction R for all four outputs. 2 These findings bring varying degrees of improvement in values while reducing the root mean square error (RMSE). These results validate the effectiveness of the multi-head attention layer and the physical information layer.
[0122] (7) Online prediction applications;
[0123] In actual production, the dyeing process variables (temperature, dye concentration, liquor ratio, and dyeing time) are collected in real time from sensors. After normalization and feature selection, they are concatenated with the deep features saved in step (4) and input into the trained decoder. This allows for the real-time output of the predicted dyeing performance indicators (red dyeing rate, red K / S value, blue dyeing rate, and blue K / S value) for the current batch. The prediction results can be displayed in real time on the monitoring interface, allowing engineers to adjust process parameters and achieve intelligent control of the dyeing process.
[0124] To further demonstrate the effectiveness of MHA-PINN, an adaptive analysis under extreme conditions was conducted:
[0125] The difference from this invention lies in that the test data includes extreme staining conditions (e.g., temperature > 120°C or pH < 4 or > 5). Since the experimental data did not include such extreme samples, the model did not encounter this type of data during training. Test results show that the prediction accuracy of MHA-PINN is reduced (R0). 2 (Decrease of approximately 10%), but still outperforms purely data-driven ANN models (R 2 (A decrease of approximately 20%). This is thanks to the constraints of the physical loss function, which allows the model to maintain a certain degree of physical consistency even in sparse data regions. Future developments could further extend the model's adaptability to extreme conditions by introducing transfer learning or active learning.
[0126] Applications in other fiber dyeing systems:
[0127] The method of this invention was applied to the disperse dyeing process of conventional polyester fibers (PET). Data was collected from a Datacolor 850 colorimeter, including variables such as temperature, time, dye concentration, liquor ratio, and pH. The outputs were the dye uptake rate and K / S value. Data augmentation, feature selection, model construction, and training were performed following the same steps as for cationic dyeable poly(propylene terephthalate) (CDPTT) fibers. The results showed that MHA-PINN could also achieve better prediction results than traditional neural networks, verifying the versatility of the method of this invention.
[0128] The effects of different hyperparameter settings:
[0129] To examine the weights of physical constraint loss Impact on model performance. Based on the example above where w2=0.001, the following will be implemented: The values were set to 0, 0.0001, 0.001, 0.01, 0.1, and 1 respectively, and the changes in the RMSE of the test set were observed. The results show that... When RMSE is minimized; If the value is too small, the physical constraints are insufficient; if it is too large, it dominates the loss function, leading to a decrease in data fitting ability. Therefore, it is recommended to... The range of values is The optimal value was determined through cross-validation.
Claims
1. A method for predicting fiber dyeing properties based on the MHA-PINN model, characterized in that: The collected raw fiber staining dataset is preprocessed and then input into the trained MHA-PINN model to output the predicted fiber staining performance index. The MHA-PINN model includes a connected multi-head attention module and a physical information neural network module. The loss function of the physical information neural network module is embedded in the quasi-second-order coloring dynamics equation in the form of residuals. The pseudo-second-order staining kinetic equation is: ; In the formula, The rate constant is a second-order kinetic reaction. Let t be the fiber dye uptake rate. To balance the staining rate, t is the staining time.
2. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 1, characterized in that, The original fiber dyeing dataset was constructed from historical data of dyeing process variables and fiber dyeing performance indicators collected from sensors during the fiber dyeing process. The variables in the dyeing process include dyeing temperature, dyeing time, dye concentration, liquor ratio, and pH value. The fiber dyeing performance indicators include dye uptake and K / S value.
3. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 2, characterized in that, Preprocessing includes Min-Max normalization, data augmentation, and ensemble feature selection; Data augmentation is performed using a variational autoencoder.
4. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 3, characterized in that, The specific process of integrated feature selection is as follows: three embedded feature selection algorithms, Lasso, Random Forest and XGBoost, are used to calculate feature importance in parallel, and the final feature importance ranking is obtained by fusion using the averaging method. The top three variables are selected as key input variables; the top three variables are staining temperature, dye concentration and bath ratio.
5. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 4, characterized in that, The formula for calculating the multi-head attention module is: ; ; ; in, For the input feature matrix, , and For the first The trainable parameter matrix of each attention head, , and Let X be the query matrix, key matrix, and value matrix obtained through a linear mapping, respectively. Scaling factor The first attention head and the second attention head are respectively. The output of the h-th attention head The result is the linear transformation of the concatenated outputs of all attention heads. To output the parameter matrix of the linear transformation, For the number of attention heads.
6. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 5, characterized in that, The physical information neural network module includes an input layer, several hidden layers, and an output layer. The hidden layers use the ReLU activation function.
7. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 6, characterized in that, The total loss function of the physical information neural network module is a weighted sum of data loss and physical constraint loss, as shown in the formula: ; in, and These are the weights for data loss and physical constraint loss, respectively. For the sample size, These are the model's predicted values. For the true value, This is the model's predicted value for the dyeing rate.
8. The fiber dyeing performance prediction method based on the MHA-PINN model according to claim 7, characterized in that, The Adam optimizer was used to train the MHA-PINN model, and the hyperparameter values of the MHA-PINN model were set using an empirical hyperparameter tuning method.