# Blind People: Clothing Category Classification and Stain Detection Using Transfer Learning
## 4 Experiments and Results
### Clothing Type Category Classification  
A total of three experiments were initially conducted using the Fashion Product Images Dataset. The two first experiments were based on fine-tuning, while the third experiment relied on feature extraction. In order to perform a comparison between all networks, the training and validation parameters were unchanged. Table 4 describes the hyper-parameters. The epochs were the only change between networks due to their architecture and targeting the best performance. The cross-entropy loss (Equation (6)) allowed us to measure how well a classification model performed, providing a probability value between 0 and 1:  
\[\mathrm{L_{CE}}=-\sum_{i=1}^{n}\mathrm{t_{i}}\log(\mathrm{p_{i}}),\text{ for n classes}, \tag{6}\]  
where \(\mathrm{t_{i}}\) is the truth label and \(\mathrm{p_{i}}\) is the Softmax probability for ith class. These networks were implemented using the Pytorch library and trained using an NVIDIA A100 running Ubuntu 20.04.2 LTS. Table 5 reports the fine-tuning results using pre-trained neural networks. During the fine-tuning process, the entire network is trained, meaning that all the layers' weights are trainable. However, the weights of batch normalization--a network layer inserted between hidden layers--are set to non-trainable to prevent the network from learning new batch normalization parameters, i.e., beta and gamma [51]. These batch statistics are likely to differ greatly if the fine-tuning examples differ from those in the original training dataset. As a result of the small size of the fine-tuning dataset, it is not always desirable to re-learn these parameters during fine-tuning. The results presented in Table 5 reveal that GoogLeNet had the highest validation accuracy, of 90.7%, with almost all networks presenting close validation accuracy values. Only MobileNet V3 presented a notably lower accuracy value, i.e., 88.3%. In addition, in the fine-tuning process, the depth between the same architectures (ResNet-18 and ResNet-50) for this dataset was not relevant, achieving approximately the same results, with 90.4% and 90.3% validation accuracy values, respectively. Moreover, the increase in the depth leads to more time consumption, and the number of epochs needed to achieve approximately the same results is equal. The depth between networks, as well as the parameters, does not show any correlation with the accuracy of them. \begin{table}
\begin{tabular}{c c} \hline \hline
**Parameters** & **Value** \\ \hline Optimizer & SGD \\ Momentum & 0.9 \\ Leaning rate & 0.001 \\ Batch size & 16 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Hyper-parameters of model experiments. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline
**Network** & **Train Accuracy** & **Validation Accuracy** & **Train Loss** & **Validation Loss** & **Epochs** & **Time (s)** \\ \hline ResNet-50 & 0.946 & 0.903 & 0.159 & 0.296 & 4 & 153.72 \\ ResNet-18 & 0.939 & 0.904 & 0.183 & 0.279 & 4 & 111.66 \\ MobileNet V2 & 0.917 & 0.898 & 0.233 & 0.290 & 4 & 139.04 \\ GoogLeNet & 0.940 & 0.907 & 0.189 & 0.279 & 7 & 266.20 \\ MobileNet V3 & 0.917 & 0.883 & 0.234 & 0.327 & 7 & 241.66 \\ (small) & 0.927 & 0.900 & 0.210 & 0.295 & 12 & 539.59 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Test performance results. The inference time was then evaluated for each network. For this, the synchronization time between the CPU and GPU was considered and 400 iterations of GPU warm-up were implemented. Table 6 summarizes the average time and the standard deviation for 400 inferences of the same image, and for each network. The results presented in Table 6 indicate that ResNet-18 allows us to achieve the best inference time. Moreover, these results allow us to infer that the inference time does not depend either on the number of parameters or on different network architectures. Furthermore, the standard deviation appears to be correlated with the inference time, as it increases with the inference time.