# A Framework for Pedestrian Attribute Recognition Using Deep Learning
## 4 Experiments
### Results and Discussion
Data oversampling focuses on the minority class by balancing the samples with the majority classes. Figure 7 shows that the RAP v2 dataset is imbalanced due to less data of some classes, i.e., AgeLess16, hs-Baldhead, ls-skirt, attachment-Handbag, etc. After applying the data oversampling technique described in the previous section, the number of samples for the minority class becomes equal to the majority classes. The power value distribution before applying data oversampling and after applying the data oversampling technique is shown in Figures 11 and 12, respectively. The experiment details of applying data oversampling technique and weighted loss are shown in Table 5.  
Table 5 shows that the experiment without oversampling performs better with 93.41% accuracy. The experiment with data oversampling increases the number of samples significantly, i.e., 462,046 images. This result proves that Model 5 performed better without the need for oversampling and weighted loss. The hyperparameters remained the same for experiment consistency. Hyperparameters are the variables whose values are not learned by the CNN architecture. Vivid experiments select these hyperparameter values. The necessity of an optimum hyperparameter for training a CNN architecture is significant. The optimum hyperparameters can reduce the training time, reduce loss function value, and increase accuracy. Table 6 shows experimentation on the different hyperparameters. Table 6 is obtained after thorough experimentation. The initial learning rate is 0.01, which will decrease by monitoring some factors, i.e., patience 3, factor 0.5, minimum delta \(1\times 10^{-4}\), minimum learning rate \(1\times 10^{-8}\). The total number of hidden layers is 1, with 1024 nodes. The batch size for training is 64. The number of epochs is 40. Additionally, the \"Adam\" optimizer is used for the backpropagation part of training a CNN architecture. In all experiments, these hyperparameters are selected for consistency. Figure 13 shows the loss and accuracy curve of Model 5 (ResNet 152 v2 architecture with trainable last 14 layers) on the datasets RAP v2 and PARSE100K. The curve shows that the loss is converged when the 40 th epoch is reached. Additionally, Figures 14 and 15 show the ROC curve of Model 5 on the RAP v2 dataset and the PARSE100K dataset, respectively. The ROC curve is a graphical representation of the false-positive rate over the true-positive rate. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Hyperparameters** & **Hyperparameter Space** & **Optimum Hyperparameter** \\ \hline No. of Dense Layer & 1, 2, 3 & **1** \\ No. of Neurons in Dense Layer & 128, 256, 512, 1024, 2048 & **1024** \\ Learning Rate & 0.1, 0.5, 0.01, 0.05, 0.001, 0.005 & **0.01** \\ Batch Size & 32, 64, 128, 256 & **64** \\ Epochs & 10, 20, 30, 40, 50 & **40** \\ Optimizer & ‘SGD’, ‘RMSProp’, ‘Adam’ & ‘Adam’ \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Hyperparameter selection from the hyperparameter space for the experiments. Figure 12: Distribution of power values after applying oversampling. Figure 14: ROC curve of Model 5 on the RAP v2 dataset. Figure 13: Performance of Model 5: (**a**) loss curve of the RAP v2 dataset; (**b**) accuracy curve of the RAP v2 dataset; (**c**) loss curve of the PARSE100K dataset; (**d**) accuracy curve of the PARSE100K dataset. Pedestrian attribute recognition is a multi-label classification task. In general cases, a single confusion matrix is needed to represent the multi-class classification related tasks. For a multi-label classification task, a confusion matrix is required per label. Figures 16 and 17 show the confusion matrix of Model 5 on the RAP v2 dataset and the PARSE100K dataset, respectively. The feature map developed after each block of Model 5 is shown in Figure 18. The feature map represents how an image is transformed in each layer of a CNN. The deeper the layer goes, the more complex the feature map becomes. In the last few layers, the features become uninterpretable for humans.