# A Machine Vision-Based Algorithm for Color Classification of Recycled Wool Fabrics
## 3 Results  
The PNN was tested against a new set of 200 fabrics numbered from \(n_{1}\) to \(n_{200}\). The input values were derived from acquired and processed images. The ANN was then simulated and the results were assessed.  
The predicted value had to be compared against the real value \(R\) (decided by the pool of pickers) in order to assess the reliability of the prediction. An optimal classification system should be able to reliably detect the correct class once a given fabric is given. However, the variability of the possible fabrics conferred to a textile company, especially recycled items, is extremely high. Consequently, an error in classification should be tolerated. Such an error should take into account that an error in classification between two \"adjacent\" classes is tolerable since the error increases as far as the classification classes drift apart. In fact, after a fabric is classified in a given class, it is mixed together other fabrics of the same class. Thus, if there is a misclassification with \"similar\" colors, the impact of the misclassification is limited. Conversely, if the misclassification is relevant (e.g., a fabric is classified in class 20 instead of class 24), conferring it to the wrong class may lead to unsatisfactory results.  
To this aim, the comparison between the color of the conferred fabric and the color belonging to the catalog may be evaluated by defining a coefficient \(\eta\), called the \"likelihood classification index,\" which is given by:  
\[\eta=\left|\frac{\text{max}(q_{k})}{\left(\left|R-P_{\text{max}(q_{k})}\right| +1\right)}\right|+\left|\frac{\text{max}_{-1}(q_{k})}{\left(\left|R-P_{\text{ max}-1(q_{k})}\right|+1\right)}\right| \tag{4}\]  
The closer the \(\eta\) value is to 1, the greater is the reliability of the prediction for a given fabric. In the case where the PNN classifies the fabric in a class far from the target class, the \(\eta\) value rapidly tends to zero.  
To provide an example of obtained results, five out the 200 results for the newly tested fabrics are listed together with the prediction error in Table 2. In order to present the results as accurately as possible, the first two classes (\(P_{\text{max}(q_{k})}\) and \(P_{\text{max}-1(q_{k})}\)) are listed together with their percentage values (\(\text{max}[q_{k}]\) and \(\text{max}_{-1}[q_{k}]\)). In the same table, both the best (fabric id. \(\mathbf{n_{1}}\)) and worst (fabric id. \(\mathbf{n_{143}}\)) obtained values for the entire set are listed together with three other randomly selected results. For fabric \(\mathbf{n_{1}}\), the likelihood of the classification is close to 100% since the classifier detected the correct class according to the pickers and with a high \(\text{max}\)\((q_{k})\) value. Moreover, the second class estimated by the PNN was close to the correct one. For fabric \(\mathbf{n_{143}}\), the PNN placed the fabric in the wrong class with a low confidence in the first instance and placed the same fabric in the correct class with an even lower confidence in the second instance. Accordingly, the likelihood parameter was low. Another parameter used to assess the reliability of the classification was the accuracy of the PNN in the overall set of new data. This was evaluated by means of a reliability index [24], which was defined as follows:  
\[\gamma=\frac{T_{fc}+0.2T_{fc-1}}{T_{c}} \tag{5}\]  
where \(T_{fc}\) is the total number of fabrics correctly classified, \(T_{fc-1}\) is the number of fabrics classified in the closer class, and \(T_{c}=200\) is the number of samples.