Development of Prediction System for Shade Change Variations in Dyed Cotton Fabric After Application of Water Repellent Finishes

ABSTRACT Textile finishing is the last stage to improve fabric aesthetic characteristic and impart functional properties, but at the same time it can produce some undesirable effects like shade change and variation in mechanical properties of fabric. These shade variations are undesirable and create major losses for the textile industry. These losses are related to rework and reprocessing of dyed fabric after finishing. To cope this issue, dyers are making decision on trial and error bases, therefore, this work has been conducted to quantify the shade change value. In this research work, an artificial intelligence-based system is developed to foresee the behavior of color before finishing. Color, shade percentage, finish type, finish concentration, and 31 reflectance values in the visible range 400–700 nm were selected as input for the training of artificial neural networks. The five networks were trained individually for the Δ color coordinates (△L, △a, △b, △C and △h). The networks were tested and cross-validated with 85% accuracy. The developed models were executed for the predictions of △L, △a, △b, △C, and △h with mean absolute errors 0.0765, 0.0869, 0.1528, 0.0829 and 0.1626, respectively. Mean absolute error values are showing a close correlation between actual and predicted values.


Introduction
The idea of artificial intelligence (AI) was introduced in the world almost four to five decades ago. The use of artificial intelligence in the textile industry started a decade ago when researchers thought about the use of artificial intelligence in the different manufacturing processes of the textile industry. When artificial intelligence was in the beginning stage to be used in the textile sector, at that point textile finishing and coloration was the first sector of the textile industry in which it was used. Nowadays the Artificial Neural Network (ANN) attracted the manufacturer in the prediction of color measurement of the fabrics after application of different chemicals (Balcı and Oğulata 2009;Jawahar, Narasimhan Kannan, and Kondamudi Manobhai 2015;Jayalakshmi and Santhakumaran 2011).
Artificial intelligence is efficiently used in different sectors of the textile industry. In spinning, AI is used to predict the yarn properties based on the raw material used for the yarn manufacturing process (Mozafary Shamsi 2021). It also has a great potential to predict the yarn faults in the yarn manufacturing process concerning the raw material and yarn count (Abdel-Hamied, ElKateb, and El-Geiheini 2021). The prediction of the auto-leveling action point in the draw frame section of the spinning division is also a big achievement (Majumdar, Majumdar, and Sarkar 2004). The spinning of filament yarn is different as compared to the natural fiber spinning due to the different nature of the materials but AI is used significantly in predicting the filament yarn faults (Abdel-Hamied, ElKateb, and El-Geiheini 2021;Zhu and Ethridge 1996). Not only in yarn manufacturing, but also in the textile dyeing process, AI has great potential to help the industrialists as it can be used to predict colorfastness properties and dye concentration (Eyupoglu, Eyupoglu, and Merdan 2022;Vadood and Haji 2022). The AI can be used to predict the fabric properties based on yarn parameters and fiber parameters. Color representation in a proper color space is quite important as it can create the difference between color values and might be possible for AI to remove that fault and predict shade change variation (Beltran, Wang, and Wang 2004;Bhattacharjee and Kothari 2007;Cheng and Adams 1995).
Color measurement methods are also very important in the variation. Color is normally described in three attributes which are L, a, and b. The human eye is the best manual judgment tool when it comes to assessing the shade variation but when a person sees a color, that person can't describe the color in such form the way modern-day tool describes it (Balcı and Oğulata 2009;Ke, Yu, and Xu 2006). The relationship between dyeing parameters and color co-ordinates is very different for the dyers and this creates the space for Artificial Intelligence to come and play its role in the textile processing industry (Vadood and Haji 2022). Artificial neural network modeling could be used to predict the dye exhaustion behavior under different process parameters (Lim et al. 2022). The age factor of the human classer is also considered very important for the color assessment. In the large industries, shade change may cause the cancellation of huge orders, so they keep an acute eye on these problems and their solution. Shade change in the dyeing factory may come from batch to batch, meter to meter, end to end, center to end, so in other words it is unpredictable (Da Silva et al. 2017;Daneshvar, Khataee, and Djafarzadeh 2006). The quality of the final product is a prime focus for both the manufacturer and the buyer. The visual sensation is a very important factor to decide the quality of the finished product as it comes first than the feel and wears experience (Balcı and Oğulata 2009;Chakraborty, Kaur, and Chakraborty 2019;Değirmenci and Topalbekiroğlu 2010).
There are many measures which can be adopted to overcome these problems, like an adaption of the right instruments to measure color but artificial neural network also has the capability to predict the shade variation after finish application on the fabric. Multi-Layer Perceptron (MLP) is a type of artificial neural network that can be used to predict the shade change on supervised data (Haugeland 1989;Kahani et al. 2018;Mitchell, Michalski, and Carbonell 2013). It is also necessary to understand that the color change can be a huge problem and thus leads to huge loss of dyed raw material. Every kind of chemical treatment on the fabric whether it is dyeing and finishing, or application of the softener may cause variation in the shade change. There are multiple reasons which are involved in the shade variation. Fabric inspection should be done properly for each roll present. The inspected rolls of fabrics should be categorized according to the shade band. At the end of the production line, the fabric should be inspected properly and if variation in the shade is observed then it should be removed. One thing that should always be taken into consideration that there are a number of factors which can cause shade variation. These factors can be the application of the finishing or measurement of the color, but both have a strong influence in the shade rejection or acceptance (Tsoutseos, Nobbs, and Boussias 1999;Van Nguyen et al. 2018).
In the finishing process which is the core theme of this research, the color matching phenomenon is most important. The industry has a problem with color matching regarding the finishing process. In the industry, the color tolerance is a limit to which the manufacturer and the buyers become agree to pass or fail the sample. This color tolerance limit is set between the sample and the final product. When the final product becomes ready to deliver, color tolerance limits are checked at which both parties are agreed, and the term "pass" or "fail" is assigned to the garment/fabric Parvinzadeh and Najafi 2008;Tomasino 1992).
Shade variations are the major contributors to the dyeing losses in terms of rework and reprocessing. Studies have shown that the chemical reactions between the dye and finish molecules, high temperature drying and curing of finished fabric, covering of translucent finish molecule are the main players that alter the refractive index of the fabric. Results from earlier studies demonstrates the influence of finish on Δ color coordinates of dyed and finished fabric . In the textile industry, trial and error base approach is used to make decisions regarding shade change. However, decision on trial and bases is always uncertain, therefore, there is a need to devise a proper system for quantification of shade change. So, this prediction system has been developed to foresee the behavior of shade after finishing.
This research work presents ANN-based prediction system for water repellent finishes. The ANNs are very specific to work and they need relevant data (specific chemicals and materials) for training. So, in this research work the general prediction system for most commonly used water repellent finishes is developed.

