1 Introduction

Recently, fashion and apparel trends have been dominated by faded and torn looks, resulting in garment manufacturers fading and tearing textile products. Faded garment, e.g. blue jean, can be sold at a higher price than non-faded one. The lure of higher profits is leading fabric manufacturers to develop new techniques to improve the visual aspect of fabrics, especially the faded and torn looks [14]. Conventional technologies involve creating designs by fading the color in certain areas of fabric, e.g., in denim fabric, using processes such as sanding, sand blasting, brushing, pre-washing, rinsing, stone washing, sand washing, snow washing, stone washing with enzymes, bleaching, dyeing, printing and finishing. Although the desired faded and torn effects can be achieved by such methods, the following problems are encountered [4, 5]:

  1. (i)

    difficulty in application and time consuming due to problems in work flow;

  2. (ii)

    decrease in wear resistance of the product;

  3. (iii)

    inability to create standard and reproducible designs;

  4. (iv)

    successful application of designs is not possible on all textile surfaces;

  5. (v)

    inability to create required nuances in shading;

  6. (vi)

    inability to produce identical designs on both sides of the products;

  7. (vii)

    insufficient visual effects;

  8. (viii)

    loss of quality; and

  9. (ix)

    inability to apply the original writings and designs onto the product.

In addition, production of faded and torn looks in fabric using conventional technologies, such as enzyme washing and stone washing, involve consumption of large quantities of water and the effluents would be highly contaminated by chemical products used in the process. Also the time-consuming and old-fashioned conventional processes are not suitable to just-in-time and mass-customised production and, therefore, are not cost effective. In order to deal with these problems, laser treatment, being a dry treatment, has recently the potential to be an alternative to conventional technologies [69]. Although laser technology has been used in textile and apparel sector for many years, it is limited for marking textile surfaces and cutting. However, with further technological developments, the laser technology can now be used to transfer graphics of desired variety, size and intensity on all kinds of textile surfaces with precision and without damaging the texture of the materials [10, 11]. Literature has discussed application of laser engraving on textile materials but it has been mainly focused on effect on color properties of denim fabric [10, 11]; little or no exploration of 100 % cotton knitted fabric has been reported. On the other hand, when literature review shows that artificial neural network (ANN) has been used in many engineering fields [12, 13]. In applications in the textile industry, ANN is mainly used in yarn and fabric technologies [1418]; no comprehensive model seems to have been proposed for predicting color properties of textile materials dyed after laser treatment. Due to this reason, we explored the possibility of using ANN model on predicting the colour properties of different textile materials of different properties and nature such as (i) knitted fabrics with mixed fiber composition [6], (ii) 100 % cotton woven fabrics [7], (iii) cotton-spandex fabrics [8], and (iv) denim fabric [9] under the effect of laser engraving process. Thus, in this paper, we propose an artificial neural network (ANN) model for prediction of color properties, including color yield (in terms of K/S value) and CIE L, and a and b values of 100 % cotton knitted fabrics under the effect of laser engraving with consideration of factors such as fiber composition, fabric density, mass of fabric, fabric thickness, linear density of yarn, yarn twist, direction of yarn twist and crimp.

2 Experimental Methods and Hypothesis

2.1 Material

Four different colored knitted fabric materials were used with specifications as shown in Table 1.

Table 1 Fabric specifications

2.2 Laser Engraving Process

Knitted fabric samples were laser engraved with a \(\hbox {CO}_{2}\) source laser engraving machine (GFK, Spain), having specifications as shown in Table 2. Resolution of the laser beam was set to 28, 32, 36, 40, 44, 48, 52, 56, 60, 64, 68 and 72 dot per inch (DPI) with pixel time of 100, 110, 120, 130, 140, 150, 160 and 170 \(\upmu \)s. Resolution is defined as a parameter to control the intensity of laser spots in a particular area, expressed in terms of DPI. Higher DPI means higher resolution. Meanwhile, pixel time is defined as a parameter in computer graphical file types to control the duration of time for which the laser head attacks the fabric, in \(\upmu \)s. Longer pixel time means more energy will be focused on the fabric, causing a higher degree of engraving effect. Different knitted fabric samples (20 cm \(\times \) 20 cm) were engraved in accordance with various combinations of resolution and pixel time.

Table 2 Specifications of laser engraving machine

2.3 Colour Measurement