Artificial neural networks
The development of an artificial intelligence-based prediction system was divided into two phases. The first phase involved the development of a prediction model and in the other phase, a number of experiments were conducted to provide data and enough knowledge to the developed prediction system to make intelligent predictions.
In this context, the research work was conducted as following Phase I-Development of artificial neural network interface Phase II -Development of the database by performing dyeing and finishing experiments

Phase I-development of artificial neural network software
Artificial neural networks-based interfaces were developed to interact the software with the user for the training of networks on real-world experimental data, validation of the results by comparing the training and testing performance of the neural networks, additively, allowing to give predictions on the unseen data.

Training interface
Matlab neural networks toolbox has different training algorithms that could be used to train the neural networks. For this reason, the neural networks training interface is created in the Matlab environment. The training interface required the number of inputs, outputs, and hidden neuron layers. In addition, the trained networks' biases weights and architectures are easily attained from Matlab that are further utilized in the prediction phase. The accurate prediction is achieved by adjusting the network architecture, training algorithms, learning rate and momentum. There are number of algorithms present to train the neural networks, however, feedforward backpropagation technique is implied to develop these networks. The backpropagation is learning algorithm that can modify the weights of the networks. There are various types of algorithms available but backpropagation is best algorithm for supervised multilayer feed-forward networks. Here, sigmoid function is best suitable function for backpropagation.
Training of neural networks is an iterative process. In the beginning, weight selection is done randomly and the input vectors are fed to the first hidden layer. Next output signal values are determined for each neuron in the first hidden layer. Sequentially, the output of the first layer is presented as input to the next layer. The repetitions are done until output signals for output layers are determined as neural networks contain several hidden layers depending upon the complexity of the problem.
The weights updation in backpropagation is done by using the below terms Where △w= Weight Change α= Learning Rate @= Error Gradient xi t ð Þ= Inputs propagation back at time step t. However, for determination of direction and size of data individual Δ △ ij are calculated

Prediction & testing interface
The prediction system was developed which was capable of prognosticating the shade change after finish application as presented in Figure 1.

Phase II-development of the database by performing dyeing and finishing experiments
100% cotton single jersey knitted fabric with GSM 133 g/m 2 with course per inch and wales per inch 38 & 36 respectively was taken to conduct this research work. Three reactive dyes (Synazol, KISCO) were used for dyeing of fabrics. The structure of dyes is presented in Figure 2. Auxiliary chemicals were obtained from Sigma Aldrich and used without further purifications.
The samples were dyed with reactive dyes in three primary colors SynazoL Red K3BS (C.I. Reactive Red 195), Synazol Blue KBR (C.I. Reactive Blue 221) and Synazol Yellow KHL (C.I. Reactive yellow 145) in different concentrations (1%, 3%, and 5%) by following the recipe given in Table 1 and the dyeing procedure presented in Figure 3.
After completing the dyeing of the samples, the thirty-one (31) reflectance values of the samples were measured using Data color 850 spectrophotometer under D65 10 Deg illuminant. Later, the samples were padded with four water repellent finishes in three different concentrations of each finish as given in Table 2. After completing the finishing process, CIE Lab and CMC values were noted using Data color spectrophotometer 850.