Colour measurement was performed by using a spectrophotometer of GretagMacbeth Color-Eye7000A. Parameters of D65 Daylight with a \(10^{\circ }\) standard observer were used during color measurement. Totally, four measurements were taken for each sample. The samples were conditioned at \(20\, \pm 2\,^{\circ }\)C and relative humidity of 65 ± 2 % before taking the measurements. K/S (in terms of summation of individual K/S values over the wavelength from 400 to 700 nm) and CIE L, a and b values were obtained.

2.4 Artificial Neural Network Model

Laser treated knitted fabrics were tested. Two parameters, DPI and pixel time, were found to be closely related to effects of coloring. After laser treatment, four colour-related data, i.e. K/S (color-ks), CIE L value (color-l), CIE a value (color-a) and CIE b value (color-b) were obtained. In order to find the optimal neural network, ANN models having different topologies were formulated. The basic topology of the network is shown in Fig. 1. In the ANN model, fabric specifications, including composition, density, mass, thickness, linear density, yarn twist and crimp were put in the input layer. Besides, DPI and pixel time were also two important input nodes in case of laser treated samples. For the output layer, the four nodes were corresponding to color-ks, color-l, color-a and color-b.

In this study, according to Fig. 1, the basic ANN model is same. The only difference is the structure (number of hidden layers and nodes) for the ANN. Each colour property was evaluated separately because the colour properties varies a lot as shown in the experimental data and they cannot be adapted to the same ANN. The Levenberg-Marquardt method and the Matlab Neural Network Toolbox were used for the ANN analysis. We did the experiments for several times and each with different random initial values.

Fig. 1
figure 1

Basic structure of ANN [7]

For training the ANN model, a typical three-layer network with Bayesian regulation backpropagation was used. It is considered as the most popular learning algorithm for learning of a multi-layered feed forward neural network [19]. For activation function, the sigmoid function is typically used [20], and in this case, was given by

$$\begin{aligned} sigmoid(a)=\frac{1}{1+e^{-a}} \end{aligned}$$

This function can range between 0 and 1, and is differentiable. Other parameters of the network were set as shown in Table 3.

Table 3 Artificial neural network parameters

In addition, determining the number of hidden layers and the number of nodes in each layer is not straightforward; this has still not been solved perfectly. There are a number of theoretical results concerning the number of hidden layers in a network. Specifically, Hetcht-Nielsen [21] has shown that a network with two hidden layers can approximate any arbitrary nonlinear function and generate any complex decision region for classification problems [21]. Later it was shown by Cybenko [20] that a single layer is enough to form an arbitrarily close approximation to any nonlinear decision boundary [20]. Hornik and Stinchombe [19] have come up with a more general theoretical result. They have shown that a single hidden layer feed forward network with arbitrary sigmoid hidden layer activation functions can well approximate an arbitrary mapping from one finite dimensional space to another [19].

Generally speaking, with more nodes in hidden layer, the network’s ability of approximation is increased while the generalization ability is decreased. Therefore, the structure of the ANN is usually decided by experience together with trials [22]. On top of that, the size of the training set and the number of input/output nodes also affect the topology of the optimal neural network [23].

In this survey, nine different topologies of the neural network were constructed and tested. According to experience and practice, considering the fact that the data size (totally 327 terms) and the number of input/output nodes are small, an ANN with more than 30 nodes in the hidden layer is not necessary in this case. This is because more nodes cannot get better performance and considerable training time is required to be spent, which may be computationally expensive. Smaller networks require less memory to store the connection weights and can be implemented in hardware more easily and more economically. Training a smaller network usually requires less computation because each iteration is computationally less expensive. Also, smaller networks have very short propagation delays from inputs to outputs. This is very important in the testing phase of the network, where fast responses are usually required. Details of the ANN topology are shown in Table 4.

Table 4 Artificial neural network topology

In the experiment, there are 327 vectors for each group. These data were randomly divided into three sets: training (60 %), cross validation (20 %) and test (20 %) in order to meet the requirements of both accuracy and generalization.

3 Results and Discussion

3.1 ANN Model

In order to evaluate the effect of ANN model, the MAE (mean absolute error), MSE (mean square error) and RMSE (rooted mean square error) are calculated. These three functions are widely used in evaluation of the effect of fitting. In this study, MSE is the mainly used evaluation function and played the most important role in deciding the quality of different ANN models. MAE and RMSE are calculated for reference purpose. The definitions are as follows:

$$\begin{aligned} {\textit{MAE}}= & {} \frac{1}{n}\sum _{i=1}^n {(abs(t_i -o_i ))}\\ {\textit{MSE}}= & {} \frac{1}{n}\sum _{i=1}^n {(t_i -o_i )^{2}}\\ {\textit{RMSE}}= & {} \sqrt{{\textit{MSE}}} \end{aligned}$$

In the function, \(\hbox {t}_{\mathrm{i}}\) and \(\hbox {o}_{\mathrm{i}}\) are target output and ANN predicted output, respectively.

As mentioned before, the whole dataset was divided into training, validation and test sets. After training the networks, the models are expected to be used in large scale prediction works. So, they were validated by an unseen testing data set to predict color values. Therefore, besides MAE and MSE, test error, which is usually indicative of robustness and generalization of the model, is also an important factor in judging the quality of the neural network.

Besides, some other statistical information was also collected. Detailed results for color properties, K/S value, CIE L, CIE a and CIE b values are shown Tables 5, 6, 7, and 8, respectively. Here, for simplicity, only the network with the smallest MSE for validation set is highlighted as the best network model.

Table 5 ANN statistical data for color-ks prediction
Table 6 ANN statistical data for color-l prediction
Table 7 ANN statistical data for color-a prediction
Table 8 ANN statistical data for color-b prediction

It can be seen from the above tables that for two hidden layer neural networks, training errors are normally smaller than the single hidden layer network. But it does not matter for the test error. On the other hand, the one layer network can also perform well in test error, which means it is more robust in most cases.

From Tables 5, 6, 7, and 8 above, it can also be seen that in ANN model, the relative error distributes mostly in the range of 0–5 %, which is an acceptable range. The only exception is in Table 7, which predicts Color-a values. However, considering the fact that values for Color-a are mostly very small, it is unavoidable that the relative errors become bigger. The maximum error for Color-a is below 1, which proves that the prediction result is acceptable.

3.2 Linear Regression Model

In this study, a traditional linear regression model was also established for the sake of comparison. In general, response variable y may be related to k regression variables. The function is as in the following:

$$\begin{aligned} y=\beta _0 +\beta _1 x_1 +\beta _2 x_2 +...+\beta _k x_k +\varepsilon \end{aligned}$$

Parameters \({\upbeta }_{\mathrm{i}}\) are called regression coefficients. This model describes a hyperplane in k-dimensional space of regression variables. The method of least squares is typically used to estimate regression coefficients in a multiple linear regression model. Here, the linear regression model is applied in the above experiment data. The results are shown in Table 9.

Table 9 LR model statistical data

3.3 Comparison Between ANN and LR

It is evident from the tables that the predictive power of the ANN model is the best. From Table 9, all evaluation numbers are obviously much greater than those of Tables 5, 6, 7, and 8, which mean applying LR model for prediction in this case is worse than the ANN model. Figs. 2, 3, 4, and 5 below depict the comparison graphically.

Fig. 2
figure 2

a ANN model fitting for Color-ks. b LR model fitting for Color-ks

3.4 The Relative Importance of Input Variables

In order to find out the relative importance of various input variables, an additional experiment was performed. In this experiment, all input variables except one designated variable were retained. Then MAE, MSE and other statistical information of the new ANN model were calculated and further compared with the optimized one. Here, for simplicity, the increase in MSE value was treated as the indicator of importance of the excluded input. The results are shown in Table 10.

Fig. 3
figure 3

a ANN model fitting for Color-l. b LR model fitting for Color-l

Fig. 4
figure 4

a ANN model fitting for Color-a. b LR model fitting for Color-a

Fig. 5
figure 5

a ANN model fitting for Color-b. b ANN model fitting for Color-b

Table 10 Relative importance of the input variables

It can be seen that DPI and pixel time are the two dominant variables, as expected. Among these two variables, DPI is significantly more important than pixel time. The remaining variables are far less dominant. Eliminating one of them usually causes increase of MSE to about 10–30 %.

4 Conclusions

In the experiment, we predicted color values for four fabric materials after some laser treatment using both ANN established by different topologies and LR models. Several statistical tests were conducted to examine the performance of these experiments. Experimental results suggest that changes in number of nodes of the neural network model affect the performance of the model.

Results reflect that color values accurately with the help of the ANN model. These prediction results demonstrate the usefulness of laser treatment before coloring and may find good applications for future use by the textile industry. Compared with the ANN, the LR model did not perform well in the experiment due to limitations of the model itself.