CMC
Based on LCh color model, the Color Measurement Committee has defined a color difference measure named as CMC. It is an efficient way to maintain color accuracy and consistency to meet standards objectively in the color tolerance limit. The tolerance limit is the quantification of the color difference between a standard sample and batch sample to be considered as acceptable. For instance, if the color of the standard and batch sample does not match, the amount of rework and reprocessing increases leading to the high usage of valuable resources (chemicals, auxiliaries, energy, and time). That is why early identification of the color difference between the samples during production is important.

Acceptable range for CMC
For comparison of samples, the color difference in any direction is equally important. Thus, CIE color difference (Δ E) is the equally weighted combination of the CIE Lab color coordinates differences (Δ a, Δ b, Δ C, Δ h). The CMC color equation works on the ratio between lightness and Chroma to gain better acceptability in color matching. The repeatability of measurements is critical as it is directly affecting the pass/fail program of the computer, which is used for lot matching, final inspection of the products, quality control, and quality assurance. For instance, a standard sample is compared with a batch sample and the DE (CMC) value is calculated as 0.9, then the true reading may range from 0.5 to 1.0. This shows the difference between pass/fail if the pass tolerance limit is less than 1 (Liang 1996).

CMC for finishes
The CMC value is the accepted tolerance limit for shade variations. It marks the batch samples with reference to standard samples in three dead-set categories that are pass, warn, and fail. The values up to unit 1 are considered as an acceptable shade variation limit and over its samples are considered as fail. Thus, dyers do the rework and reprocessing to match the required shade (Tsoutseos, Nobbs, and Boussias 1999). There could be many reasons for shade change that are given as under (1) High-temperature drying and curing of finished fabric may damage the chromophore of the dye molecule which can cause shade variations and dye bleeding in subsequent washing processes. Besides chromophore group, the high-temperature drying also may damage electron donor or receptor groups in the dyestuff molecule. Furthermore, there is no specific trend found in the CMC value variations for different finishes. Each color and its concentrations behave differently under applied finish concentrations and process conditions. Generally, an increase in finish concentration increases the color difference (CMC) between the samples. Collectively, blue color exhibited the highest shade variations after finishing. This can be due to the closeness of the blue reflectance range to the ultraviolet region of the light and variation of the refractive index of dyed fabric after finish application.

Analysis using artificial neural networks
The analysis of Δ color coordinates using artificial neural networks are presented as under:

Training performance of NN_∆L
In the CIE Lab color coordinates systems (Lab and LCh), "L" represents the lightness of the color. ∆L is a change in lightness that occurs after certain treatments on fabric. The sample can become lighter or darker after these treatments wherein +∆L shows that samples become lighter while -∆L is an indication of sample darkness. The collected data were normalized between 0 and 1 in the phase II of the study. The normalized data were subjected to ANN training. According to conventional training and testing technique (hold out method), the data set was divided into two subsets i.e. training data and testing data, in both sets the samples were selected randomly (Ulug 1995a. Several training parameters and algorithms were employed to get suitable predictions and finally trained using training parameters presented in Table 3 and algorithms "trainlm." The training performance of trained networks is shown in Figure 4. It represents the correlation between actual and predicted values; a minuscule difference in values confirms that the developed model is giving accurate prediction on unseen data. The mean absolute error is 0.0765 which shows the satisfactory training of ANN and their well-fitting for the data. The predicted values are not based on the actual readings but they are based on the multiple trainings of neurals and their predictions on huge amount of data. However, the repeated training of neural networks sometimes can over-fits the testing data set. Then these types of networks perform well for the given data set but do not give accurate predictions on the unseen data (Rahwan and Simari 2009;Smits et al. 1994;Sola and Sevilla 1997). Consequently, the holdout method becomes unreliable. So, the 10% crossvalidation technique was adopted for testing the developed neural networks. The MEA is 0.0810 for NN_∆L cross-validation which shows that the developed model can maintain a close relationship between the variables and can give predictions on unseen data.

Training performance of NN_∆a
In CIE Lab color coordinate system, "a" represents the redness or greenness of the color while ∆a shows the color difference between the standard and batch sample. Herein +∆a points that color become redder, whereas -∆a indicates that color shifted toward greener tone after application of finish. The ANN was trained for ∆a using different training algorithms and varying training parameters. Preeminent results were achieved through the training parameters depicted in Table 4 and "trainrp" algorithm. To train and test the data using the hold-out method, the data was divided into two sets i.e. training data set and testing data in both samples were selected randomly. Training performance of the selected data set on trained neurons is presented in Figure 5. A close correlation can be seen in the actual and predicted values. The MEA is 0.0869 which is under the tolerance limit and showing the well-fitting of trained networks to make predictions for ∆a. Later, to avoid overfitting of data, 10% cross-validation technique was adopted for the testing ANN. The MEA is 0.0815 for cross-validation  of trained NN_∆a which exhibits the developed network efficiency to give accurate predictions. This co-relations indicates that the neural network is trained enough to predict the changes prior to applying the finishing in its values can be considered appropriate for the industrial sector to avoid huge damage of raw material due to shade change.

Training performance of NN_∆b
In color space model, "b" defines the yellower or bluer direction of the color. ∆b indicates the color changes occur in the standard sample. It can be either positive or negative whereas positive reveals an increase in yellowness while negative value exhibits blueness of the samples after treatment. The data containing thirty-five inputs and one output (∆b) were trained using the network parameter presented in Table 5. Training and testing of data were carried out using the hold-out technique. Furthermore, different ANN algorithms were employed to get the best performance from training data. Ultimately, networks were trained using algorithm "trainrp." The training performance of neural networks is exhibited in Figure 6. MEA (mean absolute error) in the predicted data is 0.1528 and this value is under the error tolerance limit (0 to 1). The MEA indicates that networks are trained well and felicitous to make predictions. Later, samples were cross-validated using the 10% cross-validation technique. The MEA is 0.1575 of cross-validation of trained NN_∆b which indicates that networks can give predictions on unseen data effectively.

Training performance of NN_∆C
Color can be represented using different numeric expressions. Two assessment tools are normally employed to make color difference assessments between the standard and batch sample. These assessment tools are named as CIE Lab (Lab) and CIE LCh. "C" represents the Chroma which is associated with brightness or dullness of color. The application of finish on dyed fabric not only affects La b values but also C h attributes of the color. The change in "C" is denoted by ∆C wherein +∆C shows the increase in brightness of the color whilst -∆C is an indication of the color dulness after treatment. To predict the ∆C for the finished fabric neural networks were trained in the Matlab environment using Matlab algorithm "trainrp." Different neural architects were tried to achieve the best training results whereby the decisive results achieved through neural networks architecture presented in Table 6. The training efficiency of developed neural networks against testing data is presented in Figure 7. The trained networks give prediction with 0.0829 MAE value which is verification of well-fitting of the neural networks and accurate prediction. Furthermore, the developed neural networks were validated using the 10% cross-validation technique. The MEA is 0.0913 of crossvalidation of trained NN_∆C which inferred that neural networks are effective tools for the prediction of shade change.

Training performance of NN_∆h
In CIE LCh color coordinate system, "h" indicates the hue of color. ∆h is a change in the tone of color, or it can be defined as absolute color change. It can be either positive or negative after the application of finish indicating the tone shifting of color. The normalized data containing thirty-five inputs and one output was subjected for training after subdividing into training and testing data selected on a random basis. Different neural architects and parameters were practiced to get accurate predictions. Ultimately, the network was trained through the parameters given in Table 7. The testing performance of trained networks is represented in Figure 8. The mean absolute error is 0.1626 which is an acceptable tolerance limit (0 to 1). The MEA shows the well-fitting of training networks and their capability to give predictions on unseen data. After training, networks were subjected to a 10% crossvalidation technique. The MEA is 0.1530 of cross-validation of trained NN_∆h which indicates that the developed network can predict the shade change accurately.

Conclusion
The application of water repellent finishes on the surface of dyed fabric produces shade changes. These shade changes are quantified in terms of Δ color coordinates of the fabric. Artificial neural network models were developed for the prediction of shade change and developed models are successfully solving the major problem of the dyeing industry. The developed models were executed for the predictions of △L, △a, △b, △c, and △h with mean absolute errors 0.0765, 0.0869, 0.1528, 0.0829 & 0.1626, respectively. The MAE values of the developed models are under the tolerance limit which is 0 to 1 for color predictions so it is confirmed that developed models are giving accurate predictions on the unseen data and can be employed to predict shade changes of the dyed fabric before finishing. The developed system will be a helping hand for dyers to adjust their recipes before dyeing and finishing which can ultimately reduce the industrial losses.

Highlights
• Artificial neural network models were developed for the prediction of shade change and developed models are successfully solving the major problem of the dyeing industry. • The developed system will be a helping hand for dyers to adjust their recipes before dyeing and finishing which can ultimately reduce the industrial losses. • The MAE values of the developed models are under the tolerance limit which is 0 to 1 for color predictions.

Disclosure statement
No potential conflict of interest was reported by the author(s).